bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple documents and DocBook output


From: Noah Slater
Subject: Simple documents and DocBook output
Date: Mon, 22 Dec 2008 00:30:29 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

Hello,

I am developing an application that will use Texinfo and one of the common use
cases is that people will want to produce very simple documents and transform
this to DocBook XML. Lets take the following document as an example:

  \input texinfo
  @settitle Title

  This is a simple document.

  @bye

Now we have the following:

  address@hidden: ~/eph/texinfo $ ls -l
  total 4.0K
  -rw-r--r-- 1 nslater nslater 65 2008-12-22 00:16 doc.texi

My next step is to run this command:

  makeinfo --docbook doc.texi

And now we have:

  address@hidden: ~/eph/texinfo $ ls -l
  total 8.0K
  -rw-r--r-- 1 nslater nslater 477 2008-12-22 00:18 doc.info
  -rw-r--r-- 1 nslater nslater  65 2008-12-22 00:16 doc.texi

For some reason, the `makeinfo` command has called used the `info` file
extension. The contents of this file are DocBook XML, I think is might be a bug.

The contents look like:

  <?xml version="1.0"?>
  <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"; [
    <!ENTITY tex "TeX">
    <!ENTITY latex "LaTeX">
  ]>
  <book id="book-root" lang="en">
    <title>Title</title>
    <bookinfo>
      <abstract>
        <para>This is a simple document.</para>
      </abstract>
  </bookinfo></book><!-- Keep this comment at the end of the file
  Local variables:
  mode: sgml
  sgml-indent-step:1
  sgml-indent-data:nil
  End:
  -->

I have some questions about this output, divided into trivial and important.

Trivial questions:

  * Why are these XML entities defined, can I turn this off?

  * Why is the GNU Emacs comment included at the bottom, can I turn this off?

  * Why does the top-level element have an @id of 'book-root'?

I say these are trivial because I can process them out with `xmllint` in a way
that would not damage larger, unknown, documents.

Some more important questions:

  * For such a small document, I don't want to use a <book> element, could there
    be a way for me to ask `makeinfo` to produce an <article> element instead?

  * For such a small document, I do not want to use any sections, and so the
    content (in this case, the <para> elements) should be top level <article>
    elements, and not part of the <abstract>

I am VERY new to Texinfo, so I'm probably making some huge mistakes.

Karl, as I work my way through learning Texinfo for the application I'm working
on I'm probably going to come up with a bunch more questions about the DocBook
output from `makeinfo` and would like to help out where I can.

I found the following file:

  http://cvs.savannah.gnu.org/viewvc/texinfo/texinfo/makeinfo/xml.c

I'm not a C developer though, so I don't know how much use I could provide.

Let me know!

-- 
Noah Slater, http://tumbolia.org/nslater




reply via email to

[Prev in Thread] Current Thread [Next in Thread]