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

Converting the examples using javascript / node toolchain #149

Merged
merged 6 commits into from
Dec 24, 2017

Conversation

obilodeau
Copy link
Member

Just a start of javascript testing. People with javascript and npm experience please comment. I borrowed this from Asciidoctor.js and Asciidoctor-template.js.

Tests fail exactly where it should. Waiting on #143 to be fixed.

npm/builder.js Outdated
callback => builder.compileExamples(callback), // Compile examples
], () => {
log.info(`
In order to visualize the result, a local HTTP server must be started within the root of this project otherwise you will have cross-origin issues.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it applies in this context

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

npm/builder.js Outdated
});
};

Builder.prototype.compileExamples = function (callback) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the naming is misleading since we are not really compiling examples

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Changed to convert.

const builder = new Builder();

log.task('examples');
builder.examples();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in #156 (comment) I think we should use an "examples" task to demonstrate how to use the converter in JavaScript.

In the Asciidoctor.js repository, I have one example with a textarea on the left of the page and the rendered Reveal.js presentation on the right of the page.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand what you mean. We have it in the documentation already. Adding an example would mean maintaining two copies of the same code and instructions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I thought the purpose of the examples task was to provide a "live" example.

@@ -48,7 +50,7 @@ Builder.prototype.removeBuildDirSync = function () {
Builder.prototype.compile = function (callback) {
log.task('compile');
var opalCompiler = new OpalCompiler({dynamicRequireLevel: 'ignore'});
opalCompiler.compile('asciidoctor-revealjs', 'build/asciidoctor-revealjs.js', ['lib']);
opalCompiler.compile('asciidoctor-revealjs', 'build/asciidoctor-reveal.js', ['lib']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are probably right the revealjs.js is a bit too much 😉

@obilodeau obilodeau changed the title Implemented smoke testing using javascript / node toolchain Converting the examples using javascript / node toolchain Dec 24, 2017
@obilodeau obilodeau merged commit c823f7c into asciidoctor:master Dec 24, 2017
@obilodeau obilodeau deleted the npm-smoke-testing branch December 24, 2017 18:22
@ggrossetie
Copy link
Member

🎉 🎉 🎉

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

Successfully merging this pull request may close these issues.

None yet

2 participants