From: Keith Packard <keithp@keithp.com>
To: Jonathan Corbet <corbet@lwn.net>, Jani Nikula <jani.nikula@intel.com>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [RFC] A first shot at asciidoc-based formatted docs
Date: Wed, 10 Feb 2016 15:01:15 -0800 [thread overview]
Message-ID: <861t8k2mro.fsf@hiro.keithp.com> (raw)
In-Reply-To: <20160209170938.3a4b9fb1@lwn.net>
[-- Attachment #1: Type: text/plain, Size: 2589 bytes --]
Jonathan Corbet <corbet@lwn.net> writes:
> [Adding Keith since you said you wanted to be a part of this - let us know
> when you've had enough!]
Thanks.
> - I would like to format directly to HTML if at all possible.
Agreed. asciidoc's docbook path seems to only increase the amount of
software involved.
> It seems it should be possible to get a table of contents into the
> files, and the feedback I got was that a TOC would be enough for
> navigation
I spent a few hours on the flight home reading asciidoc source code, and
it is a stream processor with a stack. The output is generated with some
simple templates, one for each backend. Here's the xhtml1.1 template for
section level sections: (sect1 in the .conf file):
[sect1]
<div class="sect1{style? {style}}{role? {role}}">
<h2{id? id="{id}"}>{numbered?{sectnum} }{title}</h2>
<div class="sectionbody">
|
</div>
</div>
The contents of the section get inserted at the |; it's nesting, so
[sect2] bits would get expanded while being processed.
Each asciidoc backend has dramatically different functionality. It's
pretty clear to me that the 'docbook' backend has the best support for
larger documents as that provides 'book-scale' processing bits. I've
recently written a book in asciidoc using the docbook backend, and the
html and pdf results are quite comparable. Using the html backend from
asciidoc yields a significantly different result.
I think it should be pretty easy to hack asciidoc to add diversions to
hold TOC contents while generating the rest of the doc and then replay
the diversion into the final document. Something like:
[sect1]
<div class="sect1{style? {style}}{role? {role}}">
<h2{id? id="{id}"}>{numbered?{sectnum} }{title}</h2>
|>"table-of-contents"<dl class="toc">
<dt>
<span class="section">
<a href="{id}">{numbered?{sectnum} {title}</a>
</span>
</dt>
</dl>
<div class="sectionbody">
|
</div>
</div>
At the end of the document, we'd have some way of wrapping the diversion
in suitable additional bits to complete the TOC, which would then be
formatted by CSS.
This same technique could be used to create lists of figures and tables.
The goal would be to create an html document which could be used without
javascript, and that would work without css as well.
--
-keith
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 810 bytes --]
next prev parent reply other threads:[~2016-02-10 23:06 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 23:28 [RFC] A first shot at asciidoc-based formatted docs Jonathan Corbet
2016-01-25 23:28 ` [PATCH 1/4] kernel-doc: add support for asciidoc output Jonathan Corbet
2016-01-25 23:28 ` [PATCH 2/4] docproc: handle asciidoc templates Jonathan Corbet
2016-01-25 23:28 ` [PATCH 3/4] Docs: Makefile tweaks for " Jonathan Corbet
2016-01-25 23:28 ` [PATCH 4/4] Docs: add a sample asciidoc template Jonathan Corbet
2016-01-26 12:08 ` [RFC] A first shot at asciidoc-based formatted docs Jani Nikula
2016-01-26 12:08 ` [RFC 01/10] kernel-doc: rewrite usage description, remove duplicated comments Jani Nikula
2016-01-26 12:08 ` [RFC 02/10] kernel-doc: add support for asciidoc output Jani Nikula
2016-01-26 12:08 ` [RFC 03/10] kernel-doc: support printing exported and non-exported symbols Jani Nikula
2016-01-26 12:08 ` [RFC 04/10] kernel-doc: add support for printing DOC: comments with escaped names Jani Nikula
2016-01-26 12:08 ` [RFC 05/10] scripts: add asciidoc-includes to extract includes from asciidoc Jani Nikula
2016-01-26 12:08 ` [RFC 06/10] scripts: add a kernel-doc helper for special invocation Jani Nikula
2016-01-26 12:08 ` [RFC 07/10] scripts: add tool for generating asciidoc dependencies and rules Jani Nikula
2016-01-26 12:08 ` [RFC 08/10] scripts: add a crude converter from DocBook tmpl to asciidoc Jani Nikula
2016-01-26 12:08 ` [RFC 09/10] Documentation: convert gpu.tmpl to gpu.txt Jani Nikula
2016-01-26 12:08 ` [RFC 10/10] Documentation: build asciidoc documentation Jani Nikula
2016-01-26 12:17 ` [RFC] A first shot at asciidoc-based formatted docs Daniel Vetter
2016-01-26 12:38 ` Jani Nikula
2016-01-26 14:48 ` Jonathan Corbet
2016-01-26 14:52 ` Jonathan Corbet
2016-02-10 0:09 ` Jonathan Corbet
2016-02-10 8:07 ` Daniel Vetter
2016-02-10 14:03 ` Jani Nikula
2016-02-10 16:12 ` Jani Nikula
2016-02-10 20:56 ` Jonathan Corbet
2016-02-11 15:18 ` Keith Packard
2016-02-10 20:45 ` Jonathan Corbet
2016-02-10 23:01 ` Keith Packard [this message]
2016-02-11 13:44 ` Jani Nikula
2016-02-11 15:21 ` Keith Packard
2016-02-13 3:20 ` Keith Packard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=861t8k2mro.fsf@hiro.keithp.com \
--to=keithp@keithp.com \
--cc=corbet@lwn.net \
--cc=daniel.vetter@ffwll.ch \
--cc=jani.nikula@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.