HACKING.adoc in asciidoctor-revealjs-1.1.3 vs HACKING.adoc in asciidoctor-revealjs-2.0.0

- old
+ new

@@ -2,10 +2,25 @@ :toc: preamble :toclevels: 2 Short instructions that aim to help potential contributors. +== Getting Started + +* Setup the Asciidoctor-revealjs plugin in <<ruby-localversion,development mode>> +* Modify the http://slim-lang.com/[slim templates] in `templates/` +* Templates need to be compiled before being used, do so with: + + bundle exec rake build + +* Then using the following command will render slides with your template changes baked in: + + bundle exec asciidoctor-revealjs <source.adoc> + +The next section will provide further help on how to use `print` statements or a debugger to assist development. + + == Inspect the template system To understand what you have access to in templates you can inject some ruby. With the slim templating system, this is done by prepending the lines with a dash (`-`) and inserting a ruby statement. Two complementary approaches can be used to explore the context offered by asciidoctor through the template system: @@ -122,26 +137,26 @@ bundle config --local github.https true bundle --path=.bundle/gems --binstubs=.bundle/.bin bundle exec rake build -Go to `test/output/slim/` folder and install `reveal.js`: +Go to `test/doctest` folder and install `reveal.js`: - cd test/output/slim/ + cd test/doctest/ git clone https://github.com/hakimel/reveal.js.git === Render tests into .html From the project's root directory: - bundle exec rake generate FORCE=yes + bundle exec rake doctest::generate FORCE=yes === Open rendered files NOTE: Right now, https://github.com/asciidoctor/asciidoctor-doctest/issues/12[doctest issue #12] means that the generated examples will not be pretty. -You can open the generated `.html` in `test/output/slim/` in a Web browser. +You can open the generated `.html` in `test/doctest/` in a Web browser. == Asciidoctor API's gotchas === Attribute inheritence @@ -209,12 +224,11 @@ === Test a local asciidoctor-reveal.js version In order to test the Node package, you first need to build the converter into Javascript and create a tarball of the project. - $ bundle exec rake build:converter:opal - $ npm run build + $ bundle exec rake build:js $ npm pack That last command will produce a file named `asciidoctor-reveal.js-<version>.tgz` in the working directory. Then, create a test project adjacent to the clone of the [.path]_asciidoctor-reveal.js_ repository: @@ -230,18 +244,19 @@ Then proceed as documented in the `README.adoc`. === Upgrade Asciidoctor.js version -WARNING: It is important to track `Asciidoctor.js` and `bestikk-opal-compiler` versions together. -The `opal-compiler` used to compile our node package must match `asciidoctor.js` `opal-runtime`. -The former is explicitly installed by users on install and the later is specified in our `package.json`. +WARNING: It is important to track `Asciidoctor.js` and `opal` versions together. +The `opal` used to compile our node package must match `asciidoctor.js`'s `opal` requirement. +The former is specified in our `package.json` and the latter in the `asciidoctor-revealjs.gemspec`. When you update one remember to update the other. -Versions known to work together can be found here, just replace <tag> with the `asciidoctor.js` release you are interested in: https://github.com/asciidoctor/asciidoctor.js/blob/<tag>/package.json +Versions known to work together can be found by looking at the Asciidoctor.js release notes, just replace <tag> with the `asciidoctor.js` release you are interested in: https://github.com/asciidoctor/asciidoctor.js/releases/tag/<tag>. == RubyGem package +[[ruby-localversion]] === Test a local asciidoctor-revealjs version Compile the converter: $ bundle exec rake build @@ -276,16 +291,16 @@ $ bundle exec rake build $ gem build asciidoctor-revealjs.gemspec $ gem push asciidoctor-revealjs-X.Y.Z.gem . Check that the new version is available on https://rubygems.org/gems/asciidoctor-revealjs[rubygems.org] -. Generate a compatible version of the Ruby converter (using opal mode) +. Generate the javascript version of the Ruby converter + - $ bundle exec rake build:converter:opal + $ bundle exec rake build:js -. Build the node package (make sure you have `devDependencies` installed with: `npm install`): +. Test the node package (make sure you have `devDependencies` installed with: `npm install`): + - $ npm run build + $ npm run test . Publish the node package on npm: + $ npm login # only required if not already authenticated $ npm publish