Rendering into hierarchical HTML?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Rendering into hierarchical HTML?

ramendik
Hello,

If I have a book or similar structured document in asciidoc, is it possible to render it into HTML not as one big file with a TOC, but as a tree of HTML files with child, parent, and sibling links?

Something like the way many open source related books are published, including Eric Raymond's TAOUP http://www.catb.org/esr/writings/taoup/html/
Reply | Threaded
Open this post in threaded view
|

Re: Rendering into hierarchical HTML?

mojavelinux
Administrator
This is possible, but not currently implemented in core. The reason is, I don't think this should be something core should do. I'm still researching / prototyping different approaches. I haven't settled on a solution yet.


On Fri, Oct 13, 2017 at 2:24 PM, ramendik [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello,

If I have a book or similar structured document in asciidoc, is it possible to render it into HTML not as one big file with a TOC, but as a tree of HTML files with child, parent, and sibling links?

Something like the way many open source related books are published, including Eric Raymond's TAOUP http://www.catb.org/esr/writings/taoup/html/


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Rendering-into-hierarchical-HTML-tp5972.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Rendering into hierarchical HTML?

ramendik
Thanks for the explanation. I think I have an idea how to make it happen but I'll need to play around with it much more before submitting it.

I'd do it in preprocessing, basically - so I can even script it as a separate preprocessor, and except for handling links it actually sounds like a simple task. If I get to a nice proof-of-concept, I'll get back to you and try to work out how to make this into an extension.

Just a couple of questions for now - what languages can extensions be written in? Is there any document anywhere about writing them?
Reply | Threaded
Open this post in threaded view
|

Re: Rendering into hierarchical HTML?

mojavelinux
Administrator
Just a couple of questions for now - what languages can extensions be written in? Is there any document anywhere about writing them? 

Ruby, Java, or JavaScript. If you write in Java, you just use AsciidoctorJ. If you write in JavaScript, you must use Asciidoctor.js. AsciidoctorJ can run extensions written in either Ruby or Java.

There is some documentation in the user manual.


Asciidoctor.js also has some documentation about how to write extensions.

-Dan

On Fri, Oct 13, 2017 at 3:29 PM, ramendik [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks for the explanation. I think I have an idea how to make it happen but I'll need to play around with it much more before submitting it.

I'd do it in preprocessing, basically - so I can even script it as a separate preprocessor, and except for handling links it actually sounds like a simple task. If I get to a nice proof-of-concept, I'll get back to you and try to work out how to make this into an extension.

Just a couple of questions for now - what languages can extensions be written in? Is there any document anywhere about writing them?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Rendering-into-hierarchical-HTML-tp5972p5978.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Rendering into hierarchical HTML?

ramendik
This post was updated on .
Thanks! Looks good. I'm a Pythonista but I also can do Java, so it's sorted.

Questions:

- if I want the document after all includes have been processed I have to go in at treeprocessor or later, right?

- if I want my code to produce *many* asciidoc documents from one, can an extension do that somehow?

My idea is to split things up early and then form all the fancy TOCs and links as asciidoc, not as html. This is way easier to code. Then let asciidoctor render these documents into HTML.

EDIT: I dove deep into the comments on issue 626 and found your reference to AsciiBinder. It appears that AsciiBinder might be a better fit for what I want to do. So I'll try to dig in that particular direction. Sorry if I wasted a bit of your time.