Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hi,
I initially created https://github.com/asciidoctor/asciidoctor-extensions-lab/pull/112 and it is working great in standalone asciidoctor. Now I created a simple gem to use in a site using jekyll asciidoctor. https://github.com/maxandersen/asciidoctor-tabbed-code What is now weird is that the extension registration does happen (verified by adding logging), but the extension is never actually called/applied. Is there a chance that in jekyll docprocessors are not called or am I doing something completely wrong ? You can see what I did in this jekyll asciidoctor enabled project to try and get it integrated: https://github.com/quarkusio/quarkusio.github.io/compare/develop...maxandersen:tabbed-code?expand=1 Any tips/pointers to what can cause docinfo processor extensions not to be called would be very appreciated! Thanks! |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
The docinfo processor doesn't run for embedded documents (which is the mode Asciidoctor uses inside a site generator like Jekyll). As to whether it should, that's an open discussion. But don't despair. You can use a postprocessor instead. When producing an embedded document, the two are effectively the same. (The other solution would be to create a liquid tag that can be used in the page template, or just add the additional resources to the page template directly. Though I realize that's not as encapsulated). Cheers, -Dan On Wed, Nov 6, 2019 at 4:11 PM maxandersen [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi, ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
In reply to this post by maxandersen
On Wed, Nov 6, 2019 at 4:15 PM Dan Allen <[hidden email]> wrote:
... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
In reply to this post by mojavelinux
Thanks for the fast answer Dan ! :)
Changing to postprocessor does definitely gets called - which is good means I was not going crazy. But I reckon for this particular usecase that is about adding style/css to the header postprocessor wouldn't be enough as it does not have access to the head elements to inject css/js. Your proposal for simply adding it directly in via jekyll mechanics will in this specific case probably be better. Well, oh well - I won't be able to use this tabbed-code extension then but those using "raw" asciidoctor can if they want to :) |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
On Wed, Nov 6, 2019 at 4:28 PM maxandersen wrote: Thanks for the fast answer Dan ! :) 👍
That would be true even if the docinfo gets called. The scope of the AsciiDoc processing in a site generator is typically inside the main content area of the page. Here the docinfo (and even the postprocessor to a degree) doesn't apply.
That's typically what I do.
Here's how I do it in Awestruct: https://github.com/asciidoctor/asciidoctor.org/blob/master/_layouts/base.html.slim#L103-L104 Best, -Dan -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
Oh, I almost forgot. The parsed document is exported to the page template too. So in the template (via a liquid tag) you can invoke the docinfo method. document.docinfo :footer docinfo could be a good liquid tag to include in the gem. -Dan |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
In reply to this post by mojavelinux
hmm - do you have an example/link of that matching asciidoctor extension for doing the environment detction and page attribute setup ? |
Free forum by Nabble | Edit this page |