Hi Lex,

I would like to give a public answer but I'd like first to ask the 
contributor if he agrees. It was a task for his job and at first he was not 
sure he could share any code, but the company that employs him eventually 
agreed to release the code with a BSD license. That said, I am not 100% sure 
he wants it to be publicly available so I'm going to ask.

You can find below the corresponding discussion, that may be a starting 
point if anyone wants to dig into that subject.

Once I got his confirmation, I'll share the code with you.

BR
Lionel

------------------------------------------------

Hi Lionel,

I've done some testing with writing an XSL file for this, and it's
actually going
quite well. Some things in it are a bit adapted to what we need at our 
company,
but the base of it should work for most things, I think. It can handle 
headers,
itemized lists, literal layout, tables and to some extent image references.

This is a pretty rough conversion, and the produced asciidoc most likely 
need
some changes to look good, but I think it's a quick way to get started.

I've just recently asked my managers if we can release it to the public, but 
I
haven't received an answer yet. We won't be able to manage this as a public
project, we don't really have the resources for that, but I hope that they 
will
agree to release it as public domain or AGPL or something similar.

I'll let you know when I hear from them.


Regards,
Tomas
 
On Sun, Apr 3, 2011 at 18:20, Lionel wrote:
> Hi Tomas,
>
> not wanting to disturb you but I was curious if you eventually found a
> solution to your problem, and what that solution is... Are you still
> searching for a way to convert docbook to asciidoc?
>
> Thanks for sharing what could be interesting from your trial...
>
> Best,
> Lionel
>
> On Wed, Feb 23, 2011 at 4:52 PM, Tomas wrote:
>> Hi,
>>
>> Thanks for your reply, with lots of ideas. :)
>>
>> I'm at a very early stage with this, so I haven't done any testing at
>> all. I'm also not very good at XSLT, only tested some very simple
>> things with it years ago.
>>
>> Unfortunately, this is for my work, which by default means that if
>> I make a tool for this myself, it will be a property of my employer.
>> But, I'll try to convince them to be able to share it to the public,
>> I really don't think that will be a problem, because this is not at
>> all our core business.
>>
>> But, I will probably not have time (or much interest, I'm afraid)
>> to maintain a project like that. This is mostly a one-time thing
>> for me.
>>
>> I will try some when I have time, and see if I can get something
>> working. Then I'm pretty sure that I will be able to give it to you,
>> if you are interested in continuing the work from there. From the
>> little I've looked at asciidoc so far, I like it a lot, so I'll be happy
>> to try to support it.
>>
>> I'll be sure to get back to you when I've done some testing.
>>
>>
>> Regards,
>>
>> Tomas
>>
>>
>>
>> On Wed, Feb 23, 2011 at 15:12, Lionel wrote:
>>> Hi Tomas,
>>>
>>> That's an interesting question that I often ask to myself. I even
>>> wonder if I did not already ask this question to the asciidoc google
>>> group, but if I did, the answer was: this tool does not exist yet.
>>>
>>> I actually did this conversion a few times, but for relatively small
>>> documentation base, and I did it manually.
>>>
>>> By manually, I mean I've been using a few sed lines to do the big
>>> work, then went over the document with vim to correct the details.
>>>
>>> So my method was rather regexp-based than XSLT-based.
>>>
>>> I said it's interesting because in fact since we have an xml source,
>>> the xsl transformation would be really the way to go. I am
>>> unfortunately bad at XSLT (already wrote a few xsl files but that's
>>> all and that was xml->xml most of the time) but maybe we could have a
>>> common effort into bringing this XSL file to life?
>>>
>>> Important to note is that since asciidoc and docbook are both very
>>> generic and as such, there are 3 contexts to take into account:
>>>
>>> 1. The intersection, i.e. the part they have in common and where
>>> docbook<->asciidoc conversion is possible (in both ways)
>>>
>>> 2. The asciidoc-specific, i.e. the part of asciidoc grammar that can't
>>> be translated into docbook. It's a relatively small part since Stuart
>>> does a good job wrapping all the properties he can into docbook when
>>> possible, but this part is of no interest for dbk->asciidoc
>>> transformation, so we can ignore it
>>>
>>> 3. The evil part: the dbk-specific. This is the real problem, since
>>> some docbook tags or subtrees will have no equivalent in asciidoc.
>>> This means that we should build a strategy for these ones. I see an
>>> easy one:
>>> - issue a warning (is this possible with xsl?) whenever we encounter
>>> an untranslatable dbk tag (or subtree...)
>>> - write down the source dbk that could not be translated into an
>>> asciidoc comment block at the place where it should be, so that review
>>> is made easier (replace the comment block containing dbk code by your
>>> own asciidoc interpretation)
>>>
>>> We should maybe also introduce the concept of 'uncertain' translation,
>>> when the dbk->asciidoc translation may be ambiguous, and in that case,
>>> also include the dbk source as an asciidoc comment and a message
>>> asking for a review of the generated asciidoc text.
>>>
>>> I'm gonna stop here since I don't have much time right now, but your
>>> email gave me a few ideas as you can see. I let you both react about
>>> that and maybe shape a basis to a dbk2adoc tools that would be very,
>>> very, very welcome. Would you be ready to make that project alive?
>>>
>>> Regards,
>>> Lionel
>>>
>>> On Wed, Feb 23, 2011 at 2:44 PM, Tomas wrote:
>>>> Hi,
>>>>
>>>> I found your names on the internet searching for some tool to convert 
docbook
>>>> documentation into asciidoc. I couldn't find any tools, only some mail 
archive
>>>> where your names came up, where you seems to have done that before.
>>>>
>>>> I'm investigating asciidoc for a project that has a lot of 
documentation in
>>>> docbook format already (actually Framemaker, but it can export to 
docbook),
>>>> and was wondering if you had any tools for this, or if you did the
>>>> work manually?
>>>> It should be possible to write an XSLT for doing the conversion, I 
suppose.
>>>>
>>>> Any help is appreciated.
>>>>
>>>>
>>>> Best regards,
>>>>
>>>> Tomas
>>>>
>>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/asciidoc/-/zoQWDIRVH9gJ.
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.

Reply via email to