docgist icon indicating copy to clipboard operation
docgist copied to clipboard

Upgrade to Asciidoctor.js 1.5.3

Open ggrossetie opened this issue 9 years ago • 24 comments

Could you please test that everything is working fine with version 1.5.3-preview.2 ? If this is the case I will release a final version.

Thanks :smile:

ggrossetie avatar Nov 04 '15 19:11 ggrossetie

To clarify, the version is 1.5.3-preview.2 (notice the hyphen). https://www.npmjs.com/package/asciidoctor.js

mojavelinux avatar Nov 04 '15 20:11 mojavelinux

I'm on it.

nawroth avatar Nov 05 '15 21:11 nawroth

There seems to be a difference in how attributes are handled. At least that's my guess because:

  • Syntax highlighting doesn't kick in: http://nawroth.github.io/docgist/#_source_code_highlighting
  • imagesdir isn't picked up for images: http://nawroth.github.io/docgist/?github-asciidoctor%2Fdocgist%2F%2Fgists%2Fimages.adoc

@Mogztter

nawroth avatar Nov 05 '15 23:11 nawroth

Yep, I raised this point in another issue. We need a hack in the build that removes an obsolete hack for Opal. Attributes passed as a string aren't getting split correctly.

mojavelinux avatar Nov 05 '15 23:11 mojavelinux

Plese update here when there's a fix.

nawroth avatar Nov 06 '15 10:11 nawroth

Just released a 1.5.3-preview.3. This version should :zap: this :bug:

ggrossetie avatar Nov 07 '15 22:11 ggrossetie

Nice!

mojavelinux avatar Nov 07 '15 23:11 mojavelinux

The dist folder wasn't updated!

nawroth avatar Nov 08 '15 11:11 nawroth

That's definitely something we should automate.

mojavelinux avatar Nov 08 '15 12:11 mojavelinux

Damn! Yes manual releases are prone to error... we should definitely automate the process! Automate all the things!!! Le 8 nov. 2015 1:01 PM, "Dan Allen" [email protected] a écrit :

That's definitely something we should automate.

— Reply to this email directly or view it on GitHub https://github.com/asciidoctor/docgist/issues/21#issuecomment-154814443.

ggrossetie avatar Nov 08 '15 14:11 ggrossetie

1.5.3-preview.4 is out!

ggrossetie avatar Nov 08 '15 17:11 ggrossetie

I'm still seeing the same issue. You can try it out at http://nawroth.github.io/docgist/

nawroth avatar Nov 09 '15 00:11 nawroth

@nawroth With Opal 0.8.0 doc.attributes.map is empty (for an unknown reason) and you must use doc.attributes.smap instead. Or you can use doc.$attrs('name') to stay out of Opal's "internal".

ggrossetie avatar Nov 09 '15 10:11 ggrossetie

doc.attributes.smap works. One difference I noticed is that running with parse_header_only=true will only return attributes that are actually in the document header, while it previously didn't mind a blank line between title and document attributes.

So I fixed the examples to work with it, for example:

  • http://nawroth.github.io/docgist/?github-nawroth%2Fdocgist%2F%2Fgists%2Fimages.adoc
  • http://nawroth.github.io/docgist/?github-nawroth%2Fdocgist%2F%2Fgists%2Fcodemirror.adoc

nawroth avatar Nov 09 '15 19:11 nawroth

One difference I noticed is that running with parse_header_only=true will only return attributes that are actually in the document header, while it previously didn't mind a blank line between title and document attributes.

I think this is related to https://github.com/asciidoctor/asciidoctor.js/issues/95#issuecomment-68576350

doc.attributes.smap works.

Yes but you should use Hash's public methods instead: https://github.com/opal/opal/blob/master/opal/corelib/hash.rb

smap is an internal property and Opal can decide to modify it or remove it in future version :disappointed:

ggrossetie avatar Nov 09 '15 20:11 ggrossetie

@Mogztter I'll fix that, thanks for the links. The more important point is that 1.5.3 seems to work fine with DocGist now. :+1:

nawroth avatar Nov 09 '15 20:11 nawroth

Yeah, thanks for your great work :smiley:

ggrossetie avatar Nov 09 '15 21:11 ggrossetie

Updated it to use $has_key? and $fetch.

Are there any unresolved issues with the previews or will 1.5.3 be out soon?

nawroth avatar Nov 10 '15 14:11 nawroth

We're still discussing an "issue" on attributes here and here but I think the behavior is the same in Asciidoctor core (Ruby) and Asciidoctor.js... Hopefully @mojavelinux will clear up our questions and give us the green light to proceed.

So 1.5.3 should be out pretty soon!

ggrossetie avatar Nov 10 '15 21:11 ggrossetie

I couldn't find any more problems, so I pushed my changes + a lot around syntax highlighting to http://gist.asciidoctor.org/

Will do another update if there are any changes in the final 1.5.3.

nawroth avatar Nov 14 '15 02:11 nawroth

it previously didn't mind a blank line between title and document attributes.

We should be strict about not permitting blank lines in the header, IMO.

mojavelinux avatar Nov 14 '15 12:11 mojavelinux

@mojavelinux Agreed.

nawroth avatar Nov 14 '15 12:11 nawroth

That's great news that you got it all working. Obviously, we still need to improve the usability of the APIs around document-level attributes and locking attributes, but that's for 1.6.0. What's important is that we have some really nice (and clear) use cases to study now. As far as 1.5.3 is concerned, if we understand how to work with what is there, then we are ready for release.

mojavelinux avatar Nov 14 '15 12:11 mojavelinux

Or better upgrade to https://github.com/asciidoctor/asciidoctor.js/releases/tag/v1.5.9

ggrossetie avatar Dec 09 '18 21:12 ggrossetie