Bug 1120455

Summary: RFE: Add markdown as an output format
Product: [Community] Publican Reporter: Ruediger Landmann <rlandman>
Component: publicanAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: Don Domingo <ddomingo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: futureCC: aigao, ddomingo, mmurray, rlandman, slong, zdover
Target Milestone: 4.2   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.2.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-01 03:40:32 UTC 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:

Description Ruediger Landmann 2014-07-17 01:55:41 UTC
Description of problem:

Could we please have Markdown added as an output format for Publican? A module for HTML->Markdown already exists:

http://search.cpan.org/dist/HTML-WikiConverter-Markdown/

Comment 1 Jeff Fearn 🐞 2014-07-17 04:20:02 UTC
Added support for HTML::WikiConverter, any sub modules installed should just work.

Tested with HTML::WikiConverter::Markdown, added this as a Requires to the speck file.

This needs to be added to the PUG.

The format is case sensitive so:

$ publican build --formats Markdown

will work but:

$ publican build --formats markdown

will not.

Note the file names end .txt as the modules do not specify a file extension.

You can see a full list of extension at:

http://search.cpan.org/search?m=module&q=WikiConverter&s=1&n=50

Should be easy to get RPMs using cpanspec.

e.g.

$ cpanspec --build HTML::WikiConverter::Confluence
$ sudo yum install ./noarch/perl-HTML-WikiConverter-Confluence-0.01-1.fc20.noarch.rpm
$ cd $path_to_book
$ publican build --formats Confluence
$ gvim tmp/en-US/Confluence/*.txt
$ ???
$ profit

To ssh://git.fedorahosted.org/git/publican.git
   bfe4429..23f73b6  devel -> devel

Comment 2 Don Domingo 2014-08-25 03:35:02 UTC
Verified that Publican is able to output Markdown. Tried this with three different content specs:

http://docbuilder.usersys.redhat.com/22898/
http://docbuilder.usersys.redhat.com/22894
http://docbuilder.usersys.redhat.com/22897/


There were several issues with the Markdown output, though:

* <itemizedlist>s and <orderedlist>s nested inside of <step>s and <orderedlist>s can reset list numbering. 

* When <replaceable>bleh</replaceable> is nested inside <command> or <screen>, the Markdown output doesn't correctly mark bleh differently. However, I suspect that this is also greatly due to the limitation of Markdown support on our Drupal instance (I have yet to actually determine how we should render italics inside of block text, for instance).

These issues can be covered in a different BZ, though. For now, consider the ability to render Markdown as VERIFIED.

Comment 3 Jeff Fearn 🐞 2014-09-01 03:40:32 UTC
A fix for this shipped in Publican 4.2.0.