-
Notifications
You must be signed in to change notification settings - Fork 19
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
JS version #7
Comments
Yes, conversion to JavaScript is very possible. In fact, I choose to base the converter on Kramdown for exactly that reason. Kramdown is a single, pure Ruby gem, making it very compatible with Opal. We could either transpile Kramdown (and release it as Kramdown.js), then transpile Kramdown AsciiDoc, or we could just bundle it all into a single distribution. cc: @Mogztter (we may have to patch some of the regexp like we do in JavaScript)
I've made similar efforts in the past. But I soon realized that the only practical way to make a reliable converter is to start with a real Markdown parser. Kramdown is one of the most widely used and well-adopted parsers, plus it has an AST, so it's a perfect starting point. |
I think it makes sense to transpile and release Kramdown.js (as this library can be useful). |
👍 It could also be a very useful study case for Opal. |
Now that 1.0.0 is out, it's probably a good time to start exploring transpilation to JavaScript. The tough part is going to be Kramdown. Has anyone given it a shot yet? |
Any update on this? I want to try & use this with Maven and the only ruby plugin I found is not compatible with JDK11. My use case is to include some markdown source files into an Antora site that is automatically built using maven for a Java project. |
Block extension to filter text like: [markdown] -- Filter some text with [Markdown](https://commonmark.org/help/) syntax. -- This is not implemented with a full Markdown parser. See asciidoctor/kramdown-asciidoc#7 with a link to the "naive series of regexes" used as starting point. (And note that we use Open structural context https://docs.asciidoctor.org/asciidoc/latest/blocks/delimited/#summary-of-structural-containers with `--` delimiters, and headings don’t work inside these.) This feature is intended for handling OpenAPI specs, which can contain Markdown, however openapi-generator has poor Asciidoc handling OpenAPITools/openapi-generator#11396 so instead we add the block delimiters in the template, and let the block filter handle it.
Block extension to filter text like: [markdown] -- Filter some text with [Markdown](https://commonmark.org/help/) syntax. -- This is not implemented with a full Markdown parser. See asciidoctor/kramdown-asciidoc#7 with a link to the "naive series of regexes" used as starting point. (And note that we use Open structural context https://docs.asciidoctor.org/asciidoc/latest/blocks/delimited/#summary-of-structural-containers with `--` delimiters, and headings don’t work inside these.) This feature is intended for handling OpenAPI specs, which can contain Markdown, however openapi-generator has poor Asciidoc handling OpenAPITools/openapi-generator#11396 so instead we add the block delimiters in the template, and let the block filter handle it. Create a block with potentially multiple lines (sub-paragraphs) * Add extensions doc page
I built a quick and dirty Markdown to Asciidoctor converter for one-off documents that can be quickly converted in the browser. It uses a very naive series of regexes to do the conversion rather than trying to do anything fancy (which is actually just enough to cover most of the basic features of Markdown), but it would obviously be better if it were possible to use kramdown-asciidoc as a backend instead. Would it be feasible to do something similar to asciidoctor.js and use Opal for example to turn this into a JS library?
The text was updated successfully, but these errors were encountered: