Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Textmate rules for highlighting Rascal code in Asciiidoctor-based documentation? #9

Open
PaulKlint opened this issue Dec 6, 2016 · 5 comments

Comments

@PaulKlint
Copy link
Member

This is a question rather than an issue.

At the moment we are working on new infrastructure for our Rascal documentation that is based on Asciidoctor (see http://asciidoctor.org). Asciidoctor supports highlighting in various ways (see http://asciidoctor.org/docs/user-manual/#source-code-blocks). Now the question is: can we convert the nice Textmate rules under development by @ahmadsalim to input for any of the supported systems by Asciidoctor:

I would prefer to have less Ruby/Python and more Javascript in the solution we will adopt.

Any thoughts?

@ahmadsalim
Copy link
Collaborator

Maybe https://github.com/gjtorikian/pointillist could be useful?
I have not heavily investigated it yet, but it may do what is needed.

@ahmadsalim
Copy link
Collaborator

I have tried searching around for more, and unfortunately I could not find anything more directly useful.

Interestingly, it seems that AsciiDoctor itself is written in Ruby and translated to JavaScript via Opal (http://opalrb.org/), so maybe that is an alternate solution, but I am unsure how well it would work.

@PaulKlint
Copy link
Member Author

You are completely right about the implementation of AsciiDoctor. At the moment we are using (only at build time to avoid shipping JRuby in the Rascal jar) AsciiDoctorJ which is a Java wrapper that uses Ruby inside (via Opal as you mentioned), see https://github.com/asciidoctor/asciidoctorj.

In the future we may also want to provide documentation generation facilities at runtime and that would change the above situation.

I am currently focussing on the compiled Rascal REPL, but will come back to this issue asap.

@ahmadsalim
Copy link
Collaborator

I might have found another more palatable alternative.
One could try translating the TextMate grammar to an Atom one, and then use the Atom javascript based Highlights solution.
However, the latter seems to rely on NodeJS, so I am unsure how one could incorporate it inside the browser.

@ahmadsalim
Copy link
Collaborator

So I have made a new PR #13 which converts the grammar to an Atom compatible one using the proposed link, so that would at least solve one part of the issue I hope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants