Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2 posts
|
Hi everyone,
I am trying to lint text in asciidoctor documents. Being able to access the tokens generated by the parser would help me a great deal with it. From there it would possible to skip code blocks or to be sure to run the linter on text nodes only. If someone could point me the way to do it in Ruby, maybe I can figure out a way to to it with asciidoctorjs (I'm working in node). Thanks in advance! PS: marked gives access to its parser, which is pretty awesome! |
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
2681 posts
|
Asciidoctor does not provide low-level access to tokens. But there are various ways to interact with the AST that it does produce to accomplish your goal. The main entry point is the document and from there the list of blocks. See: That's a deep as it goes at the moment since the inline parsing is handled in a streaming fashion. That's why we have issue https://github.com/asciidoctor/asciidoctor/issues/61. In order to do all this in Asciidoctor.js, I recommend writing it in Ruby and compiling it to JavaScript using Opal. It's possible to access the AST from JavaScript, but the API is somewhat awkward. Still, it's workable once you get used to it. I recommend studying the chrome extension {1} and docgist {2} to see Asciidoctor.js in action. -Dan On Tue, Feb 23, 2016 at 8:26 AM, geowarin [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi everyone, ... [show rest of quote] Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen |
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
2681 posts
|
In reply to this post by geowarin
You might also want to study the JavaScript parts of AsciidocFX. -Dan On Tue, Feb 23, 2016 at 6:59 PM, Dan Allen <[hidden email]> wrote:
... [show rest of quote] Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2 posts
|
Thank you for your time, Dan.
I will have a look at the resources you provided this weekend and I'll keep you posted. |
Free forum by Nabble | Edit this page |