asciidoctor / asciidoctor-doctest

:hammer: Test suite for Asciidoctor backends
MIT License
12 stars 16 forks source link

Have the ability to use asciidoctor-doctest from the JavaScript Asciidoctor ecosystem #13

Open obilodeau opened 7 years ago

obilodeau commented 7 years ago

We are adding doctest support to asciidoctor-reveal.js and we are facing a problem where only our ruby-based slim templates will be testable using doctest and not our jade templates (used by AsciidocFX or anyone who prefers managing their slide decks with node/npm instead of ruby). Since reveal.js is a node/npm project it integrates well that way too.

It would be nice if we could use doctest from our asciidoctor-reveal.js plugin. This is an example of how it is used in the reveal.js context.

obilodeau commented 7 years ago

This is not gonna happen and the reasoning is sound: https://github.com/asciidoctor/asciidoctor-reveal.js/pull/116#issuecomment-323537244

ggrossetie commented 7 years ago

@jirutka @obilodeau I think this issue is still relevant no ?

Jakub was suggesting to be able to run a command line (ie. https://github.com/asciidoctor/asciidoctor-cli.js).

Currently AsciidocConverter is basically a wrapper around the Asciidoctor.convert Ruby API but we could configure this converter to run either the Ruby API or the JavaScript cli. Though this is not really extensible and I think a better solution should be to create multiple implementations:

Ideas ? Thoughts ?

obilodeau commented 7 years ago

I thought that if we compiled the slim templates to Ruby and tested that with doctest in Ruby that it would suffice.

As I write this, I realize that this wouldn't catch regressions or issues introduced by Opal, Asciidoctor.js or our javascript build script.

jirutka commented 7 years ago

This is not gonna happen and the reasoning is sound…

Nope, it’s going to happen, i.e. DocTest will be able to run asciidoctor.js. This modularity was part of the refactoring effort, but it’s not done yet.

ggrossetie commented 7 years ago

@jirutka Do you already have a working branch for this refactoring or can I give it a try ?