asciidoctor / asciidoctor-firefox-addon

:wolf: An add-on for Mozilla Firefox that converts AsciiDoc files to HTML directly in the browser using Asciidoctor.js.
https://addons.mozilla.org/en-US/firefox/addon/asciidoctorjs-live-preview/
MIT License
32 stars 9 forks source link

Update the asciidoctor.js library #22

Closed jmini closed 9 years ago

jmini commented 9 years ago

If I am not wrong, asciidoctor-firefox-addon uses the version 1.5.0 of asciidoctor.js It seems to me that a newer version is available (at least 1.5.1, maybe 1.5.2). Is it possible to publish a newer version of asciidoctor-firefox-addon relying on this newer version?

I think an update will be the fix for the issue: #21 Unresolved directive in - include::../inc.adoc[].

ggrossetie commented 9 years ago

Hi @jmini

If I am not wrong, asciidoctor-firefox-addon uses the version 1.5.0 of asciidoctor.js It seems to me that a newer version is available (at least 1.5.1, maybe 1.5.2).

You are correct!

Is it possible to publish a newer version of asciidoctor-firefox-addon relying on this newer version?

Yes sure, I will publish a new version on GitHub and http://asciidoctor.org/docs/editing-asciidoc-with-live-preview/

If you want you can submit a patch :smile:

jmini commented 9 years ago

It would be my pleasure to send you a pull request, but I hope that you can guide me (JavaScript is not my field of expertise).

I have installed asciidoctor.js with npm:

npm install asciidoctor.js

When I display the list of installed modules(using npm list), I see:

current repository
└─┬ asciidoctor.js@1.5.2
  ├── opal-npm-wrapper@0.1.1 (git://github.com/anthonny/opal-npm-wrapper.git#b56048584b3cf2cfebeef78b0fff54690e12e684)
  └── xmlhttprequest@1.6.0

This seems to work well.

But now when I list the content of the asciidoctor.js plugin, I see:

ls /node_modules/asciidoctor.js/dist/npm
asciidoctor-core.gz.js
asciidoctor-core.js
asciidoctor-core.min.js
asciidoctor-docbook.gz.js
asciidoctor-docbook.js
asciidoctor-docbook.min.js
asciidoctor-extensions.gz.js
asciidoctor-extensions.js
asciidoctor-extensions.min.js

I comparison asciidoctor-firefox-addon/data contains only asciidoctor.js and not asciidoctor-core.js, asciidoctor-docbook.js and asciidoctor-extensions.js.

What does this means?

When I look at ba05fcfc68259fe63cf71c142f0571208385b046 (Asciidoctor to 1.5.0-preview.7 & Opal to 0.6.2) two files were updated: data/asciidoctor.js and data/opal.js. Opal is a dependency. The update make sense. When I downloaded asciidoctor.js with npm I also got this dependency.

I am not sure to see how the files are organized here. My idea was to copy what I got from the npm download into this repository. I am not so sure that this was a good idea.

Another side question: to test my change, how can I upgrade the extension installed in my firefox to the version I have prepared locally in my git repo?

Thanks in advance for your help and advice.

ggrossetie commented 9 years ago

Hi @jmini thanks for spending some time on this issue :+1:

The Firefox extension is using the bower package of Asciidoctor.js (frontend) because the extension is running inside the browser. The npm package of Asciidoctor.js is used in Node.js (backend) development.

You can use bower to download the latest version of Asciidctor.js bower install asciidoctor.js --save. The two files are:

Another side question: to test my change, how can I upgrade the extension installed in my firefox to the version I have prepared locally in my git repo?

You will need to build the extension from source. You can follow the installation guide from the README: https://github.com/asciidoctor/asciidoctor-firefox-addon#installation

Feel free to ask if you have any trouble, thanks again for taking care of this issue :smile:

jmini commented 9 years ago

This guide is usefull to install bower on Ubuntu: Installing Bower on Ubuntu 14.04 LTS

Then as you told:

bower install asciidoctor.js --save

And replacing the files:

cp bower_components/asciidoctor.js/dist/asciidoctor.js git/asciidoctor-firefox-addon/data/asciidoctor.js
cp bower_components/opal/opal/0.6.3/opal.js git/asciidoctor-firefox-addon/data/opal.js
cp bower_components/asciidoctor.js/dist/css/asciidoctor.css git/asciidoctor-firefox-addon/data/asciidoctor.css 

The guide you linked to build the extension with the Firefox Add-on SDK is also good.

I will open a pull request. Thank you for your help.

ggrossetie commented 9 years ago

Perfect, thanks!

ggrossetie commented 9 years ago

You can install the latest version: https://github.com/asciidoctor/asciidoctor-firefox-addon/releases/tag/v0.3.0

I will also update the download link on the asciidoctor.org website: https://github.com/asciidoctor/asciidoctor.org/pull/353

jmini commented 9 years ago

Any idea how to update this page: https://addons.mozilla.org/fr/firefox/addon/asciidoctorjs-live-preview/

I was only able to post a review...

ggrossetie commented 9 years ago

See #9 I've been waiting for 5 months to get version 0.2.3 published ! Thanks for your review, I hope this will speed up the process