-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inheriting included attributes #41
Comments
This will work if you define the attributes in the document header, like this: = My page
include::data/shared-metadata.adoc[]
{metadata_0}
== Page 1
{metadata_1}
== Page 2
{metadata_2} |
Yes! Thank you and that solves it 👍 |
Apologies, but after some more testing, I tend to see defining the attributes include in document header was a workaround to the root issue. I guess I expect the asciidoc to build the same no matter if I am using multipage or not. Does the workaround you mentioned have to do with a technical limitation of the asciidoctor API you extend and the point at which attributes are able to be inherited? |
Well, that seems reasonable, but it's not perfect. (And we are also literally expecting it to not build the same, in that we want it to generate multiple HTML output pages rather than just one.)
I suppose so, but I cannot answer that for sure. I do know that asciidoctor-multipage works by taking the single, entire |
@owenh000 Thanks for the follow-up. |
Just by chance, I found that if I only mention in the include in the top level section then multipage renders as I would expect. Internally, this may be acting the same as the workaround you already mentioned. So the following works and renders correctly no matter the placement of the include:
|
@bostrt, thanks for sharing the example. |
It would appear that this is a specific instance of the more general #23 Here is what works and what fails for me: FAILS - Content in preamble
WORKS - No content in preamble
WORKS - Move attributes definitions into header
WORKS - Move title into preamble
|
I think this could be considered a bug in asciidoctor-multipage. It would be easier to work on with issue #46 completed. |
Hello! I'm a new user to asciidoctor and asciidoctor-multipage so please bare with me 😅 . I have a
main.adoc
where I'm including some attributes use throughout. For example:data/shared-metadata.adoc
contains the attributes referenced.When I build the adoc normally, they are rendered as expected. However, when I build using asciidoctor-multipage, The resulting output only shows attributes on the main page (
metadata_0
) but pages 1 and 2 only show the place holders.asciidoctor -r ~/code/asciidoctor-multipage/lib/asciidoctor-multipage.rb -b multipage_html5 main.adoc -D out
Is it possible for the included adoc to be inherited and render those attributes in other HTML pages?
The text was updated successfully, but these errors were encountered: