-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
[documentation] a portable asciidoctor with asciidoctorJS #900
Comments
Could you clarify what you mean by "portable Asciidoctor"? Asciidoctor is available on numerous language runtimes: Asciidoctor => Ruby, Asciidoctor.js => JavaScript / Node / Browser, AsciidoctorJ => Java / JVM. While I take your point that Ruby (or any of those other runtimes) can be a barrier to beginners, I also know thousands of writers (making up some of the 6.2 million downloads) who have had no prior experience with Ruby, and in some cases tech in general, yet have been able to pick it up and be productive with it. This is where good documentation comes in. Our focus should be to continue to make it as strong as we can (and there's work to do). Technology requires learning, so rather than shy away from it, we need to aim to be better teachers. People can learn.
I encourage you to explore the ecosystem more. You'll be delighted to find that there are plugins for almost all the major editors and IDEs, including the ones you listed. Beyond that, support for AsciiDoc is integrated very broadly. You can preview documents in AsciiDoc on GitHub and GitLab (GitLab being the better of the two experiences), there is a Docker image for Asciidoctor to use in CI / CD, it's integrated into build tools like Maven and Gradle, and almost every major static site generator has AsciiDoc support (namely Antora). So adoption of AsciiDoc is very broad. Is there something specific you're looking for that you think is missing? |
I think one of the challenges is the variety of programming languages. Does every project support the same features? Is a handwritten macro available in every language port (my best guess would be yes) As a first reply I would see three major themes:
I use PyCharm (or other intelliJ IDEs) or simply the Visual Studio Code with different plugins and the command line or build tasks. Some weeks ago I worked a bit with the hugo website generator who does a great asciidoc/pandoc integration. What I really loved about hugo itself was the installation (one exe file, a readme and a license text) For some one who is already on board or converts from markdown or rst this is all fine. But we had big troubles to argue with people that are not software developers or that think MS word will solve all problems. Maybe a good documentation and setup guide is the key solution. On the other hand (coming back to my original question) This is not strictly required from a good tool. Only a resilient and stable pattern. |
Hello @42sol-eu I will try to answer your questions.
I think it's a great opportunity. Asciidoctor is available on the JVM and in pretty much any JavaScript environment. So it gives us the opportunity to execute Asciidoctor in the browser, in a Java application or in a Ruby web application (like GitHub or GitLab).
Overall yes but that highly depends on the environment itself (ie. a given environment does not support the same features). But that's not really specific to Asciidoctor. I mean do comrak (a Rust Markdown parser and renderer) support the same features as showdown? Absolutely not, the API is not even close! Ruby require 'asciidoctor'
Asciidoctor.convert_file 'README.adoc', to_file: true, safe: :safe JavaScript const asciidoctor = require('asciidoctor')()
asciidoctor.convertFile('README.adoc', { to_file: true, safe: 'safe' }) Java Map<String, Object> options = options().toFile(true).safe(SafeMode.SAFE).asMap();
String html = asciidoctor.convertFile(new File("README.adoc"), options);
If you are writing an extension in Ruby you can compile it to JavaScript using Opal. So you can use it in both Asciidoctor and Asciidoctor.js. And I believe that it's possible to use a Ruby extension in AsciidoctorJ using JRuby.
We certainly want good editors based on Asciidoctor but that's also out-of-the-scope of Asciidoctor.
I'm not sure I quite understand what you mean? Could you please clarify?
👍
If you like single binary then you should use the Asciidoctor.js binary attached to this release: https://github.com/asciidoctor/asciidoctor.js/releases/tag/v2.0.3
While I agree that a simple AsciiDoc editor would probably ease the transition, the paradigm shift is probably the hardest step in this transition.
The documentation of Asciidoctor will soon be overhauled and it will be easier to contribute, so feel free to gather feedback to improve the setup/install guide in the documentation.
You should definitely try the binaries attached to this release: https://github.com/asciidoctor/asciidoctor.js/releases/tag/v2.0.3 |
Hi Guillaume, Thanks for your long answer. I did not ask for cross language portabilities of plugins. I also understand, that you are providing the engines and someone else should look into UI features. **That is exactly what I am aiming for. ** But it is looks hard to start an application with a dependency of ruby installed. If I would take the approach of creating an Editor like Typora (or try to convince the Typora developer to aim for a integration of Asciidoctor) I need a good and solid story or a self containing tool. Asciidoctor shines with its plugins (not my plugins but yours! Thanks for that) I am thinking of asciidoctor-diagram, asciidoctor-epub and asciidoctor-pdf (maybe not about asciidoctor-bespoke and the other backends) Lets pick the hardest and greatest asciidoctor-pdf in its ruby implementation. As far as I read your comment I would loose this library by switching to asciidoctorJs because the asciidoctor-pdf plugin in asciidoctorJs is a differnt thing implemented without prawn. (Might it be a good idea to name different things differently?) I got that for this plugin. Would it be the same with other plugins? Is there a way how I can evaluate (and document it)? So this is my aim would a asciidoctor content project look the same for html, epub, docbook and pdf if I switch the engines (ruby, javascript, java)? I guess yes but to what extend. I want to contribute in my range of skills. |
I see... Something like that?
👍
It depends on your requirements since every implementation has tradeoffs.
I'm not really sure in which language Typora is written but it will play a big factor if you want to tightly integrate Asciidoctor in Typora. The other option is to call the binary. I think that's what Hugo is doing (calling the command
As mentioned, Asciidoctor.js is available as a binary so it might give you what you need.
💯
You're correct. The project is currently named asciidoctor-pdf.js on GitHub. We are using the ".js" extension to make it clear that it's a JavaScript implementation but we might rename it to "asciidoctor-web-pdf.js". Not sure about it yet, this is an open issue.
Yes some plugins/converters are compatible (and provide the same set of features) between multiple runtimes (Java, JavaScript, Ruby), some others are compatible with only one runtime and some others are compatible with multiple runtimes but not all features are available.
I guess you will need to explore the (vast) Asciidoctor ecosystem, read the documentation and evaluate.
EPUB is not available in Asciidoctor.js and as you've mentioned Asciidctor (Web) PDF is a not a port of Asciidoctor PDF (Ruby) but a new project based on a different technological stack.
I gave you a few links in the table above, you can also browser the asciidoctor organization on GitHub since official/well established projets are part of the organization. |
@42sol-eu Having to explain and search for information over GitHub made me realize that we do a lot of things... but also that it's really hard to get a clear picture of what's available and how things work together... so we definitely need to improve that part. For reference, I keep a list of all the extensions, that I'm aware of, that are working on Asciidoctor.js: https://asciidoctor-docs.netlify.com/asciidoctor.js/extend/extensions/ecosystem/ Maybe we could start by doing an inventory of what's available in Asciidoctor.js? What do you think? |
I love it. I got lost in the weeds many times. Like a Hitchhikers Guide To Asciidoctor? |
I think this issue is too open ended to be actionable. The one tangible suggestion that seems to come out of it is the table Guillaume showed for what is available per Asciidoctor port. The rest of it just seems to be a plea for Asciidoctor to be something it is not, which is a processor for a single language runtime. The reason Asciidoctor is available for Ruby, JavaScript, and Java is because many people need to be able to use Asciidoctor without changing their own language runtime. In other words, we had to do it out of necessity. If you have a choice, then the Ruby platform is the right one because it is the foundation...and the documentation already leads new users in that direction. You only need to venture beyond it if you have a need. |
thanks for your comment - I agree with you! |
Is anyone aware of a portable asciidoctor.
As I see it from my beginners point of view ruby is very hard to make portable (at least on Windows). I know that a software developer like me is easily able to install the toolchain and use it.
But we want to integrate other engineers and fellow workers who are no command line lovers. ((A great example for our use case would be the app Typora for markdown documentation))
I think that newer editors or IDEs (like Visual Studio Code or IntelliJ) would be a good start point to edit and preview. But the generation of HTML and PDF documents would be the next step.
My first thought was to make asciidoctor into a portable application.
Another thought would be to build on a server system (like gitlab or githubs CI).
Any projects that you know of who implented one of these approaches?
The text was updated successfully, but these errors were encountered: