AsciidoctorJ: Manipulate the document contents

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

AsciidoctorJ: Manipulate the document contents

gastaldi
Hello,

What is the best way (if possible) to manipulate the contents of an Asciidoc file using AsciidoctorJ? I am looking for something that parses the entire document into a model in memory and provides a way to persist those changes back to the document.

Best Regards,

George Gastaldi
Reply | Threaded
Open this post in threaded view
|

Re: AsciidoctorJ: Manipulate the document contents

mojavelinux
Administrator
George,

Welcome!

I'm happy to say that we have the first part, parsing AsciiDoc into an AST. However, we don't yet have the second part, which is writing the result back to disk.

Although we don't have that yet, there are partial pathways to get there. For instance, Schalk has been working on creating a converter for Leanpub, which transforms AsciiDoc into Leanpub Markdown {1}. You can imagine that creating a converter to generate AsciiDoc output isn't much more of a stretch.

We've also been talking about a document builder API as part of AsciidoctorJ. Robert Winkler originally brought it up since he needed something similar for his swagger2markup project {2}. For now, he has created that builder in that project, so there is a starting point for generating AsciiDoc content.

Eventually, I think we want Asciidoctor core to provide a built-in converter for AsciiDoc {3}. This would allow Asciidoctor to parse AsciiDoc and write it back out again. That allows you to use any of the extension mechanism, including a Treeprocessor, to manipulate the document content in between.

The short answer is, we want to be able to do it, but right now we only have “lines in the water”.

-Dan


On Thu, Jun 18, 2015 at 1:44 PM, gastaldi [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello,

What is the best way (if possible) to manipulate the contents of an Asciidoc file using AsciidoctorJ? I am looking for something that parses the entire document into a model in memory and provides a way to persist those changes back to the document.

Best Regards,

George Gastaldi


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



--
Reply | Threaded
Open this post in threaded view
|

Re: AsciidoctorJ: Manipulate the document contents

gastaldi
Thank you for the reply, Dan. 

You guys are doing a great job with Asciidoctor. Hopefully I may contribute to the project in the future. 



-------- Mensagem original --------
De: "mojavelinux [via Asciidoctor :: Discussion]" <[hidden email]>
Data: 18/06/2015 22:49 (GMT-03:00)
Para: gastaldi <[hidden email]>
Assunto: Re: AsciidoctorJ: Manipulate the document contents


George,

Welcome!

I'm happy to say that we have the first part, parsing AsciiDoc into an AST. However, we don't yet have the second part, which is writing the result back to disk.

Although we don't have that yet, there are partial pathways to get there. For instance, Schalk has been working on creating a converter for Leanpub, which transforms AsciiDoc into Leanpub Markdown {1}. You can imagine that creating a converter to generate AsciiDoc output isn't much more of a stretch.

We've also been talking about a document builder API as part of AsciidoctorJ. Robert Winkler originally brought it up since he needed something similar for his swagger2markup project {2}. For now, he has created that builder in that project, so there is a starting point for generating AsciiDoc content.

Eventually, I think we want Asciidoctor core to provide a built-in converter for AsciiDoc {3}. This would allow Asciidoctor to parse AsciiDoc and write it back out again. That allows you to use any of the extension mechanism, including a Treeprocessor, to manipulate the document content in between.

The short answer is, we want to be able to do it, but right now we only have “lines in the water”.

-Dan


On Thu, Jun 18, 2015 at 1:44 PM, gastaldi [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello,

What is the best way (if possible) to manipulate the contents of an Asciidoc file using AsciidoctorJ? I am looking for something that parses the entire document into a model in memory and provides a way to persist those changes back to the document.

Best Regards,

George Gastaldi


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



--



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/AsciidoctorJ-Manipulate-the-document-contents-tp3412p3413.html
To unsubscribe from AsciidoctorJ: Manipulate the document contents, click here.
NAML