Hi Adam

On 25/02/12 07:49, Adam Witwer wrote:
Hi all,

We use (and love) AsciiDoc at O'Reilly Media. Authors sometimes want
to use it for the new edition of a book, but providing them with an
AsciiDoc version of the previous edition has been a challenge because
we have generally use DocBook as the book source. So a colleague of
mine (Brian Jepson) wrote some XSL to convert from DocBook to
AsciiDoc. It's here in case anyone finds it useful:

https://github.com/oreillymedia/docbook2asciidoc

We've tested it on only a couple of books so far, but it seems to be
working pretty well. As new editions of books come up, we're adding
handling for more elements as needed.

I tried it on the DocBook generated by asciidoc from book.txt in the asciidoc distribution (http://code.google.com/p/asciidoc/source/browse/doc/book.txt) then round-tripped it to HTML with asciidoc and PDF with a2x -- both compiled without errors!

I've attached the input book.xml and output book.txt. As you've pointed out some elements are yet to be translated, but it's great leg-up when you're faced with a translation like this (we've had questions in the past asking for exactly this functionality).

I've added a link to your project to the list of 'External Resources and Applications' in the AsciiDoc homepage (http://www.methods.co.nz/asciidoc/#X2).


Cheers, Stuart

PS: I've got more ebooks from O'Reilly than from any other publisher, it's gratifying to think that some may have been processed by AsciiDoc.


Adam


--
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.

Book Title Goes Here2003-12Author'sNameAN1.02003-12ANExample DedicationOptional 
dedication.This document is an AsciiDoc book skeleton containing briefly
annotated example elements plus a couple of example index entries and
footnotes.Books are normally used to generate DocBook markup and the titles of
the preface, appendix, bibliography, glossary and index sections are
significant (_specialsections_).
[[_example_preface]]
== Example Preface

Optional preface.Preface Sub-sectionPreface sub-section body.
[[_the_first_chapter]]
== The First Chapter

Chapters can contain sub-sections nested up to three deep.
An example footnote.
Chapters can have their own bibliography, glossary and index.And now for 
something completely different: monkeys, lions and
tigers (Bengal and Siberian) using the alternative syntax index
entries.








Note that multi-entry terms generate separate index entries.Here are a couple 
of image examples: an image:[]
example inline image followed by an example block image:
.Tiger block image
image::[]

Followed by an example table:
.An example table
|===============
| Option          | Description
||
||

|===============

.An example example Sub-section with AnchorSub-section at level 2.Chapter 
Sub-sectionSub-section at level 3.Chapter Sub-sectionSub-section at level 
4.This is the maximum sub-section depth supported by the distributed
AsciiDoc configuration.
A second example footnote.
[[_the_second_chapter]]
== The Second Chapter

An example link to anchor at start of the first sub-section.
An example link to a bibliography entry <<taoup>>.
[[_the_third_chapter]]
== The Third Chapter

Book chapters are at level 1 and can contain sub-sections.Example AppendixOne 
or more optional appendixes go here at section level 1.Appendix 
Sub-sectionSub-section body.Example BibliographyThe bibliography list is a 
style of AsciiDoc bulleted list.Books

[taoup] Eric Steven Raymond. _The Art of Unix Programming_. Addison-Wesley. 
ISBN 0-13-142901-9.



[walsh-muellner] Norman Walsh & Leonard Muellner.
  _DocBook - The Definitive Guide_. O’Reilly & Associates. 1999.
  ISBN 1-56592-580-7.

Articles

[abc2003] Gall Anonim. _An article_, Whatever. 2003.

Example GlossaryGlossaries are optional. Glossaries entries are an example of a 
style
of AsciiDoc labeled lists.
A glossary term

  The corresponding (indented) definition.

A second glossary term

  The corresponding (indented) definition.
Example ColophonText at the end of a book describing facts about its 
production.Example Index
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd";>
<?asciidoc-toc?>
<?asciidoc-numbered?>

<book lang="en">
<bookinfo>
    <date>2012-02-26</date>
</bookinfo>
<simpara>Book Title Goes Here2003-12Author&#8217;sNameAN1.02003-12ANExample DedicationOptional dedication.This document is an AsciiDoc book skeleton containing briefly
annotated example elements plus a couple of example index entries and
footnotes.Books are normally used to generate DocBook markup and the titles of
the preface, appendix, bibliography, glossary and index sections are
significant (<emphasis>specialsections</emphasis>).</simpara>
<chapter id="_example_preface">
<title>Example Preface</title>
<simpara>Optional preface.Preface Sub-sectionPreface sub-section body.</simpara>
</chapter>
<chapter id="_the_first_chapter">
<title>The First Chapter</title>
<simpara>Chapters can contain sub-sections nested up to three deep.
An example footnote.
Chapters can have their own bibliography, glossary and index.And now for something completely different: monkeys, lions and
tigers (Bengal and Siberian) using the alternative syntax index
entries.</simpara>
<simpara>Note that multi-entry terms generate separate index entries.Here are a couple of image examples: an <inlinemediaobject>
  <imageobject>
  <imagedata fileref=""/>
  </imageobject>
  <textobject><phrase></phrase></textobject>
</inlinemediaobject>
example inline image followed by an example block image:
.Tiger block image
<inlinemediaobject>
  <imageobject>
  <imagedata fileref=":"/>
  </imageobject>
  <textobject><phrase>:</phrase></textobject>
</inlinemediaobject></simpara>
<simpara>Followed by an example table:
.An example table</simpara>
<informaltable
frame="all"
rowsep="1" colsep="1"
>
<tgroup cols="2">
<colspec colname="col_1" colwidth="50*"/>
<colspec colname="col_2" colwidth="50*"/>
<tbody>
<row>
<entry align="left" valign="top"><simpara>Option</simpara></entry>
<entry align="left" valign="top"><simpara>Description</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara></simpara></entry>
<entry align="left" valign="top"><simpara></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara></simpara></entry>
<entry align="left" valign="top"><simpara></simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<formalpara><title>An example example Sub-section with AnchorSub-section at level 2.Chapter Sub-sectionSub-section at level 3.Chapter Sub-sectionSub-section at level 4.This is the maximum sub-section depth supported by the distributed</title><para>AsciiDoc configuration.
A second example footnote.</para></formalpara>
</chapter>
<chapter id="_the_second_chapter">
<title>The Second Chapter</title>
<simpara>An example link to anchor at start of the first sub-section.
An example link to a bibliography entry <xref linkend="taoup"/>.</simpara>
</chapter>
<chapter id="_the_third_chapter">
<title>The Third Chapter</title>
<simpara>Book chapters are at level 1 and can contain sub-sections.Example AppendixOne or more optional appendixes go here at section level 1.Appendix Sub-sectionSub-section body.Example BibliographyThe bibliography list is a style of AsciiDoc bulleted list.Books</simpara>
<simpara>[taoup] Eric Steven Raymond. <emphasis>The Art of Unix Programming</emphasis>. Addison-Wesley. ISBN 0-13-142901-9.</simpara>
<simpara>[walsh-muellner] Norman Walsh &amp; Leonard Muellner.
  <emphasis>DocBook - The Definitive Guide</emphasis>. O’Reilly &amp; Associates. 1999.
  ISBN 1-56592-580-7.</simpara>
<simpara>Articles</simpara>
<simpara>[abc2003] Gall Anonim. <emphasis>An article</emphasis>, Whatever. 2003.</simpara>
<simpara>Example GlossaryGlossaries are optional. Glossaries entries are an example of a style
of AsciiDoc labeled lists.
A glossary term</simpara>
<literallayout class="monospaced">The corresponding (indented) definition.</literallayout>
<simpara>A second glossary term</simpara>
<literallayout class="monospaced">  The corresponding (indented) definition.
Example ColophonText at the end of a book describing facts about its production.Example Index</literallayout>
</chapter>
</book>

Reply via email to