Bug 1091570 - RFE: Support import from Asciidoc
Summary: RFE: Support import from Asciidoc
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: ImportTool
Version: 1.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.7
Assignee: Matthew Casperson
QA Contact:
URL:
Whiteboard:
Depends On: 1095560 1095590 1097902 1098851 1098856 1100471
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-25 23:14 UTC by Matthew Casperson
Modified: 2014-08-04 22:28 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Matthew Casperson 2014-04-25 23:14:04 UTC
Projects like OpenShift have documentation in both Docbook and Asciidoc (https://github.com/openshift/origin-server/tree/master/documentation).

Asciidoctor has an experimental Javascript library (http://asciidoctor.org/docs/install-and-use-asciidoctorjs/) that we could use to import this content into PressGang .

The import tool should be extended to use Asciidoctor to convert Asciidoc to Docbook and then import it into PG.

Comment 1 Matthew Casperson 2014-04-25 23:25:39 UTC
Asciidoctor.js is still experimental, but I have a demo working at https://googledrive.com/host/0B6cpJDiEKC62cndwWkNmNmVqbE0/test.html

Comment 2 mmurray 2014-05-07 04:44:56 UTC
To add to the use cases, JBDS and Mobile Platform are both in asciidoc upstream. We would like to import this into PG and make enterprise books from it.

[We would also like an export tool at some point - but one thing at a time!]

Comment 3 Matthew Casperson 2014-05-18 20:32:34 UTC
1.5.0 preview 7 was just released: https://github.com/asciidoctor/asciidoctor.js/releases/tag/v1.5.0-preview.7

To enable conversion to DocBook the following lines need to be added to ~/.gem/ruby/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/asciidoctor.rb

require 'asciidoctor/converter/docbook5' if RUBY_ENGINE_OPAL
require 'asciidoctor/converter/docbook45' if RUBY_ENGINE_OPAL

Comment 7 Lee Newson 2014-06-16 03:38:54 UTC
The files that are shown when selecting the main file should be filtered, as showing all the images in the book makes it hard to find the main file.

Comment 8 Lee Newson 2014-06-16 03:39:48 UTC
Additionally directories are shown in the main file list (ie images/).

Comment 9 Lee Newson 2014-06-16 03:50:14 UTC
Default Preface = Off

Is being added to all imported books. Given that we've always wanted the Preface included, this should not be set. Ideally this should be an option either configurable by the user or per deployment (ie at Red Hat we would prefer it to be on, but others might not)

Comment 11 Lee Newson 2014-06-16 05:09:08 UTC
Some characters aren't being imported correctly. As an example trying to import https://github.com/asciidoctor/asciidoctor/blob/master/test/fixtures/asciidoc.txt which uses a double dash (--) in it's intro chapter/section, is imported as an mdash (—) (or some similar character).

Comment 12 Lee Newson 2014-06-16 05:23:05 UTC
Ignore the last comment, although it's not mentioned anywhere (as far as I can see) the double dash notation seems to get transformed for both asciidoc tools I know of.

Internal cross references (http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#links) are being escaped and aren't transformed to what I imagine should be Injections or xrefs. As an example try importing https://github.com/asciidoctor/asciidoctor/blob/master/test/fixtures/asciidoc.txt and notice that "<<X6,Getting Started>>" is escaped as "&lt;&lt;X6,Getting Started&gt;&gt;"

Comment 13 Matthew Casperson 2014-06-17 01:19:14 UTC
The internal reference "<<X6,Getting Started>>" is not being converted because it is split over a line break. This is an AsciiDoctor.js bug, which has been logged at https://github.com/asciidoctor/asciidoctor.js/issues/36

Comment 15 Matthew Casperson 2014-06-17 01:56:39 UTC
Putting this back ON_QA.

Asciidoc import will be a beta feature for as long as Asciidoctor.js is in testing, but everything else is in place to support it.

Comment 16 Lee Newson 2014-06-17 01:59:55 UTC
Moving this to VERIFIED since Matt has identified any bugs mentioned as being upstream bugs, so for a beta version that is fine.


Note You need to log in before you can comment on or make changes to this bug.