emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Converting AsciiDoc to org-mode, preserving index entries
@ 2018-02-19 19:54 Diego Zamboni
  2018-02-20  0:25 ` John Kitchin
  0 siblings, 1 reply; 3+ messages in thread
From: Diego Zamboni @ 2018-02-19 19:54 UTC (permalink / raw)
  To: Org-mode; +Cc: Diego Zamboni

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

Hi,

I have a large document (a book) written in AsciiDoc, and I’ve been thinking of converting it to org-mode, which I find eminently more readable. The method I’ve come up with is:

1. AsciiDoc -> Docbook using asciidoc or asciidoctor
2. Docbook -> org using pandoc

The conversion seems to work well, except for one thing: I have index terms in my AsciiDoc files using the ‘((( … )))’ syntax (http://asciidoctor.org/docs/user-manual/#index-terms <http://asciidoctor.org/docs/user-manual/#index-terms>). Step 1 converts them correctly into <indexterm> tags, but pandoc inserts them as part of the main text instead of producing‘#+INDEX entries.

Before I go report the bug to Pandoc, I was wondering if anyone has tried this and maybe come up with some other way of doing the conversion.

Thanks!

—Diego


[-- Attachment #2: Type: text/html, Size: 1414 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Converting AsciiDoc to org-mode, preserving index entries
  2018-02-19 19:54 Converting AsciiDoc to org-mode, preserving index entries Diego Zamboni
@ 2018-02-20  0:25 ` John Kitchin
  2018-02-20 10:07   ` Diego Zamboni
  0 siblings, 1 reply; 3+ messages in thread
From: John Kitchin @ 2018-02-20  0:25 UTC (permalink / raw)
  To: Diego Zamboni; +Cc: Org-mode

[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]

If it is a one-time conversion, it might be worthwhile just replacing the
index terms with something temporary, getting to the org-file, and then
putting them back in the right way. For example, you could replace each
term with a uuid, and keep a list that maps the uuid to the term. Then the
uuid would pass through the pandoc untouched, and afterwards, go back
through and replace the uuid with the #+INDEX entries.

I don't know if that is worth the effort, but it might get you a faster
org-doc than bug reporting :)

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Mon, Feb 19, 2018 at 11:54 AM, Diego Zamboni <diego@zzamboni.org> wrote:

> Hi,
>
> I have a large document (a book) written in AsciiDoc, and I’ve been
> thinking of converting it to org-mode, which I find eminently more
> readable. The method I’ve come up with is:
>
> 1. AsciiDoc -> Docbook using asciidoc or asciidoctor
> 2. Docbook -> org using pandoc
>
> The conversion seems to work well, except for one thing: I have index
> terms in my AsciiDoc files using the ‘((( … )))’ syntax (
> http://asciidoctor.org/docs/user-manual/#index-terms). Step 1 converts
> them correctly into <indexterm> tags, but pandoc inserts them as part of
> the main text instead of producing‘#+INDEX entries.
>
> Before I go report the bug to Pandoc, I was wondering if anyone has tried
> this and maybe come up with some other way of doing the conversion.
>
> Thanks!
>
> —Diego
>
>

[-- Attachment #2: Type: text/html, Size: 2577 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Converting AsciiDoc to org-mode, preserving index entries
  2018-02-20  0:25 ` John Kitchin
@ 2018-02-20 10:07   ` Diego Zamboni
  0 siblings, 0 replies; 3+ messages in thread
From: Diego Zamboni @ 2018-02-20 10:07 UTC (permalink / raw)
  To: John Kitchin; +Cc: Org-mode

[-- Attachment #1: Type: text/plain, Size: 2032 bytes --]

Hi John,

Thanks - it would be indeed a one-time conversion. I may end up going this
route, but I thought there should be a proper way of doing it :)

Best,
--Diego

On Tue, Feb 20, 2018 at 1:25 AM, John Kitchin <jkitchin@andrew.cmu.edu>
wrote:

> If it is a one-time conversion, it might be worthwhile just replacing the
> index terms with something temporary, getting to the org-file, and then
> putting them back in the right way. For example, you could replace each
> term with a uuid, and keep a list that maps the uuid to the term. Then the
> uuid would pass through the pandoc untouched, and afterwards, go back
> through and replace the uuid with the #+INDEX entries.
>
> I don't know if that is worth the effort, but it might get you a faster
> org-doc than bug reporting :)
>
> John
>
> -----------------------------------
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803 <(412)%20268-7803>
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Mon, Feb 19, 2018 at 11:54 AM, Diego Zamboni <diego@zzamboni.org>
> wrote:
>
>> Hi,
>>
>> I have a large document (a book) written in AsciiDoc, and I’ve been
>> thinking of converting it to org-mode, which I find eminently more
>> readable. The method I’ve come up with is:
>>
>> 1. AsciiDoc -> Docbook using asciidoc or asciidoctor
>> 2. Docbook -> org using pandoc
>>
>> The conversion seems to work well, except for one thing: I have index
>> terms in my AsciiDoc files using the ‘((( … )))’ syntax (
>> http://asciidoctor.org/docs/user-manual/#index-terms). Step 1 converts
>> them correctly into <indexterm> tags, but pandoc inserts them as part of
>> the main text instead of producing‘#+INDEX entries.
>>
>> Before I go report the bug to Pandoc, I was wondering if anyone has tried
>> this and maybe come up with some other way of doing the conversion.
>>
>> Thanks!
>>
>> —Diego
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 3338 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-20 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 19:54 Converting AsciiDoc to org-mode, preserving index entries Diego Zamboni
2018-02-20  0:25 ` John Kitchin
2018-02-20 10:07   ` Diego Zamboni

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).