asciidoctor-intellij-plugin icon indicating copy to clipboard operation
asciidoctor-intellij-plugin copied to clipboard

When use the inline included, leveloffset should be honoured.

Open danhaywood opened this issue 4 years ago • 4 comments

In a top-level crud.adoc file, I have:

include::crud/updating.adoc[leveloffset=+1]

where updating.adoc starts:

= Updating
yada yada

When I inline this, I expect that the headers are incremented, so that the inline text reads:

== Updating
yada yada

However, it is unchanged.

danhaywood avatar Mar 24 '20 18:03 danhaywood

Thanks for reporting this.

The inline of include doesn't respect any include attribute. Some of them are impossible to inline (for example tags). Therefore the next version will not show this intent once include attribute are defined in the brackets.

ahus1 avatar Mar 24 '20 20:03 ahus1

OK fair enough. Perhaps a different ticket would be to introduce support for selected attributes, such as leveloffset? Appreciate that it's more effort, I suppose it depends whether the API you are using gives you an AST you can manipulate, or just a bunch of text.

danhaywood avatar Mar 25 '20 08:03 danhaywood

It is all AST, and they can be manipulated. The plugin already does this in several other places already. Still, it will be some work here to get it right in all the cases. Examples would be the three different styles of headings, sub-includes etc. Let's see and take it one step at a time.

ahus1 avatar Mar 25 '20 10:03 ahus1

Pre-release 0.30.46 offers this only when the include has no attributes. I'm re-labeling this issue as an enhancement to add support for leveloffset and possibly other attributes when inlining and include.

ahus1 avatar Mar 25 '20 19:03 ahus1