Skip to content
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

docinfo.html is not inserted #198

Closed
timothypratley opened this issue Jun 16, 2018 · 5 comments · Fixed by #324
Closed

docinfo.html is not inserted #198

timothypratley opened this issue Jun 16, 2018 · 5 comments · Fixed by #324

Comments

@timothypratley
Copy link

Expected:
Including a docinfo.html file and a :docinfo: shared attribute should cause it to appear in the html output.

Actual:
HTML is not inserted.

Workaround:
I am able to ln -s docinfo.html docinfo-header.html
Then the html is inserted into head.
i.e.: file must be called docinfo-header.html to be inserted, which contradicts the documentation in asciidoctor user manual.

I discovered this workaround on observing that the code is looking for header here:

- unless (docinfo_content = docinfo :header, '.html').empty?

There is related and conflicting information here:
asciidoctor/asciidoctor#1510

My repo demonstrating the problem:
https://github.com/timothypratley/enterprise-clojure-training

@mojavelinux
Copy link
Member

Please see https://github.com/asciidoctor/asciidoctor-bespoke/blob/master/templates/slim/document.html.slim for the correct way to support docinfo in the reveal.js converter. Specifically:

        - unless (_docinfo = docinfo :header, '-reveal.html').empty?
          =_docinfo

...

        - unless (_docinfo = docinfo :header, '-reveal.html').empty?
          =_docinfo

...

      - unless (_docinfo = docinfo :footer, '-reveal.html').empty?
        =_docinfo

I believe we should look for the -reveal.html qualifier to avoid conflicting with the docinfo file used for the HTML output. wdyt?

@timothypratley
Copy link
Author

timothypratley commented Jun 16, 2018

According to https://asciidoctor.org/docs/user-manual/#naming-docinfo-files conflicts can be avoided by using the private naming scheme. Thus if I wanted to have a docinfo only apply to slides I would call it slides-docinfo.html and set the :docinfo: private attribute. I think that when :docinfo: shared is set then docinfo.html should be included in the slides head.

Right now I am using docinfo.html as a shared location to set a favicon that is used in both slides output and a book/manual output. I can see that sometime you would want to include javascript specific to the slides.

I am new to asciidoctor and .slim so my apologies if I am misunderstanding. I'm very grateful that it is capable of so many things. Just raising the issue to improve the ability of new users to make use of it :)

@mojavelinux
Copy link
Member

According to asciidoctor.org/docs/user-manual/#naming-docinfo-files conflicts can be avoided by using the private naming scheme. Thus if I wanted to have a docinfo only apply to slides I would call it slides-docinfo.html and set the :docinfo: private attribute.

That's still not sufficient to support the goal of a single source document. Some users want to be able to generate an article and slides from the same document. But the docinfo file wouldn't be able to tell the difference.

What we could do is introduce the idea of a docinfo qualifier. The reveal.js and bespoke converters would set this by default, but it would still be possible to nullify it using at attribute assignment. That would give us the best of both worlds.

@mojavelinux
Copy link
Member

To clarify, you are absolutely right to raise this issue. I'm simply suggesting that we bring the behavior into alignment with the bespoke converter.

@timothypratley
Copy link
Author

I see. Yes, that sounds perfect! :)

@obilodeau obilodeau added this to the 2.1.0 milestone Nov 7, 2018
ggrossetie added a commit to ggrossetie/asciidoctor-reveal.js that referenced this issue Jan 30, 2020
ggrossetie added a commit to ggrossetie/asciidoctor-reveal.js that referenced this issue Jan 30, 2020
obilodeau added a commit that referenced this issue Feb 3, 2020
resolves #198 resolves docinfo head, header and footer
@ggrossetie ggrossetie modified the milestones: 4.2.0, 4.0.0 Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants