On 7/26/2012 5:57 PM, Dag Wieers wrote:
On Wed, 25 Jul 2012, dahinds wrote:
On Tuesday, July 24, 2012 4:43:05 PM UTC-7, Powerman wrote:
Is it possible to convert asciidoc article (one file) into Word document
format (.doc, .docx, .rtf, etc.)?
I have cobbled together a toolchain for converting asciidoc to Word docx
but it has a number of unresolved issues that limit its general
utility --
it gets the job done for me so I haven't put in the time to fix the
problems. I first generate docbook output from asciidoc, then translate
this to Word XML using xsltproc, then merge this with a docx template
using
the python docx library. The docbook-to-Word XML translation is based on
the docbook "roundtrip" XSLT stylesheets from the docbook-xsl package,
updated to handle Word 2007 XML.
Only a subset of asciidoc elements are handled correctly. It handles
images, tables, lists, headings using styles from the template document.
My main use case is actually using R for automated report generation with
both HTML and docx output, and this path was the best I could come up
with.
I could not find any other way to produce a docx file that used styles
properly -- and I tried a lot of things.
It would be great if someone with a bit of XSLT experience and some time
were interested in fooling around with what I've got. A couple of the
problems are irksome but I just have not had the time to learn enough
XSLT
to fix them -- I tried contacting the roundtrip stylesheet maintainer but
the package seems to be essentially abandoned. It is really only
developer-ready at this stage. If anyone wants to take a look, I can
forward a tarball with some basic instructions.
There's also docbook2odf, but this XSLT is also far from feature
complete. And the issues you will have mapping DocBook to Word XML are
rougly the same as the complexity of mapping asciidoc to ODF (minus the
complexity of XSLT itself). I gave up on docbook2odf after realizing
this ;-)
So that has driven me to create the asciidoc-odf extension. And while
there's still need for some more attention to the stylesheets, and to
some functionality asciidoc offers, it will be much easier without the
additional complexity of XSLT. (And additionally you can support some
specific ODF functionality directly from AsciiDoc which allows for some
very useful things (like columns or annotations)
I bet you'll end up in the same issues when mapping DocBook to Word XML.
PS The ODP backend is not ready and requires a lot of design/discussions
here if we want to make the implementation work with other slide
backends. Sincs ODP is very different from ODF wrt. text-flow,
positioning and functionality.
hi Dag:
to continue this topic, I find an issue when converting to ODT after
using following method to format some text in listing block:
http://www.methods.co.nz/asciidoc/faq.html#_how_can_i_format_text_inside_a_listing_block
it work fine with HTML, but all line breaks looks lost in the converted
odt. without [subs="quotes"] the odt looks great.
is this a known issue or am I missing some (workaround) ?
thanks!
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.