Bug 1091570

Summary: RFE: Support import from Asciidoc
Product: [Community] PressGang CCMS Reporter: Matthew Casperson <mcaspers>
Component: ImportToolAssignee: Matthew Casperson <mcaspers>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.4CC: cbredesen, lnewson, mmurray
Target Milestone: ---   
Target Release: 1.7   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1095560, 1095590, 1097902, 1098851, 1098856, 1100471    
Bug Blocks:    

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.