Login  Register

Re: Injecting a directory listing

Posted by skibohemen on Dec 26, 2019; 2:26pm
URL: https://discuss.asciidoctor.org/Injecting-a-directory-listing-tp7445p7446.html

Based on your use-case, you *may* be better off with a static site generator such as Hugo (gohugo.io), Jekyll ( https://jekyllrb.com/ )  or similar tools. If asciidoctor is needed for other reasons, you may look to asciidoc based site generators such as Antora ( https://antora.org/ ) and others. I love asciidoctor, but as a raw tool (used from cli interfaces, Ruby, Java etc), I tend to use it mostly for document-heavy and document-driven use-cases.

tor. 26. des. 2019 kl. 13:45 skrev Toolforger [via Asciidoctor :: Discussion] <[hidden email]>:
Hi all,

I am planning to use Asciidoctor to generate a static website (no other output format is considered).

The issue I don't know how to deal with is the table of website content, i.e. the list of other pages to be shown on each page.

Constraints:
- It needs to iterate over output pages, and ignore helper files.
- It needs to preserve the directory structure.
- Within a directory, the order should be according to file name.
- The text generated should be the page's title (NOT the file name).

One approach I have been considering:
- Start one Asciidoctor instance for each output file.
- Stop the Asciidoctor instances as soon as they know what the title is.
- Generate the ToC snippet.
- Continue the Asciidoctor instances.

How would one execute this approach?
Are there other approaches?

(Personal background: I don't know Ruby but I feel confident I can learn enough to get something done, as I have a bit of Smalltalk background and know quite a lot about very varied programming languages. I am currently most "into" Java, but I found that AsciidoctorJ data structures and algorithms would still require Ruby knowledge to properly use, so I'll want to stick with Ruby if programming is needed. I did some research into template engines and how they combine, and found a far too large selection of options to be able to even identify one that will will.)


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Injecting-a-directory-listing-tp7445.html
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Steinar Kjærnsrød
about.me/skibohemen
--
Steinar Kjærnsrød <skibohemen@gmail.com>