Update TODO list.
[docutils.git] / docs / dev / todo.txt
blobd2e2f2341a4bcecfd1b01fdcce087f105f58407c
1 ======================
2  Docutils_ To Do List
3 ======================
5 :Author: David Goodger (with input from many); open to all Docutils
6          developers
7 :Contact: docutils-develop@lists.sourceforge.net
8 :Date: $Date$
9 :Revision: $Revision$
10 :Copyright: This document has been placed in the public domain.
12 .. _Docutils: http://docutils.sourceforge.net/
14 .. contents::
17 Priority items are marked with "@" symbols.  The more @s, the higher
18 the priority.  Items in question form (containing "?") are ideas which
19 require more thought and debate; they are potential to-do's.
21 Many of these items are awaiting champions.  If you see something
22 you'd like to tackle, please do!  If there's something you'd like to
23 see done but are unable to implement it yourself, please consider
24 donating to Docutils: |donate|
26 .. |donate| image:: http://images.sourceforge.net/images/project-support.jpg
27    :target: http://sourceforge.net/donate/index.php?group_id=38414
28    :align: middle
29    :width: 88
30    :height: 32
31    :alt: Support the Docutils project!
33 Please see also the Bugs_ document for a list of bugs in Docutils.
35 .. _bugs: ../../BUGS.html
38 Minimum Requirements for Python Standard Library Candidacy
39 ==========================================================
41 Below are action items that must be added and issues that must be
42 addressed before Docutils can be considered suitable to be proposed
43 for inclusion in the Python standard library.
45 Many of these are now handled by Sphinx_
47 * Support for `document splitting`_.  May require some major code
48   rework.
50 * Support for subdocuments (see `large documents`_).
52 * `Object numbering and object references`_.
54 * `Nested inline markup`_.
56 * `Python Source Reader`_.
58 * The HTML writer needs to be rewritten (or a second HTML writer
59   added) to allow for custom classes, and for arbitrary splitting
60   (stack-based?).
62 * Documentation_ of the architecture.  Other docs too.
64 * Plugin support.
66 * Suitability for `Python module documentation
67   <http://docutils.sf.net/sandbox/README.html#documenting-python>`_.
69 .. _Sphinx: http://sphinx.pocoo.org/
71 General
72 =======
74 * Encoding of command line arguments can only be guessed:
76   * try UTF-8/strict first, then try the locale's encoding with
77     strict error handling, then ASCII/replace?
79     UTF-8 is almost 100% safe to try first; false positives are rare,
80     The locale's encoding with strict error handling may be a
81     reasonable compromise, but any error would indicate that the
82     locale's encoding is inappropriate.  The only safe fallback is
83     ASCII/replace.
85   * Do not decode argv before option parsing but individual string
86     values?
88     +1  Allows for separate command-line vs. filesystem encodings,
89         respectively to keep file names encoded.
90     +1  Allows to configure command-line encoding in a config file,
91     -1  More complicated.
93   Cf. <http://thread.gmane.org/gmane.text.docutils.user/2890/focus=2957>.
95 * Improve handling on Windows:
97   - Get graphical installer.
98   - Make rst2html.py an .exe file using py2exe.
100 * .. _GUI:
102   The user interface is very difficult to use for most Windows users;
103   you can't really expect them to use the command line.  We need some
104   kind of GUI that can launch rst2html.py, and save the HTML output to
105   a file, and launch a browser.  What's important is that we get
106   settings to work with the GUI.  So we need some way to dynamically
107   generate a list of settings for the GUI.  The current settings_spec
108   for OptionParser doesn't seem to be usable for this for the
109   following reasons:
111   - It's biased toward the command line -- there are *two* options for
112     one boolean setting.
114   - You cannot have both a one-line description and a longer
115     description for tooltips/help-texts.
117   - It doesn't provide hints for the input type.  You cannot easily
118     infer the type of a setting from its validator, because any
119     component can add new validators.  In fact, it may be necessary to
120     have both a hint about the input type (e.g. string) and a
121     validator (valid ID), or it may be necessary to have a different
122     set of choices for the CLI (1, INFO, 2, ...) and for the GUI
123     (INFO, WARNING, ...).
125   - It's coupled to the OptionParser.  We want to be able to change
126     the underlying system without breaking everything.
128   - It's a bunch of primitive structures.  We want an extensible (thus
129     object-oriented) interface.
131   So we probably need to create a class for storing all the settings,
132   and auto-generate the OptionParser data from that.
134   I talked to Stephan Deibel about getting Docutils integrated into
135   Wing IDE.  He said it's possible, and he'd be willing to help.
136   There's a scripting interface to Wing, which we'd use.  We can
137   dynamically generate a list of preferences and not worry too much
138   about the rendering (from what I understood); Wing's whole GUI is
139   dynamic anyway.  The interface could be made usable for other GUIs.
140   For example, we could try to get option support for DocFactory.  //
141   FW
143 * Allow different report levels for STDERR and system_messages inside
144   the document?
146 * Change the docutils-update script (in sandbox/infrastructure), to
147   support arbitrary branch snapshots.
149 * Move some general-interest sandboxes out of individuals'
150   directories, into subprojects?
152 * Add option for file (and URL) access restriction to make Docutils
153   usable in Wikis and similar applications.
155   2005-03-21: added ``file_insertion_enabled`` & ``raw_enabled``
156   settings.  These partially solve the problem, allowing or disabling
157   **all** file accesses, but not limited access.
159 * Configuration file handling needs discussion:
161   - There should be some error checking on the contents of config
162     files.  How much checking should be done?  How loudly should
163     Docutils complain if it encounters an error/problem?
165   - Docutils doesn't complain when it doesn't find a configuration
166     file supplied with the ``--config`` option.  Should it?  (If yes,
167     error or warning?)
169 * Internationalization:
171   - I18n needs refactoring, the language dictionaries are difficult to
172     maintain.  Maybe have a look at gettext or similar tools.
174     (This would make a nice Google Summer of Code project)
176   - Language modules: in accented languages it may be useful to have
177     both accented and unaccented entries in the
178     ``bibliographic_fields`` mapping for versatility.
180   - Add a "--strict-language" option & setting: no English fallback
181     for language-dependent features.
183     Make this the default for output (as opposed to input)?
184     Throw an error with a helpfull message, e.g.
186       Default "contents" title for language %s missing, please specify
187       an explicit title.
189     or
191      "attention" title for language %s missing, please use a generic
192      admonition with explicit title.
194   - Add internationalization to _`footer boilerplate text` (resulting
195     from "--generator", "--source-link", and "--date" etc.), allowing
196     translations.
199 * Add validation?  See http://pytrex.sourceforge.net, RELAX NG, pyRXP.
201 * In ``docutils.readers.get_reader_class`` (& ``parsers`` &
202   ``writers`` too), should we be importing "standalone" or
203   "docutils.readers.standalone"?  (This would avoid importing
204   top-level modules if the module name is not in docutils/readers.
205   Potential nastiness.)
207 * Perhaps store a _`name-to-id mapping file`?  This could be stored
208   permanently, read by subsequent processing runs, and updated with
209   new entries.  ("Persistent ID mapping"?)
211 * Perhaps the ``Component.supports`` method should deal with
212   individual features ("meta" etc.) instead of formats ("html" etc.)?
214 * Think about _`large documents` made up of multiple subdocument
215   files.  Issues: continuity (`persistent sequences`_ above),
216   cross-references (`name-to-id mapping file`_ above and `targets in
217   other documents`_ below), splitting (`document splitting`_ below).
219   When writing a book, the author probably wants to split it up into
220   files, perhaps one per chapter (but perhaps even more detailed).
221   However, we'd like to be able to have references from one chapter to
222   another, and have continuous numbering (pages and chapters, as
223   applicable).  Of course, none of this is implemented yet.  There has
224   been some thought put into some aspects; see `the "include"
225   directive`__ and the `Reference Merging`_ transform below.
227   When I was working with SGML in Japan, we had a system where there
228   was a top-level coordinating file, book.sgml, which contained the
229   top-level structure of a book: the <book> element, containing the
230   book <title> and empty component elements (<preface>, <chapter>,
231   <appendix>, etc.), each with filename attributes pointing to the
232   actual source for the component.  Something like this::
234       <book id="bk01">
235       <title>Title of the Book</title>
236       <preface inrefid="pr01"></preface>
237       <chapter inrefid="ch01"></chapter>
238       <chapter inrefid="ch02"></chapter>
239       <chapter inrefid="ch03"></chapter>
240       <appendix inrefid="ap01"></appendix>
241       </book>
243   (The "inrefid" attribute stood for "insertion reference ID".)
245   The processing system would process each component separately, but
246   it would recognize and use the book file to coordinate chapter and
247   page numbering, and keep a persistent ID to (title, page number)
248   mapping database for cross-references.  Docutils could use a similar
249   system for large-scale, multipart documents.
251   __ ../ref/rst/directives.html#including-an-external-document-fragment
253   Aahz's idea:
255       First the ToC::
257           .. ToC-list::
258               Introduction.txt
259               Objects.txt
260               Data.txt
261               Control.txt
263       Then a sample use::
265           .. include:: ToC.txt
267           As I said earlier in chapter :chapter:`Objects.txt`, the
268           reference count gets increased every time a binding is made.
270       Which produces::
272           As I said earlier in chapter 2, the
273           reference count gets increased every time a binding is made.
275       The ToC in this form doesn't even need to be references to actual
276       reST documents; I'm simply doing it that way for a minimum of
277       future-proofing, in case I do want to add the ability to pick up
278       references within external chapters.
280   Perhaps, instead of ToC (which would overload the "contents"
281   directive concept already in use), we could use "manifest".  A
282   "manifest" directive might associate local reference names with
283   files::
285       .. manifest::
286          intro: Introduction.txt
287          objects: Objects.txt
288          data: Data.txt
289          control: Control.txt
291   Then the sample becomes::
293       .. include:: manifest.txt
295       As I said earlier in chapter :chapter:`objects`, the
296       reference count gets increased every time a binding is made.
298 * Add support for _`multiple output files` and _`generic data
299   handling`:
301   It should be possible for a component to **emit or reference** data
302   to be either **included or referenced** in the output document.
303   Examples of such data are stylesheets or images.
305   For this, we need a "data" object which stores the data either
306   inline or by referring to a file.  The Docutils framework is
307   responsible for either:
309   * storing the data in the appropriate location (e.g. in the
310     directory of the output file, or in a user-specified directory)
311     and providing the paths of the stored files to the writer, *or*
313   * providing the data itself to the writer so that it can be embedded
314     in the output document.
316   This approach decouples data handling from the data source (which
317   can either be embedded or referenced) and the destination (which can
318   either be embedded or referenced as well).
320   See <http://article.gmane.org/gmane.text.docutils.devel/3631>.
322 * Add testing for Docutils' front end tools?
324 * Publisher: "Ordinary setup" shouldn't requre specific ordering; at
325   the very least, there ought to be error checking higher up in the
326   call chain.  [Aahz]
328   ``Publisher.get_settings`` requires that all components be set up
329   before it's called.  Perhaps the I/O *objects* shouldn't be set, but
330   I/O *classes*.  Then options are set up (``.set_options``), and
331   ``Publisher.set_io`` (or equivalent code) is called with source &
332   destination paths, creating the I/O objects.
334   Perhaps I/O objects shouldn't be instantiated until required.  For
335   split output, the Writer may be called multiple times, once for each
336   doctree, and each doctree should have a separate Output object (with
337   a different path).  Is the "Builder" pattern applicable here?
339 * Perhaps I/O objects should become full-fledged components (i.e.
340   subclasses of ``docutils.Component``, as are Readers, Parsers, and
341   Writers now), and thus have associated option/setting specs and
342   transforms.
344 * Multiple file I/O suggestion from Michael Hudson: use a file-like
345   object or something you can iterate over to get file-like objects.
347 * Add an "--input-language" option & setting?  Specify a different
348   language module for input (bibliographic fields, directives) than
349   for output.  The "--language" option would set both input & output
350   languages.
352 * Auto-generate reference tables for language-dependent features?
353   Could be generated from the source modules.  A special command-line
354   option could be added to Docutils front ends to do this.  (Idea from
355   Engelbert Gruber.)
357 * Enable feedback of some kind from internal decisions, such as
358   reporting the successful input encoding.  Modify runtime settings?
359   System message?  Simple stderr output?
361 * Rationalize Writer settings (HTML/LaTeX/PEP) -- share settings.
363 * Add an "--include file" command-line option (config setting too?),
364   equivalent to ".. include:: file" as the first line of the doc text?
365   Especially useful for character entity sets, text transform specs,
366   boilerplate, etc.
368 * Parameterize the Reporter object or class?  See the `2004-02-18
369   "rest checking and source path"`_ thread.
371   .. _2004-02-18 "rest checking and source path":
372      http://thread.gmane.org/gmane.text.docutils.user/1112
374 * Add a "disable_transforms" setting?  And a dummy Writer subclass
375   that does nothing when its .write() method is called?  Would allow
376   for easy syntax checking.  See the `2004-02-18 "rest checking and
377   source path"`_ thread.
379 * Add a generic meta-stylesheet mechanism?  An external file could
380   associate style names ("class" attributes) with specific elements.
381   Could be generalized to arbitrary output attributes; useful for HTML
382   & XMLs.  Aahz implemented something like this in
383   sandbox/aahz/Effective/EffMap.py.
385 * .. _classes for table cells:
387   William Dode suggested that table cells be assigned "class"
388   attributes by columns, so that stylesheets can affect text
389   alignment.  Unfortunately, there doesn't seem to be a way (in HTML
390   at least) to leverage the "colspec" elements (HTML "col" tags) by
391   adding classes to them.  The resulting HTML is very verbose::
393       <td class="col1">111</td>
394       <td class="col2">222</td>
395       ...
397   At the very least, it should be an option.  People who don't use it
398   shouldn't be penalized by increases in their HTML file sizes.
400   Table rows could also be assigned classes (like odd/even).  That
401   would be easier to implement.
403   How should it be implemented?
405   * There could be writer options (column classes & row classes) with
406     standard values.
408   * The table directive could grow some options.  Something like
409     ":cell-classes: col1 col2 col3" (either must match the number of
410     columns, or repeat to fill?)  and ":row-classes: odd even" (repeat
411     to fill; body rows only, or header rows too?).
413   Probably per-table directive options are best.  The "class" values
414   could be used by any writer, and applying such classes to all tables
415   in a document with writer options is too broad.
417 * Add file-specific settings support to config files, like::
419       [file index.txt]
420       compact-lists: no
422   Is this even possible?  Should the criterion be the name of the
423   input file or the output file?  Alternative (more explicit) syntax::
425       [source_file index.txt]
426       ...
428       [dest_file index.html]
429       ...
431   Or rather allow settings configuration from the rst source file
432   (see misc.settings_ directive)?
434 * The "validator" support added to OptionParser is very similar to
435   "traits_" in SciPy_.  Perhaps something could be done with them?
436   (Had I known about traits when I was implementing docutils.frontend,
437   I may have used them instead of rolling my own.)
439   .. _traits: http://code.enthought.com/traits/
440   .. _SciPy: http://www.scipy.org/
442 * tools/buildhtml.py: Extend the --prune option ("prune" config
443   setting) to accept file names (generic path) in addition to
444   directories (e.g. --prune=docs/user/rst/cheatsheet.txt, which should
445   *not* be converted to HTML).
447 * Add support for _`plugins`.
449 * _`Config directories`: Currently, ~/.docutils, ./docutils.conf/, &
450   /etc/docutils.conf are read as configuration files.  Proposal: allow
451   ~/.docutils to be a a configuration *directory*, along with
452   /etc/docutils/ and ./docutils.conf/.  Within these directories,
453   check for config.txt files.  We can also have subdirectories here,
454   for plugins, S5 themes, components (readers/writers/parsers) etc.
456   Docutils will continue to support configuration files for backwards
457   compatibility.
459 * Add support for document decorations other than headers & footers?
460   For example, top/bottom/side navigation bars for web pages.  Generic
461   decorations?
463   Seems like a bad idea as long as it isn't independent from the ouput
464   format (for example, navigation bars are only useful for web pages).
466 * docutils_update: Check for a ``Makefile`` in a directory, and run
467   ``make`` if found?  This would allow for variant processing on
468   specific source files, such as running rst2s5.py instead of
469   rst2html.py.
471 * Add a "disable table of contents" setting?  The S5 writer could set
472   it as a default.  Rationale:
474       The ``contents`` (table of contents) directive must not be used
475       [in S5/HTML documents].  It changes the CSS class of headings
476       and they won't show up correctly in the screen presentation.
478       -- `Easy Slide Shows With reStructuredText & S5
479       <../user/slide-shows.html>`_
481   Analogue to the ``sectnum_xform`` setting, it could be used by the
482   latex writer to switch to a LaTeX generated ToC (currently, the latex
483   writer calls it "use_latex_toc").
485 object numbering and object references
486 --------------------------------------
488 For equations, tables & figures.
490 These would be the equivalent of DocBook's "formal" elements.
492 In LaTeX, automatic counters are implemented for sections, equations and
493 floats (figures, tables) (configurable via stylesheets or in the
494 latex-preamble). Objects can be given `reference names`_ with the
495 ``\label{<refname}`` command, ``\ref{<refname>}`` inserts the
496 corresponding number.
498 No such mechanism exists in HTML.
500 * We need _`persistent sequences`, similar to chapter and footnote
501   numbers. See `OpenOffice.org XML`_ "fields".
503   - Should the sequences be automatic or manual (user-specifyable)?
505 * It is already possible to give `reference names`_ to objects via
506   internal hyperlink targets or the "name" directive option::
508       .. _figure name:
510       .. figure:: image.png
512   or ::
514       .. figure:: image.png
515          :name: figure name
517   Improve the mapping of "phrase references" to IDs/labels with
518   Literal transcription (i.e. ü -> ue, ß -> ss, å -> aa) instead of just
519   stripping the accents and other non-ASCII chars.
520   Use http://pypi.python.org/pypi/Unidecode?
522   A "table" directive has been implemented, supporting table titles.
524   Perhaps the name could derive from the title/caption?
526   .. _reference names: ../ref/rst/restructuredtext.html#reference-names
528 * We need syntax for object references.  Cf. `OpenOffice.org XML`_
529   "reference fields":
531   - Parameterized substitutions are too complicated
532     (cf. `or not to do`: `object references`_)
534   - An interpreted text approach is simpler and better::
536       See Figure :ref:`figure name` and Equation :ref:`eq:identity`.
538   - "equation", "figure", and "page" roles could generate appropriate
539     boilerplate text::
541         See :figure:`figure name` on :page:`figure name`.
543     See `Interpreted Text`_ below.
545     Reference boilerplate could be specified in the document
546     (defaulting to nothing)::
548         .. fignum::
549            :prefix-ref: "Figure "
550            :prefix-caption: "Fig. "
551            :suffix-caption: :
553     The position of the role (prefix or suffix) could also be utilized
555   .. _OpenOffice.org XML: http://xml.openoffice.org/
556   .. _object references: rst/alternatives.html#object-references
558 See also the `Modified rst2html
559 <http://www.loria.fr/~rougier/coding/article/rst2html.py>`__
560 by Nicolas Rougier for a sample implementation.
563 Documentation
564 =============
566 User Docs
567 ---------
569 * Add a FAQ entry about using Docutils (with reStructuredText) on a
570   server and that it's terribly slow.  See the first paragraphs in
571   <http://article.gmane.org/gmane.text.docutils.user/1584>.
573 * Add document about what Docutils has previously been used for
574   (web/use-cases.txt?).
576 * Improve index in docs/user/config.txt.
579 Developer Docs
580 --------------
582 * Complete `Docutils Runtime Settings <../api/runtime-settings.html>`_.
584 * Improve the internal module documentation (docstrings in the code).
585   Specific deficiencies listed below.
587   - docutils.parsers.rst.states.State.build_table: data structure
588     required (including StringList).
590   - docutils.parsers.rst.states: more complete documentation of parser
591     internals.
593 * docs/ref/doctree.txt: DTD element structural relationships,
594   semantics, and attributes.  In progress; element descriptions to be
595   completed.
597 * Document the ``pending`` elements, how they're generated and what
598   they do.
600 * Document the transforms (perhaps in docstrings?): how they're used,
601   what they do, dependencies & order considerations.
603 * Document the HTML classes used by html4css1.py.
605 * Write an overview of the Docutils architecture, as an introduction
606   for developers.  What connects to what, why, and how.  Either update
607   PEP 258 (see PEPs_ below) or as a separate doc.
609 * Give information about unit tests.  Maybe as a howto?
611 * Document the docutils.nodes APIs.
613 * Complete the docs/api/publisher.txt docs.
616 How-Tos
617 -------
619 * Creating Docutils Writers
621 * Creating Docutils Readers
623 * Creating Docutils Transforms
625 * Creating Docutils Parsers
627 * Using Docutils as a Library
630 PEPs
631 ----
633 * Complete PEP 258 Docutils Design Specification.
635   - Fill in the blanks in API details.
637   - Specify the nodes.py internal data structure implementation?
639         [Tibs:] Eventually we need to have direct documentation in
640         there on how it all hangs together - the DTD is not enough
641         (indeed, is it still meant to be correct?  [Yes, it is.
642         --DG]).
644 * Rework PEP 257, separating style from spec from tools, wrt Docutils?
645   See Doc-SIG from 2001-06-19/20.
648 Python Source Reader
649 ====================
651 General:
653 * Analyze Tony Ibbs' PySource code.
655 * Analyze Doug Hellmann's HappyDoc project.
657 * Investigate how POD handles literate programming.
659 * Take the best ideas and integrate them into Docutils.
661 Miscellaneous ideas:
663 * Ask Python-dev for opinions (GvR for a pronouncement) on special
664   variables (__author__, __version__, etc.): convenience vs. namespace
665   pollution.  Ask opinions on whether or not Docutils should recognize
666   & use them.
668 * If we can detect that a comment block begins with ``##``, a la
669   JavaDoc, it might be useful to indicate interspersed section headers
670   & explanatory text in a module.  For example::
672       """Module docstring."""
674       ##
675       # Constants
676       # =========
678       a = 1
679       b = 2
681       ##
682       # Exception Classes
683       # =================
685       class MyException(Exception): pass
687       # etc.
689 * Should standalone strings also become (module/class) docstrings?
690   Under what conditions?  We want to prevent arbitrary strings from
691   becomming docstrings of prior attribute assignments etc.  Assume
692   that there must be no blank lines between attributes and attribute
693   docstrings?  (Use lineno of NEWLINE token.)
695   Triple-quotes are sometimes used for multi-line comments (such as
696   commenting out blocks of code).  How to reconcile?
698 * HappyDoc's idea of using comment blocks when there's no docstring
699   may be useful to get around the conflict between `additional
700   docstrings`_ and ``from __future__ import`` for module docstrings.
701   A module could begin like this::
703       #!/usr/bin/env python
704       # :Author: Me
705       # :Copyright: whatever
707       """This is the public module docstring (``__doc__``)."""
709       # More docs, in comments.
710       # All comments at the beginning of a module could be
711       # accumulated as docstrings.
712       # We can't have another docstring here, because of the
713       # ``__future__`` statement.
715       from __future__ import division
717   Using the JavaDoc convention of a doc-comment block beginning with
718   ``##`` is useful though.  It allows doc-comments and implementation
719   comments.
721   .. _additional docstrings:
722      ../peps/pep-0258.html#additional-docstrings
724 * HappyDoc uses an initial comment block to set "parser configuration
725   values".  Do the same thing for Docutils, to set runtime settings on
726   a per-module basis?  I.e.::
728       # Docutils:setting=value
730   Could be used to turn on/off function parameter comment recognition
731   & other marginal features.  Could be used as a general mechanism to
732   augment config files and command-line options (but which takes
733   precedence?).
735 * Multi-file output should be divisible at arbitrary level.
737 * Support all forms of ``import`` statements:
739   - ``import module``: listed as "module"
740   - ``import module as alias``: "alias (module)"
741   - ``from module import identifier``: "identifier (from module)"
742   - ``from module import identifier as alias``: "alias (identifier
743     from module)"
744   - ``from module import *``: "all identifiers (``*``) from module"
746 * Have links to colorized Python source files from API docs?  And
747   vice-versa: backlinks from the colorized source files to the API
748   docs!
750 * In summaries, use the first *sentence* of a docstring if the first
751   line is not followed by a blank line.
754 reStructuredText Parser
755 =======================
757 Also see the `... Or Not To Do?`__ list.
759 __ rst/alternatives.html#or-not-to-do
761 Misc
762 ----
764 * Another list problem::
766       * foo
767             * bar
768             * baz
770   This ends up as a definition list.  This is more of a usability
771   issue.
773 * This case is probably meant to be a nested list, but it ends up as a
774   list inside a block-quote without an error message::
776       - foo
778        - bar
780   It should probably just be an error.
782   The problem with this is that you don't notice easily in HTML that
783   it's not a nested list but a block-quote -- there's not much of a
784   visual difference.
786 * Treat enumerated lists that are not arabic and consist of only one
787   item in a single line as ordinary paragraphs.  See
788   <http://article.gmane.org/gmane.text.docutils.user/2635>.
790 * The citation syntax could use some improvements.  See
791   <http://thread.gmane.org/gmane.text.docutils.user/2499> (and the
792   sub-thread at
793   <http://thread.gmane.org/gmane.text.docutils.user/2499/focus=3028>,
794   and the follow-ups at
795   <http://thread.gmane.org/gmane.text.docutils.user/3087>,
796   <http://thread.gmane.org/gmane.text.docutils.user/3110>,
797   <http://thread.gmane.org/gmane.text.docutils.user/3114>),
798   <http://thread.gmane.org/gmane.text.docutils.user/2443>,
799   <http://thread.gmane.org/gmane.text.docutils.user/2715>,
800   <http://thread.gmane.org/gmane.text.docutils.user/3027>,
801   <http://thread.gmane.org/gmane.text.docutils.user/3120>,
802   <http://thread.gmane.org/gmane.text.docutils.user/3253>.
804 * The current list-recognition logic has too many false positives, as
805   in ::
807       * Aorta
808       * V. cava superior
809       * V. cava inferior
811   Here ``V.`` is recognized as an enumerator, which leads to
812   confusion.  We need to find a solution that resolves such problems
813   without complicating the spec to much.
815   See <http://thread.gmane.org/gmane.text.docutils.user/2524>.
817 * Add indirect links via citation references & footnote references.
818   Example::
820       `Goodger (2005)`_ is helpful.
822       .. _Goodger (2005): [goodger2005]_
823       .. [goodger2005] citation text
825   See <http://thread.gmane.org/gmane.text.docutils.user/2499>.
827 * Complain about bad URI characters
828   (http://article.gmane.org/gmane.text.docutils.user/2046) and
829   disallow internal whitespace
830   (http://article.gmane.org/gmane.text.docutils.user/2214).
832 * Create ``info``-level system messages for unnecessarily
833   backslash-escaped characters (as in ``"\something"``, rendered as
834   "something") to allow checking for errors which silently slipped
835   through.
837 * Add (functional) tests for untested roles.
839 * Add test for ":figwidth: image" option of "figure" directive.  (Test
840   code needs to check if PIL is available on the system.)
842 * Add support for CJK double-width whitespace (indentation) &
843   punctuation characters (markup; e.g. double-width "*", "-", "+")?
845 * Add motivation sections for constructs in spec.
847 * Support generic hyperlink references to _`targets in other
848   documents`?  Not in an HTML-centric way, though (it's trivial to say
849   ``http://www.example.com/doc#name``, and useless in non-HTML
850   contexts).  XLink/XPointer?  ``.. baseref::``?  See Doc-SIG
851   2001-08-10.
853 * .. _adaptable file extensions:
855   In target URLs, it would be useful to not explicitly specify the
856   file extension.  If we're generating HTML, then ".html" is
857   appropriate; if PDF, then ".pdf"; etc.  How about using ".*" to
858   indicate "choose the most appropriate filename extension"?  For
859   example::
861       .. _Another Document: another.*
863   What is to be done for output formats that don't *have* hyperlinks?
864   For example, LaTeX targeted at print.  Hyperlinks may be "called
865   out", as footnotes with explicit URLs.  (Don't convert the links.)
867   But then there's also LaTeX targeted at PDFs, which *can* have
868   links.  Perhaps a runtime setting for "*" could explicitly provide
869   the extension, defaulting to the output file's extension.
871   Should the system check for existing files?  No, not practical.
873   Handle documents only, or objects (images, etc.) also?
875   If this handles images also, how to differentiate between document
876   and image links?  Element context (within "image")?  Which image
877   extension to use for which document format?  Again, a runtime
878   setting would suffice.
880   This may not be just a parser issue; it may need framework support.
882   Mailing list threads: `Images in both HTML and LaTeX`__ (especially
883   `this summary of Lea's objections`__), `more-universal links?`__,
884   `Output-format-sensitive link targets?`__
886   __ http://thread.gmane.org/gmane.text.docutils.user/1239
887   __ http://article.gmane.org/gmane.text.docutils.user/1278
888   __ http://thread.gmane.org/gmane.text.docutils.user/1915
889   __ http://thread.gmane.org/gmane.text.docutils.user/2438
891   Idea from Jim Fulton: an external lookup table of targets:
893       I would like to specify the extension (e.g. .txt) [in the
894       source, rather than ``filename.*``], but tell the converter to
895       change references to the files anticipating that the files will
896       be converted too.
898       For example::
900         .. _Another Document: another.txt
902         rst2html.py --convert-links "another.txt bar.txt" foo.txt
904       That is, name the files for which extensions should be converted.
906       Note that I want to refer to original files in the original text
907       (another.txt rather than another.txt) because I want the
908       unconverted text to stand on its own.
910       Note that in most cases, people will be able to use globs::
912         rst2html.py --convert-link-extensions-for "`echo *.txt`" foo.txt
914       It might be nice to be able to use multiple arguments, as in::
916         rst2html.py --convert-link-extensions-for *.txt -- foo.txt
918       ::
920       > What is to be done for output formats
921       > that don't have hyperlinks?
923       Don't convert the links.
925       ::
927       > Handle documents only, or objects
928       > (images, etc.) also?
930       No, documents only, but there really is no need for gueswork.
931       Just get the file names as command-line arguments.  EIBTI
932       [explicit is better than implicit].
934   For images, we probably need separate solution (which is being
935   worked on), whereas for documents, the issue is basically
936   interlinking between reStructuredText documents.  IMO, this cries
937   for support for multiple input and output files, i.e. support for
938   documents which comprise multiple files.  Adding adaptable file
939   extensions seems like a kludge.  // FW
941 * Implement the header row separator modification to table.el.  (Wrote
942   to Takaaki Ota & the table.el mailing list on 2001-08-12, suggesting
943   support for "=====" header rows.  On 2001-08-17 he replied, saying
944   he'd put it on his to-do list, but "don't hold your breath".)
946 * Fix the parser's indentation handling to conform with the stricter
947   definition in the spec.  (Explicit markup blocks should be strict or
948   forgiving?)
950   .. XXX What does this mean?  Can you elaborate, David?
952 * Make the parser modular.  Allow syntax constructs to be added or
953   disabled at run-time.  Subclassing is probably not enough because it
954   makes it difficult to apply multiple extensions.
956 * Generalize the "doctest block" construct (which is overly
957   Python-centric) to other interactive sessions?  "Doctest block"
958   could be renamed to "I/O block" or "interactive block", and each of
959   these could also be recognized as such by the parser:
961   - Shell sessions::
963         $ cat example1.txt
964         A block beginning with a "$ " prompt is interpreted as a shell
965         session interactive block.  As with Doctest blocks, the
966         interactive block ends with the first blank line, and wouldn't
967         have to be indented.
969   - Root shell sessions::
971         # cat example2.txt
972         A block beginning with a "# " prompt is interpreted as a root
973         shell session (the user is or has to be logged in as root)
974         interactive block.  Again, the block ends with a blank line.
976   Other standard (and unambiguous) interactive session prompts could
977   easily be added (such as "> " for WinDOS).
979   Tony Ibbs spoke out against this idea (2002-06-14 Doc-SIG thread
980   "docutils feedback").
982 * Add support for pragma (syntax-altering) directives.
984   Some pragma directives could be local-scope unless explicitly
985   specified as global/pragma using ":global:" options.
987 * Support whitespace in angle-bracketed standalone URLs according to
988   Appendix E ("Recommendations for Delimiting URI in Context") of `RFC
989   2396`_.
991   .. _RFC 2396: http://www.rfc-editor.org/rfc/rfc2396.txt
993 * Use the vertical spacing of the source text to determine the
994   corresponding vertical spacing of the output?
996 * [From Mark Nodine]  For cells in simple tables that comprise a
997   single line, the justification can be inferred according to the
998   following rules:
1000   1. If the text begins at the leftmost column of the cell,
1001      then left justification, ELSE
1002   2. If the text begins at the rightmost column of the cell,
1003      then right justification, ELSE
1004   3. Center justification.
1006   The onus is on the author to make the text unambiguous by adding
1007   blank columns as necessary.  There should be a parser setting to
1008   turn off justification-recognition (normally on would be fine).
1010   Decimal justification?
1012   All this shouldn't be done automatically.  Only when it's requested
1013   by the user, e.g. with something like this::
1015       .. table::
1016          :auto-indent:
1018          (Table goes here.)
1020   Otherwise it will break existing documents.
1022 * Generate a warning or info message for paragraphs which should have
1023   been lists, like this one::
1025       1. line one
1026       3. line two
1028 * Generalize the "target-notes" directive into a command-line option
1029   somehow?  See docutils-develop 2003-02-13.
1031 * Allow a "::"-only paragraph (first line, actually) to introduce a
1032   _`literal block without a blank line`?  (Idea from Paul Moore.) ::
1034       ::
1035           This is a literal block
1037   Is indentation enough to make the separation between a paragraph
1038   which contains just a ``::`` and the literal text unambiguous?
1039   (There's one problem with this concession: If one wants a definition
1040   list item which defines the term "::", we'd have to escape it.)  It
1041   would only be reasonable to apply it to "::"-only paragraphs though.
1042   I think the blank line is visually necessary if there's text before
1043   the "::"::
1045       The text in this paragraph needs separation
1046       from the literal block following::
1047           This doesn't look right.
1049 * Add new syntax for _`nested inline markup`?  Or extend the parser to
1050   parse nested inline markup somehow?  See the `collected notes
1051   <rst/alternatives.html#nested-inline-markup>`__.
1053 * Drop the backticks from embedded URIs with omitted reference text?
1054   Should the angle brackets be kept in the output or not? ::
1056       <file_name>_
1058   Probably not worth the trouble.
1060 * How about a syntax for alternative hyperlink behavior, such as "open
1061   in a new window" (as in HTML's ``<a target="_blank">``)?
1063   The MoinMoin wiki uses a caret ("^") at the beginning of the URL
1064   ("^" is not a legal URI character).  That could work for both inline
1065   and explicit targets::
1067       The `reference docs <^url>`__ may be handy.
1069       .. _name: ^url
1071   This may be too specific to HTML.  It hasn't been requested very
1072   often either.
1074 * Add an option to add URI schemes at runtime.
1076 * _`Segmented lists`::
1078       : segment : segment : segment
1079       : segment : segment : very long
1080         segment
1081       : segment : segment : segment
1083   The initial colon (":") can be thought of as a type of bullet
1085   We could even have segment titles::
1087       :: title  : title   : title
1088       : segment : segment : segment
1089       : segment : segment : segment
1091   This would correspond well to DocBook's SegmentedList.  Output could
1092   be tabular or "name: value" pairs, as described in DocBook's docs.
1094 * Allow backslash-escaped colons in field names::
1096       :Case Study\: Event Handling: This chapter will be dropped.
1098 * Enable grid _`tables inside XML comments`, where "``--``" ends comments.
1100   Implementation possibilities:
1102   1. Make the table syntax characters into "table" directive options.
1103      This is the most flexible but most difficult, and we probably
1104      don't need that much flexibility.
1106   2. Substitute "~" for "-" with a specialized directive option
1107      (e.g. ":tildes:").
1109   3. Make the standard table syntax recognize "~" as well as "-", even
1110      without a directive option.  Individual tables would have to be
1111      internally consistent.
1113   4. Allow Unicode box characters for table markup
1114      (`feature request [6]`_)
1116   Directive options are preferable to configuration settings, because
1117   tables are document-specific.  A pragma directive would be another
1118   approach, to set the syntax once for a whole document.
1120   Unicode box character markup would kill two birds with one stone.
1122   In the meantime, the list-table_ directive is a good replacement for
1123   grid tables inside XML comments.
1125   .. _feature request [6]:
1126       http://sourceforge.net/p/docutils/feature-requests/6
1127   .. _list-table: ../ref/rst/directives.html#list-table
1130 * Generalize docinfo contents (bibliographic fields): remove specific
1131   fields, and have only a single generic "field"?
1133 * _`Line numbers` and "source" in system messages:
1135   - Add "source" and "line" keyword arguments to all Reporter calls?
1136     This would require passing source/line arguments along all
1137     intermediate functions (where currently only `line` is used).
1139     Or rather specify "line" only if actually needed?
1141     Currently, `document.reporter` uses a state machine instance to
1142     determine the "source" and "line" info from
1143     `statemachine.input_lines` if not given explicitely. Except for
1144     special cases, the "line" argument is not needed because,
1145     `document.statemachine` keeps record of the current line number.
1147   - For system messages generated after the parsing is completed (i.e. by
1148     transforms or the writer) "line" info must be present in the doctree
1149     elements.
1151     Elements' .line assignments should be checked.  (Assign to .source
1152     too?  Add a set_info method?  To what?)
1154     The "source" (and line number in the source) can either be added
1155     explicitely to the elements or determined from the “raw” line
1156     number by `document.statemachine.get_source_and_line`.
1158   - Some line numbers in elements are not being set properly
1159     (explicitly), just implicitly/automatically.  See rev. 1.74 of
1160     docutils/parsers/rst/states.py for an example of how to set.
1162   - The line numbers of definition list items are wrong::
1164         $ rst2pseudoxml.py --expose-internal-attribute line
1165         1
1166           2
1167           3
1169         5
1170           6
1171           7
1173         <document source="<stdin>">
1174             <definition_list>
1175                 <definition_list_item internal:line="3">
1176                     <term>
1177                         1
1178                     <definition>
1179                         <paragraph internal:line="2">
1180                             2
1181                             3
1182                 <definition_list_item internal:line="6">
1183                     <term>
1184                         5
1185                     <definition>
1186                         <paragraph internal:line="6">
1187                             6
1188                             7
1190 * .. _none source:
1192   Quite a few nodes are getting a "None" source attribute as well.  In
1193   particular, see the bodies of definition lists.
1197 Math Markup
1198 -----------
1200 Since Docutils 0.8, a "math" role and directive using LaTeX math
1201 syntax as input format is part of reStructuredText.
1203 Open issues:
1205 * Use a "Transform" for math format conversions as extensively discussed in
1206   the "math directive issues" thread in May 2008
1207   (http://osdir.com/ml/text.docutils.devel/2008-05/threads.html)?
1209 * Generic "math-output" option (currently specific to HTML).
1210   (List of math-output preferences?)
1212 * Try to be compatible with `Math support in Sphinx`_?
1214   * The ``:label:`` option selects a label for the equation, by which it
1215     can be cross-referenced, and causes an equation number to be issued.
1216     In Docutils, the option ``:name:`` sets the label.
1217     Equation numbering is not implemented yet.
1219   * Option ``:nowrap:`` prevents wrapping of the given math in a
1220     math environment (you have to specify the math environment in the
1221     content).
1223 .. _Math support in Sphinx: http://sphinx.pocoo.org/ext/math.html
1225 * Equation numbering and references. (Should be handled in a unified way
1226   with other numbered entities like formal tables and images.)
1228 alternative input formats
1229 `````````````````````````
1231 Use a directive option to specify an alternative input format, e.g. (but not
1232 limited to):
1234 MathML_
1235   Not for hand-written code but maybe usefull when pasted in (or included
1236   from a file)
1238   For an overview of MathML implementations and tests, see, e.g.,
1239   the `mathweb wiki`_ or the `ConTeXT MathML page`_.
1241   .. _MathML: http://www.w3.org/TR/MathML2/
1242   .. _mathweb wiki: http://www.mathweb.org/wiki/MathML
1243   .. _ConTeXT MathML page: http://wiki.contextgarden.net/MathML
1246 ASCIIMath_
1247   Simple, ASCII based math input language (see also `ASCIIMath tutorial`_).
1249   * The Python module ASCIIMathML_ translates a string with ASCIIMath into a
1250     MathML tree. Used, e.g., by MultiMarkdown__.
1252     A more comprehensive implementation is ASCIIMathPython_ by
1253     Paul Trembley (also used in his sandbox projects).
1255   * For conversion to LaTeX, there is a JavaScript script at
1256     http://dlippman.imathas.com/asciimathtex/ASCIIMath2TeX.js
1258   .. _ASCIIMath: http://www1.chapman.edu/~jipsen/mathml/asciimath.html
1259   .. _ASCIIMath tutorial:
1260      http://www.wjagray.co.uk/maths/ASCIIMathTutorial.html
1261   .. _ASCIIMathML: http://pypi.python.org/pypi/asciimathml/
1262   .. _ASCIIMathPython: http://sourceforge.net/projects/asciimathpython/
1263   __ http://fletcherpenney.net/multimarkdown/
1265 `Unicode Nearly Plain Text Encoding of Mathematics`_
1266    format for lightly marked-up representation of mathematical
1267    expressions in Unicode.
1269    (Unicode Technical Note. Sole responsibility for its contents rests
1270    with the author(s). Publication does not imply any endorsement by
1271    the Unicode Consortium.)
1273    .. _Unicode Nearly Plain Text Encoding of Mathematics:
1274       http://www.unicode.org/notes/tn28/
1276 itex
1277   See `the culmination of a relevant discussion in 2003
1278   <http://article.gmane.org/gmane.text.docutils.user/118>`__.
1282 LaTeX output
1283 ````````````
1285 Which equation environments should be supported by the math directive?
1287 * one line:
1289   + numbered: `equation`
1290   + unnumbered: `equation*`
1292 * multiline (test for ``\\`` outside of a nested environment
1293   (e.g. `array` or `cases`)
1295   + numbered: `align` (number every line)
1297     (To give one common number to all lines, put them in a `split`
1298     environment. Docutils then places it in an `equation` environment.)
1300   + unnumbered: `align*`
1302   + Sphinx math also supports `gather` (checking for blank lines in
1303     the content). Docutils puts content blocks separated by blank
1304     lines in separate math-block doctree nodes. (The only difference of
1305     `gather` to two consecutive "normal" environments seems to be that
1306     page-breaks between the two are prevented.)
1308 See http://www.math.uiuc.edu/~hildebr/tex/displays.html.
1311 HTML output
1312 ```````````
1314 There is no native math support in HTML.
1316 MathML_
1317   Converters from LaTeX to MathML include
1319   * latex_math_ (Python) by Jens Jørgen Mortensen in the Docutils sandbox
1320   * Blahtex_ (C++)
1321   * MathToWeb_ (Java)
1322   * TeX4ht_ (TeX based)
1323   * LaTeXML_ (Perl) with the command latexmlmath_, e.g.::
1325        latexmlmath --contentmathml=- $\vec{\alpha}$
1327   * itex_ (also `used in Abiword`__)
1328   * TtM_ (C, non free, free binary for Linux) with an `online-trial page`__
1329   * `Steve’s LATEX-to-MathML translator`_
1330     ('mini-language', javascript, Python)
1332   latex_math_ is the base for the current latex2mathml_ module used
1333   with ``--math-output=MathML``.
1335   * Write a new converter based on:
1337     * a generic tokenizer (see e.g. a `latex-codec recipe`_,
1338       `updated latex-codec`_, )
1339     * the Unicode-Char <-> LaTeX mappings database unimathsymbols_
1341   __ http://msevior.livejournal.com/26377.html
1342   __ http://hutchinson.belmont.ma.us/tth/mml/ttmmozform.html
1343   .. _MathML: http://www.w3.org/TR/MathML2/
1344   .. _latex_math: ../../../sandbox/jensj/latex_math/
1345   .. _latex2mathml: ../../docutils/math/latex2mathml.py
1346   .. _Blahtex: http://gva.noekeon.org/blahtexml/
1347   .. _MathToWeb:  http://www.mathtoweb.com/
1348   .. _TeX4ht: http://www.tug.org/applications/tex4ht/mn.html
1349   .. _LaTeXML: http://dlmf.nist.gov/LaTeXML/
1350   .. _latexmlmath:
1351      http://dlmf.nist.gov/LaTeXML/manual/commands/latexmlmath.html
1352   .. _itex: http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html
1353   .. _ttm: http://hutchinson.belmont.ma.us/tth/mml/
1354   .. _Steve’s LATEX-to-MathML translator:
1355      http://www.gold-saucer.org/mathml/greasemonkey/dist/display-latex
1356   .. _latex-codec recipe:
1357      http://code.activestate.com/recipes/252124-latex-codec/
1358   .. _updated latex-codec:
1359      http://mirror.ctan.org/biblio/bibtex/utils/mab2bib/latex.py
1360   .. _unimathsymbols: http://milde.users.sourceforge.net/LUCR/Math/
1362 .. URL seems down:
1363    .. _itex: http://pear.math.pitt.edu/mathzilla/itex2mmlItex.html
1366 HTML/CSS
1367   format math in standard HTML enhanced by CSS rules
1368   (Overview__, `Examples and experiments`__).
1370   LaTeX-math to HTML/CSS converters include
1372   * TtH_ (C)
1373   * Hevea_ (Objective Caml)
1374   * eLyXer_ (Python)
1376   The ``math-output=html`` option uses the converter from eLyXer.
1378   __ http://www.cs.tut.fi/~jkorpela/math/
1379   __ http://www.zipcon.net/~swhite/docs/math/math.html
1380   .. _TtH: ttp://hutchinson.belmont.ma.us/tth/index.html
1381   .. _Hevea: http://para.inria.fr/~maranget/hevea/
1382   .. _elyxer: http://elyxer.nongnu.org/
1384 images
1385   (PNG or SVG) like e.g. Wikipedia. (e.g. with dvisvgm_ or the
1386   pure-python MathML->SVG converter SVGMath_)
1388   .. _dvisvgm: http://dvisvgm.sourceforge.net/
1389   .. _SVGMath: http://www.grigoriev.ru/svgmath/
1392 OpenOffice output
1393 `````````````````
1395 * The `OpenDocument standard`_ version 1.1 says:
1397     Mathematical content is represented by MathML 2.0
1399   However, putting MathML into an ODP file seems tricky as these
1400   (maybe outdated) links suppose:
1401   http://idippedut.dk/post/2008/01/25/Do-your-math-ODF-and-MathML.aspx
1402   http://idippedut.dk/post/2008/03/03/Now-I-get-it-ODF-and-MathML.aspx
1404   .. _OpenDocument standard:
1405     http://www.oasis-open.org/standards#opendocumentv1.1
1407 * OOoLaTeX__:  "a set of macros designed to bring the power of LaTeX
1408   into OpenOffice."
1410   __ http://ooolatex.sourceforge.net/
1413 Directives
1414 ----------
1416 Directives below are often referred to as "module.directive", the
1417 directive function.  The "module." is not part of the directive name
1418 when used in a document.
1420 * Allow for field lists in list tables.  See
1421   <http://thread.gmane.org/gmane.text.docutils.devel/3392>.
1423 * .. _unify tables:
1425   Unify table implementations and unify options of table directives
1426   (http://article.gmane.org/gmane.text.docutils.user/1857).
1428 * Allow directives to be added at run-time?
1430 * Use the language module for directive option names?
1432 * Add "substitution_only" and "substitution_ok" function attributes,
1433   and automate context checking?
1435 * Implement options or features on existing directives:
1437   - All directives that produce titled elements should grow implicit
1438     reference names based on the titles.
1440   - Allow the _`:trim:` option for all directives when they occur in a
1441     substitution definition, not only the unicode_ directive.
1443     .. _unicode: ../ref/rst/directives.html#unicode-character-codes
1445   - Add the "class" option to the unicode_ directive.  For example, you
1446     might want to get characters or strings with borders around them.
1448   - _`images.figure`: "title" and "number", to indicate a formal
1449     figure?
1451   - _`parts.sectnum`: "local"?, "refnum"
1453     A "local" option could enable numbering for sections from a
1454     certain point down, and sections in the rest of the document are
1455     not numbered.  For example, a reference section of a manual might
1456     be numbered, but not the rest.  OTOH, an all-or-nothing approach
1457     would probably be enough.
1459     The "sectnum" directive should be usable multiple times in a
1460     single document.  For example, in a long document with "chapter"
1461     and "appendix" sections, there could be a second "sectnum" before
1462     the first appendix, changing the sequence used (from 1,2,3... to
1463     A,B,C...).  This is where the "local" concept comes in.  This part
1464     of the implementation can be left for later.
1466     A "refnum" option (better name?) would insert reference names
1467     (targets) consisting of the reference number.  Then a URL could be
1468     of the form ``http://host/document.html#2.5`` (or "2-5"?).  Allow
1469     internal references by number?  Allow name-based *and*
1470     number-based ids at the same time, or only one or the other (which
1471     would the table of contents use)?  Usage issue: altering the
1472     section structure of a document could render hyperlinks invalid.
1474   - _`parts.contents`: Add a "suppress" or "prune" option?  It would
1475     suppress contents display for sections in a branch from that point
1476     down.  Or a new directive, like "prune-contents"?
1478     Add an option to include topics in the TOC?  Another for sidebars?
1479     The "topic" directive could have a "contents" option, or the
1480     "contents" directive" could have an "include-topics" option.  See
1481     docutils-develop 2003-01-29.
1483   - _`parts.header` & _`parts.footer`: Support multiple, named headers
1484     & footers?  For example, separate headers & footers for odd, even,
1485     and the first page of a document.
1487     This may be too specific to output formats which have a notion of
1488     "pages".
1490   - _`misc.class`:
1492     - Add a ``:parent:`` option for setting the parent's class
1493       (http://article.gmane.org/gmane.text.docutils.devel/3165).
1495   - _`misc.include`:
1497     - Option to label lines?
1499     - How about an environment variable, say RSTINCLUDEPATH or
1500       RSTPATH, for standard includes (as in ``.. include:: <name>``)?
1501       This could be combined with a setting/option to allow
1502       user-defined include directories.
1504     - Add support for inclusion by URL? ::
1506           .. include::
1507              :url: http://www.example.org/inclusion.txt
1509     - Strip blank lines from begin and end of a literal included file or
1510       file section. This would correspond to the way a literal block is
1511       handled.
1513       As nodes.literal_block expects (and we have) the text as a string
1514       (rather than a list of lines), using a regexp seems the way.
1516   - _`misc.raw`: add a "destination" option to the "raw" directive? ::
1518         .. raw:: html
1519            :destination: head
1521            <link ...>
1523     It needs thought & discussion though, to come up with a consistent
1524     set of destination labels and consistent behavior.
1526     And placing HTML code inside the <head> element of an HTML
1527     document is rather the job of a templating system.
1529   - _`body.sidebar`: Allow internal section structure?  Adornment
1530     styles would be independent of the main document.
1532     That is really complicated, however, and the document model
1533     greatly benefits from its simplicity.
1535 * Implement directives.  Each of the list items below begins with an
1536   identifier of the form, "module_name.directive_function_name".  The
1537   directive name itself could be the same as the
1538   directive_function_name, or it could differ.
1540   - _`html.imagemap`
1542     It has the disadvantage that it's only easily implementable for
1543     HTML, so it's specific to one output format.
1545     (For non-HTML writers, the imagemap would have to be replaced with
1546     the image only.)
1548   - _`parts.endnotes` (or "footnotes"): See `Footnote & Citation Gathering`_.
1550   - _`parts.citations`: See `Footnote & Citation Gathering`_.
1552   - _`misc.language`: Specify (= change) the language of a document at
1553     parse time?
1555     * The misc.settings_ directive suggested below offers a more generic
1556       approach.
1558     * The language of document parts can be indicated by the "special class
1559       value" ``"language-"`` + `BCP 47`_ language code. Class arguments to
1560       the title are attached to the document's base node - hence titled
1561       documents can be given a different language at parse time. However,
1562       "language by class attribute" does not change parsing (localized
1563       directives etc.), only supporting writers.
1565     .. _BCP 47: http://www.rfc-editor.org/rfc/bcp/bcp47.txt
1568   - _`misc.settings`: Set any(?) Docutils runtime setting from within
1569     a document?  Needs much thought and discussion.
1571     Security concerns need to be taken into account (it shouldn't be
1572     possible to enable ``file_insertion_enabled`` from within a
1573     document), and settings that only would have taken effect before
1574     the directive (like ``tab-width``) shouldn't be accessible either.
1576     See this sub-thread:
1577     <http://thread.gmane.org/gmane.text.docutils.user/3620/focus=3649>
1579   - _`misc.gather`: Gather (move, or copy) all instances of a specific
1580     element.  A generalization of the `Footnote & Citation Gathering`_
1581     ideas.
1583   - Add a custom "directive" directive, equivalent to "role"?  For
1584     example::
1586         .. directive:: incr
1588            .. class:: incremental
1590         .. incr::
1592         "``.. incr::``" above is equivalent to "``.. class:: incremental``".
1594     Another example::
1596         .. directive:: printed-links
1598            .. topic:: Links
1599               :class: print-block
1601               .. target-notes::
1602                  :class: print-inline
1604     This acts like macros.  The directive contents will have to be
1605     evaluated when referenced, not when defined.
1607     * Needs a better name?  "Macro", "substitution"?
1608     * What to do with directive arguments & options when the
1609       macro/directive is referenced?
1611   - Make the meaning of block quotes overridable?  Only a 1-shot
1612     though; doesn't solve the general problem.
1614   - _`conditional directives`:
1616     .. note:: See also the implementation in Sphinx_.
1618     Docutils already has the ability to say "use this content for
1619     Writer X" via the "raw" directive. It also does have the ability
1620     to say "use this content for any Writer other than X" via the
1621     "strip-elements with class" config value.  However, using "raw"
1622     input just to select a special writer is inconvenient in many
1623     cases.
1624     It wouldn't be difficult to get more straightforward support, though.
1626     My first idea would be to add a set of conditional directives.
1627     Let's call them "writer-is" and "writer-is-not" for discussion
1628     purposes (don't worry about implemention details).  We might
1629     have::
1631          .. writer-is:: text-only
1633             ::
1635                 +----------+
1636                 |   SNMP   |
1637                 +----------+
1638                 |   UDP    |
1639                 +----------+
1640                 |    IP    |
1641                 +----------+
1642                 | Ethernet |
1643                 +----------+
1645          .. writer-is:: pdf
1647             .. figure:: protocol_stack.eps
1649          .. writer-is-not:: text-only pdf
1651             .. figure:: protocol_stack.png
1653     This could be an interface to the Filter transform
1654     (docutils.transforms.components.Filter).
1656     The ideas in `adaptable file extensions`_ above may also be
1657     applicable here.
1659     SVG's "switch" statement may provide inspiration.
1661     Here's an example of a directive that could produce multiple
1662     outputs (*both* raw troff pass-through *and* a GIF, for example)
1663     and allow the Writer to select. ::
1665         .. eqn::
1667            .EQ
1668            delim %%
1669            .EN
1670            %sum from i=o to inf c sup i~=~lim from {m -> inf}
1671            sum from i=0 to m sup i%
1672            .EQ
1673            delim off
1674            .EN
1676   - _`body.example`: Examples; suggested by Simon Hefti.  Semantics as
1677     per Docbook's "example"; admonition-style, numbered, reference,
1678     with a caption/title.
1680   - _`body.index`: Index targets.
1682     See `Index Entries & Indexes
1683     <./rst/alternatives.html#index-entries-indexes>`__.
1685   - _`body.literal`: Literal block, possibly "formal" (see `object
1686     numbering and object references`_ above).  Possible options:
1688     - "highlight" a range of lines
1690     - include only a specified range of lines
1692     - "number" or "line-numbers"? (since 0.9 available with "code" directive)
1694     - "styled" could indicate that the directive should check for
1695       style comments at the end of lines to indicate styling or
1696       markup.
1698       Specific derivatives (i.e., a "python-interactive" directive)
1699       could interpret style based on cues, like the ">>> " prompt and
1700       "input()"/"raw_input()" calls.
1702     See docutils-users 2003-03-03.
1704   - _`body.listing`: Code listing with title (to be numbered
1705     eventually), equivalent of "figure" and "table" directives.
1707   - _`pysource.usage`: Extract a usage message from the program,
1708     either by running it at the command line with a ``--help`` option
1709     or through an exposed API.  [Suggestion for Optik.]
1712 Interpreted Text
1713 ----------------
1715 Interpreted text is entirely a reStructuredText markup construct, a
1716 way to get around built-in limitations of the medium.  Some roles are
1717 intended to introduce new doctree elements, such as "title-reference".
1718 Others are merely convenience features, like "RFC".
1720 All supported interpreted text roles must already be known to the
1721 Parser when they are encountered in a document.  Whether pre-defined
1722 in core/client code, or in the document, doesn't matter; the roles
1723 just need to have already been declared.  Adding a new role may
1724 involve adding a new element to the DTD and may require extensive
1725 support, therefore such additions should be well thought-out.  There
1726 should be a limited number of roles.
1728 The only place where no limit is placed on variation is at the start,
1729 at the Reader/Parser interface.  Transforms are inserted by the Reader
1730 into the Transformer's queue, where non-standard elements are
1731 converted.  Once past the Transformer, no variation from the standard
1732 Docutils doctree is possible.
1734 An example is the Python Source Reader, which will use interpreted
1735 text extensively.  The default role will be "Python identifier", which
1736 will be further interpreted by namespace context into <class>,
1737 <method>, <module>, <attribute>, etc. elements (see pysource.dtd),
1738 which will be transformed into standard hyperlink references, which
1739 will be processed by the various Writers.  No Writer will need to have
1740 any knowledge of the Python-Reader origin of these elements.
1742 * Add explicit interpreted text roles for the rest of the implicit
1743   inline markup constructs: named-reference, anonymous-reference,
1744   footnote-reference, citation-reference, substitution-reference,
1745   target, uri-reference (& synonyms).
1747 * Add directives for each role as well?  This would allow indirect
1748   nested markup::
1750       This text contains |nested inline markup|.
1752       .. |nested inline markup| emphasis::
1754          nested ``inline`` markup
1756 * Implement roles:
1758   - "_`raw-wrapped`" (or "_`raw-wrap`"): Base role to wrap raw text
1759     around role contents.
1761     For example, the following reStructuredText source ... ::
1763         .. role:: red(raw-formatting)
1764            :prefix:
1765                :html: <font color="red">
1766                :latex: {\color{red}
1767            :suffix:
1768                :html: </font>
1769                :latex: }
1771         colored :red:`text`
1773     ... will yield the following document fragment::
1775         <paragraph>
1776             colored
1777             <inline classes="red">
1778                 <raw format="html">
1779                     <font color="red">
1780                 <raw format="latex">
1781                     {\color{red}
1782                 <inline classes="red">
1783                     text
1784                 <raw format="html">
1785                     </font>
1786                 <raw format="latex">
1787                     }
1789     Possibly without the intermediate "inline" node.
1791   - _`"acronym" and "abbreviation"`: Associate the full text with a
1792     short form.  Jason Diamond's description:
1794         I want to translate ```reST`:acronym:`` into ``<acronym
1795         title='reStructuredText'>reST</acronym>``.  The value of the
1796         title attribute has to be defined out-of-band since you can't
1797         parameterize interpreted text.  Right now I have them in a
1798         separate file but I'm experimenting with creating a directive
1799         that will use some form of reST syntax to let you define them.
1801     Should Docutils complain about undefined acronyms or
1802     abbreviations?
1804     What to do if there are multiple definitions?  How to
1805     differentiate between CSS (Content Scrambling System) and CSS
1806     (Cascading Style Sheets) in a single document?  David Priest
1807     responds,
1809         The short answer is: you don't.  Anyone who did such a thing
1810         would be writing very poor documentation indeed.  (Though I
1811         note that `somewhere else in the docs`__, there's mention of
1812         allowing replacement text to be associated with the
1813         abbreviation.  That takes care of the duplicate
1814         acronyms/abbreviations problem, though a writer would be
1815         foolish to ever need it.)
1817         __ `inline parameter syntax`_
1819     How to define the full text?  Possibilities:
1821     1. With a directive and a definition list? ::
1823            .. acronyms::
1825               reST
1826                   reStructuredText
1827               DPS
1828                   Docstring Processing System
1830        Would this list remain in the document as a glossary, or would
1831        it simply build an internal lookup table?  A "glossary"
1832        directive could be used to make the intention clear.
1833        Acronyms/abbreviations and glossaries could work together.
1835        Then again, a glossary could be formed by gathering individual
1836        definitions from around the document.
1838     2. Some kind of `inline parameter syntax`_? ::
1840            `reST <reStructuredText>`:acronym: is `WYSIWYG <what you
1841            see is what you get>`:acronym: plaintext markup.
1843        .. _inline parameter syntax:
1844           rst/alternatives.html#parameterized-interpreted-text
1846     3. A combination of 1 & 2?
1848        The multiple definitions issue could be handled by establishing
1849        rules of priority.  For example, directive-based lookup tables
1850        have highest priority, followed by the first inline definition.
1851        Multiple definitions in directive-based lookup tables would
1852        trigger warnings, similar to the rules of `implicit hyperlink
1853        targets`__.
1855        __ ../ref/rst/restructuredtext.html#implicit-hyperlink-targets
1857     4. Using substitutions? ::
1859            .. |reST| acronym:: reST
1860               :text: reStructuredText
1862     What do we do for other formats than HTML which do not support
1863     tool tips?  Put the full text in parentheses?
1865   - "figure", "table", "listing", "chapter", "page", etc: See `object
1866     numbering and object references`_ above.
1868   - "glossary-term": This would establish a link to a glossary.  It
1869     would require an associated "glossary-entry" directive, whose
1870     contents could be a definition list::
1872         .. glossary-entry::
1874            term1
1875                definition1
1876            term2
1877                definition2
1879     This would allow entries to be defined anywhere in the document,
1880     and collected (via a "glossary" directive perhaps) at one point.
1883 Doctree pruning
1884 ---------------
1886 The number of doctree nodes can be reduced by "normalizing" some related
1887 nodes. This makes the document model and the writers somewhat simpler.
1889 * The "doctest" element should go away.  The construct could simply be
1890   a front-end to generic literal blocks.  We could immediately (in 0.7)
1891   remove the doctest node from the doctree, but leave the
1892   syntax in reST.  The reST parser could represent doctest blocks as
1893   literal blocks with a class attribute.  The syntax could be left in
1894   reST (for a set period of time?).
1896 * "Normalize" special admonitions (note, hint, warning, ...) during parsing
1897   (similar to _`transforms.writer_aux.Admonitions`). There is no need to
1898   keep them as distinct elements in the doctree specification.
1900   Keep the special admonition directives in reStructuredText syntax?
1903 Unimplemented Transforms
1904 ========================
1906 * _`Footnote & Citation Gathering`
1908   Collect and move footnotes & citations to the end of a document or the
1909   place of a "footnotes" or "citations" directive
1910   (see `<./ref/rst/directives.html>_`)
1912   Footnotes:
1913     Collect all footnotes that are referenced in the document before the
1914     directive (and after an eventually preceding ``.. footnotes::``
1915     directive) and insert at this place.
1917     Allows "endnotes" at a configurable place.
1919   Citations:
1920     Collect citations that are referenced ...
1922     Citations can be:
1924     a) defined in the document as citation elements
1926     b) auto-generated from entries in a bibliographic database.
1928        + based on bibstuff_?
1929        + also have a look at
1931          * CrossTeX_, a backwards-compatible, improved bibtex
1932            re-implementation in Python (including HTML export).
1933            (development stalled since 2 years)
1935          * Pybtex_,a drop-in replacement for BibTeX written in Python.
1937            * BibTeX styles & (experimental) pythonic style API.
1938            * Database in BibTeX, BibTeXML and YAML formats.
1939            * full Unicode support.
1940            * Write to TeX, HTML and plain text.
1942          * `Zotero plain <http://e6h.org/%7Eegh/hg/zotero-plain/>`__
1943            supports Zotero databases and CSL_ styles with Docutils with an
1944            ``xcite`` role.
1946          * `sphinxcontrib-bibtex`_ Sphinx extension with "bibliography"
1947            directive and "cite" role supporting BibTeX databases.
1949          * `Modified rst2html
1950            <http://www.loria.fr/~rougier/coding/article/rst2html.py>`__ by
1951            Nicolas Rougier.
1954     * Automatically insert a "References" heading?
1956 .. _CrossTeX: http://www.cs.cornell.edu/people/egs/crosstex/
1957 .. _Pybtex:   http://pybtex.sourceforge.net/
1958 .. _CSL: http://www.citationstyles.org/
1959 .. _sphinxcontrib-bibtex: http://sphinxcontrib-bibtex.readthedocs.org/
1961 * _`Reference Merging`
1963   When merging two or more subdocuments (such as docstrings),
1964   conflicting references may need to be resolved.  There may be:
1966   * duplicate reference and/or substitution names that need to be made
1967     unique; and/or
1968   * duplicate footnote numbers that need to be renumbered.
1970   Should this be done before or after reference-resolving transforms
1971   are applied?  What about references from within one subdocument to
1972   inside another?
1974 * _`Document Splitting`
1976   If the processed document is written to multiple files (possibly in
1977   a directory tree), it will need to be split up.  Internal references
1978   will have to be adjusted.
1980   (HTML only?  Initially, yes.  Eventually, anything should be
1981   splittable.)
1983   Ideas:
1985   - Insert a "destination" attribute into the root element of each
1986     split-out document, containing the path/filename.  The Output
1987     object or Writer will recognize this attribute and split out the
1988     files accordingly.  Must allow for common headers & footers,
1989     prev/next, breadcrumbs, etc.
1991   - Transform a single-root document into a document containing
1992     multiple subdocuments, recursively.  The content model of the
1993     "document" element would have to change to::
1995         <!ELEMENT document
1996             ( (title, subtitle?)?,
1997               decoration?,
1998               (docinfo, transition?)?,
1999               %structure.model;,
2000               document* )>
2002     (I.e., add the last line -- 0 or more document elements.)
2004     Let's look at the case of hierarchical (directories and files)
2005     HTML output.  Each document element containing further document
2006     elements would correspond to a directory (with an index.html file
2007     for the content preceding the subdocuments).  Each document
2008     element containing no subdocuments (i.e., structure model elements
2009     only) corresponds to a concrete file with no directory.
2011     The natural transform would be to map sections to subdocuments,
2012     but possibly only a given number of levels deep.
2014 * _`Navigation`
2016   If a document is split up, each segment will need navigation links:
2017   parent, children (small TOC), previous (preorder), next (preorder).
2018   Part of `Document Splitting`_?
2020 * _`List of System Messages`
2022   The ``system_message`` elements are inserted into the document tree,
2023   adjacent to the problems themselves where possible.  Some (those
2024   generated post-parse) are kept until later, in
2025   ``document.messages``, and added as a special final section,
2026   "Docutils System Messages".
2028   Docutils could be made to generate hyperlinks to all known
2029   system_messages and add them to the document, perhaps to the end of
2030   the "Docutils System Messages" section.
2032   Fred L. Drake, Jr. wrote:
2034       I'd like to propose that both parse- and transformation-time
2035       messages are included in the "Docutils System Messages" section.
2036       If there are no objections, I can make the change.
2038   The advantage of the current way of doing things is that parse-time
2039   system messages don't require a transform; they're already in the
2040   document.  This is valuable for testing (unit tests,
2041   tools/quicktest.py).  So if we do decide to make a change, I think
2042   the insertion of parse-time system messages ought to remain as-is
2043   and the Messages transform ought to move all parse-time system
2044   messages (remove from their originally inserted positions, insert in
2045   System Messages section).
2047 * _`Index Generation`
2050 HTML Writer
2051 ===========
2053 * Make it easier to find out fragment names (#foo-bar) of ``_`inline
2054   targets```.  Currently you have to either look at the source or
2055   guess the fragment.
2057   For example, we could add support for self-referencing targets
2058   (i.e. inline targets would [unobtrusively] link to themselves, so
2059   that you can just click them and then copy the address).  Or we
2060   could add support for titles that display the fragment name (as in
2061   <http://subversion.tigris.org/mailing-list-guidelines.html>; just
2062   hover the paragraphs).
2064   Either way it should be optional and deactivated by default.
2066   This would be useful for documents like Docutils' bug list or to-do
2067   list.
2069 * Make the _`list compacting` logic more generic: For example, allow
2070   for literal blocks or line blocks inside of compact list items.
2072   This is not implementable as long as list compacting is done by
2073   omitting ``<p>`` tags.  List compacting would need to be done by
2074   adjusting CSS margins instead.
2076 * Idea for field-list rendering: hanging indent::
2078       Field name (bold): First paragraph of field body begins
2079           with the field name inline.
2081           If the first item of a field body is not a paragraph,
2082           it would begin on the following line.
2084 * Add more support for <link> elements, especially for navigation
2085   bars.
2087   The framework does not have a notion of document relationships, so
2088   probably raw.destination_ should be used.
2090   We'll have framework support for document relationships when support
2091   for `multiple output files`_ is added.  The HTML writer could
2092   automatically generate <link> elements then.
2094   .. _raw.destination: misc.raw_
2096 * Base list compaction on the spacing of source list?  Would require
2097   parser support.  (Idea: fantasai, 16 Dec 2002, doc-sig.)
2099 * Add a tool tip ("title" attribute?) to footnote back-links
2100   identifying them as such.  Text in Docutils language module.
2103 PEP/HTML Writer
2104 ===============
2106 * Remove the generic style information (duplicated from html4css1.css)
2107   from pep.css to avoid redundancy.
2109   Needs support for multiple stylesheets in the PEP writer
2110   (is this inherited from HTML?).
2113 S5/HTML Writer
2114 ==============
2116 * Add a way to begin an untitled slide.
2118 * Add a way to begin a new slide, continuation, using the same title
2119   as the previous slide?  (Unnecessary?)  You need that if you have a
2120   lot of items in one section which don't fit on one slide.
2122   Maybe either this item or the previous one can be realized using
2123   transitions.
2125 * Have a timeout on incremental items, so the colour goes away after 1
2126   second.
2128 * Add an empty, black last slide (optionally).  Currently the handling
2129   of the last slide is not very nice, it re-cycles through the
2130   incremental items on the last slide if you hit space-bar after the
2131   last item.
2133 * Add a command-line option to disable advance-on-click.
2135 * Add a speaker's master document, which would contain a small version
2136   of the slide text with speaker's notes interspersed.  The master
2137   document could use ``target="whatever"`` to direct links to a
2138   separate window on a second monitor (e.g., a projector).
2140   .. Note:: This item and the following items are partially
2141      accomplished by the S5 1.2 code (currently in alpha), which has
2142      not yet been integrated into Docutils.
2144 * Speaker's notes -- how to intersperse?  Could use reST comments
2145   (".."), but make them visible in the speaker's master document.  If
2146   structure is necessary, we could use a "comment" directive (to avoid
2147   nonsensical DTD changes, the "comment" directive could produce an
2148   untitled topic element).
2150   The speaker's notes could (should?) be separate from S5's handout
2151   content.
2153 * The speaker's master document could use frames for easy navigation:
2154   TOC on the left, content on the right.
2156   - It would be nice if clicking in the TOC frame simultaneously
2157     linked to both the speaker's notes frame and to the slide window,
2158     synchronizing both.  Needs JavaScript?
2160   - TOC would have to be tightly formatted -- minimal indentation.
2162   - TOC auto-generated, as in the PEP Reader.  (What if there already
2163     is a "contents" directive in the document?)
2165   - There could be another frame on the left (top-left or bottom-left)
2166     containing a single "Next" link, always pointing to the next slide
2167     (synchronized, of course).  Also "Previous" link?  FF/Rew go to
2168     the beginning of the next/current parent section?  First/Last
2169     also?  Tape-player-style buttons like ``|<<  <<  <  >  >>  >>|``?
2171 Epub/HTML Writer
2172 ================
2174 Add epub as an output format.
2176 Pack the output of a HTML writer and supporting files (e.g. images)
2177 into one single epub document.
2179   epub is an open file format for ebooks based on HTML, specified by the
2180   `International Digital Publishing Forum`_. Thus, documents in epub
2181   format are suited to be read with `electronic reading devices`_.
2183 There are with links to `ePub writers`_
2184 (two 3rd party implementations and Sphinx) in the Docutils link list.
2186 .. _ePub writers: ../user/links.html#ePub
2187 .. _International Digital Publishing Forum: http://www.idpf.org/
2188 .. _electronic reading devices:
2189    http://en.wikipedia.org/wiki/List_of_e-book_readers
2192 LaTeX writer
2193 ============
2195 Also see the Problems__ section in the `latex writer documentation`_.
2197 __ ../user/latex.html#problems
2199 .. _latex writer documentation: ../user/latex.html
2201 .. _latex-variants:
2202    ../../../sandbox/latex-variants/README.html
2204 Bug fixes
2205 ---------
2207 * A multirow cell in a table expects empty cells in the spanned rows while
2208   the doctree contains only the remaining cells ("Exchange Table Model", see
2209   docs/ref/soextblx.dtd).
2211   Needs bookkeeping of "open" multirow cells (how many how long) and
2212   insertion of additional '&'s.
2214   See `<../../test/functional/input/data/latex.txt>`__
2216 * Too deeply nested lists fail: generate a warning and provide
2217   a workaround.
2219 * Spaces in inline literal text::
2221     Now note    the
2222     spacing    between the    words of    this sentence    (words
2223     should    be grouped    in pairs).
2225   Discuss the desired behaviour and implement a consistent one.
2227 * An enumerated list in the docinfo fails (\newcounter definition inside
2228   tabularx).
2230 * File names of included graphics (see also `grffile` package).
2232 Generate clean and configurable LaTeX source
2233 ----------------------------------------------
2235 * Check the generated source with package `nag`.
2237 Configurable placement of figure and table floats
2238 `````````````````````````````````````````````````
2240 * Special class argument to individually place figures?
2242   Either:
2244     placement-<optional arg>  -> \figure[<optional arg>]{...}
2246   e.g. ``.. class::  placement-htb``,
2248   or more verbose:
2250   :H: place-here
2251   :h: place-here-if-possible
2252   :t: place-top
2253   :b: place-bottom
2254   :p: place-on-extra-page
2256   e.g.: ``.. class:: place-here-if-possible place-top place-bottom``
2258   Maybe support both variants?
2261 LaTeX constructs and packages instead of re-implementations
2262 ```````````````````````````````````````````````````````````
2264 Which packages do we want to use?
2266   + base and "recommended" packages
2268     (packages that should be in a "reasonably sized and reasonably modern
2269     LaTeX installation like the `texlive-latex-recommended` Debian package,
2270     say):
2272   + No "fancy" or "exotic" requirements.
2274   + pointers to advanced packages and their use in the `latex writer
2275     documentation`_.
2277 * ``alltt`` environment for literal block.
2279 * footnotes
2281   + True footnotes with LaTeX auto-numbering (as option ``--latex-footnotes``)
2282     (also for target-footnotes):
2284     - attach footnote text to footnote-symobol node
2285     - write \footnote{<footnote text>}
2286     - consider cases where LaTeX does not support footnotes
2287       (inside tables, headings, ...)?
2288     - consider multiple footnote refs to common footnote text.
2290     .. Quote:
2292      If the symbol you want is not one of the ones listed, you'll need to
2293      redefine ``\@fnsymbol`` and add it, e.g. perhaps like::
2295       \def\@fnsymbol#1{\ifcase#1\hbox{}\or *\or \dagger\or \ddagger\or
2296       \mathchar "278\or \mathchar "27B\or \|\or **\or \dagger\dagger \or
2297       \ddagger\ddagger \or \mathchar"27C \else\@ctrerr\fi\relax}
2299      which would allow \symbolfootnote[10]{footnote} to have a club as its
2300      mark.
2302   + document customization (links to how-to and packages):
2304   .. Footnote packages:
2306      :footnote: texlive-latex-recommended % savenotes environment
2307      :footmisc: texlive-latex-extra       % formatting options
2308      :manyfoot: texlive-latex-extra
2309      :bigfoot: texlive-latex-extra
2310      :perpage: texlive-latex-extra
2311      :ftnxtra: new on CTAN
2312                fixes the issue of footnote inside \caption{},
2313                tabular environment and \section{} like commands.
2316      German tutorial:
2317      http://www2.informatik.hu-berlin.de/~ahamann/studies/footnotes.pdf
2319   .. Footnote FAQs:
2321      `Footnotes whose texts are identical
2322      <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=repfootnote>`__
2324      * label per hand or use footmisc
2326      `More than one sequence of footnotes
2327      <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=multfoot>`__
2329      * manyfoot, bigfoot
2331      `Footnotes in tables
2332      <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=footintab>`__
2334      * `tabularx` and longtable allow footnotes.
2335      * `footnote` provides a "savenotes" environment which collects all
2336        footnotes and emits them at ``end{savenotes}``
2338      `Footnotes in LaTeX section headings
2339      <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ftnsect>`__
2341      * Take advantage of the fact that the mandatory argument doesn't
2342        move if the optional argument is present::
2344            \section[title] {title\footnote{title ftnt}}
2346      * Use the footmisc package, with package option stable - this modifies
2347        footnotes so that they softly and silently vanish away if used in a
2348        moving argument.
2350      * Use ftnxtra.
2352      `Footnotes numbered per page
2353      <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=footnpp>`__
2355      * perpage provides a general mechanism for resetting counters per page
2356      * footmisc provides a package option perpage
2358 * use `eqlist` or `enumitem` (texlive-latex-extra) for field-lists?
2360 * ``--use-latex-when-possible`` »super option« that would set the
2361   following::
2363       --no-section-numbering
2364       --use-latex-toc
2365       --use-latex-docinfo
2366       --use-latex-abstract
2367       --use-latex-footnotes
2368       --use-latex-citations
2370    ? (My preference is to default to use-latex-* whenever possible [GM])
2373 Default layout
2374 --------------
2376 * Use italic instead of slanted for titlereference?
2378 * Start a new paragraph after lists (as currently)
2379   or continue (no blank line in source, no parindent in output)?
2381   Overriding:
2383   * continue if the `compound paragraph`_ directive is used, or
2384   * force a new paragraph with an empty comment.
2386 * Sidebar handling (environment with `framed`, `marginnote`, `wrapfig`,
2387   ...)?
2389 * Use optionlist for docinfo?
2391 * Keep literal-blocks together on a page, avoid pagebreaks.
2393   Failed experiments up to now: samepage, minipage, pagebreak 1 to 4 before
2394   the block.
2396   Should be possible with ``--literal-block-env==lstlistings`` and some
2397   configuration...
2399 * More space between title and subtitle? ::
2401      -  \\ % subtitle%
2402      +  \\[0.5em] % subtitle%
2404 .. _PSNFSS documentation:
2405    http://mirror.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf
2406 .. _compound paragraph:
2407    ../ref/rst/directives.html#compound-paragraph
2408 .. _fixltx2e:
2409    http://mirror.ctan.org/help/Catalogue/entries/fixltx2e.html
2411 Tables
2412 ``````
2414 * Improve/simplify logic to set the column width in the output.
2416   + Assumed reST line length for table width setting configurable, or
2417   + use `ltxtable` (a combination of `tabularx` (auto-width) and
2418     `longtable` (page breaks)), or
2419   + use tabularx column type ``X`` and let LaTeX decide width, or
2420   + use tabulary_?
2422   .. _tabulary:
2423      http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=tabulary
2425 * From comp.text.tex (13. 4. 2011):
2427     When using fixed width columns, you should ensure that the total
2428     width does not exceed \linewidth: if the first column is p{6cm}
2429     the second one should be p{\dimexpr\linewidth-6cm-4\tabcolsep}
2430     because the glue \tabcolsep is added twice at every column edge.
2431     You may also consider to set \tabcolsep to a different value...
2433 * csv-tables do not have a colwidth.
2435 * Add more classes or options, e.g. for
2437   + column width set by latex,
2438   + horizontal alignment and rules.
2439   + long table vs. tabular (see next item).
2441 * Use tabular instead of longtable for tables in legends or generally
2442   inside a float?
2444   Alternatively, default to tabular and use longtable only if specified
2445   by config setting or class argument (analogue to booktable)?
2447 * Table heads and footer for longtable (firstpage lastpage ..)?
2449 * In tools.txt the option tables right column, there should be some more
2450   spacing between the description and the next paragraph "Default:".
2452 * Paragraph separation in tables is hairy.
2453   see http://www.tex.ac.uk/cgi-bin/texfaq2html?label=struttab
2455   - The strut solution did not work.
2456   - setting extrarowheight added ad top of row not between paragraphs in
2457     a cell. ALTHOUGH i set it to 2pt because, text is too close to the topline.
2458   - baselineskip/stretch does not help.
2460 * Should there be two hlines after table head and on table end?
2462 * Place titled tables in a float ('table' environment)?
2464   The 'table', 'csv-table', and 'list-table' directives support an (optional)
2465   table title. In analogy to the 'figure' directive this should map to a
2466   table float.
2468 Image and figure directives
2469 ```````````````````````````
2471 * compare the test case in:
2473   + `<../../test/functional/input/data/standard.txt>`__
2474   + `<../../test/functional/expected/standalone_rst_html4css1.html>`__
2475   + `<../../test/functional/expected/standalone_rst_latex.tex>`__
2477 * According to the HTML standard
2478   http://www.w3.org/TR/html4/struct/objects.html#adef-align-IMG a right- or
2479   left-aligned image should be floated alongside the paragraph.
2481   + Use this default also for LaTeX?
2483   + Wrap text around figures/images with class argument "wrap"
2484     (like the odt writer)?
2486   Use `wrapfig` (or other recommended) package.
2488 * support more graphic formats (especially SVG, the only standard
2489   vector format for HTML)
2491   There is a `SWF package`_ at CTAN.
2493 .. _SWF package:
2494    http://mirror.ctan.org/macros/latex/contrib/flashmovie
2497 Missing features
2498 ----------------
2500 * support "figwidth" argument for figures.
2502   As the 'figwidth' argument is still ignored and the "natural width" of
2503   a figure in LaTeX is 100 % of the text width, setting the 'align'
2504   argument has currently no effect on the LaTeX output.
2507 * Let `meta` directive insert PDF-keywords into header?
2509 * Multiple author entries in docinfo (same thing as in html).
2510   (already solved?)
2512 * Consider supporting the "compact" option and class argument (from
2513   rst2html) as some lists look better compact and others need the space.
2515 * Better citation support
2516   (see `Footnote & Citation Gathering`_).
2518 * If ``use-latex-citations`` is used, a bibliography is inserted right at the
2519   end of the document.
2521   Put in place of the to-be-implemented "citations" directive
2522   (see `Footnote & Citation Gathering`_).
2525 Unicode to LaTeX
2526 ````````````````
2528 The `LyX <http://www.lyx.org>`_ document processor has a comprehensive
2529 Unicode to LaTeX conversion feature with a file called ``unicodesymbols``
2530 that lists LaTeX counterparts for a wide range of Unicode characters.
2532 * Use this in the LaTeXTranslator?
2533   Think of copyright issues!
2535 * The "ucs" package has many translations in ...doc/latex/ucs/config/
2537 * The bibstuff_ tool ships a `latex_codec` Python module!
2539 .. _bibstuff: http://code.google.com/p/bibstuff/
2541 Allow choice between utf8 (standard) and utf8x (extended) encodings
2542 ```````````````````````````````````````````````````````````````````
2544 * Allow the user to select *utf8* or *utf8x* LaTeX encoding. (Docutil's
2545   output encoding becomes LaTeX's input encoding.)
2547 The `ucs` package provides extended support for UTF-8 encoding in LaTeX
2548 via the `inputenc`-option ``utf8x``.  It is, however, a non-standard
2549 extension and no longer developed.
2551 Ideas:
2552   a) Python has 4 names for the UTF-8 encoding (``utf_8, U8, UTF, utf8``)
2553      give a special meaning to one of the aliases,
2555   b) scan "stylesheets" and "latex-preamble" options and use ``utf8x``
2556      if it contains ``ucs``
2558 XeTeX writer
2559 ````````````
2561 * Glyphs missing in the font are left out in the PDF without warning
2562   (e.g. ⇔ left-right double arrow in the functional test output).
2564 * Disable word-wrap (hyphenation) in literal text locally with
2565   ``providecommand{\nohyphenation}{\addfontfeatures{HyphenChar=None}}``?
2568 problematic URLs
2569 ````````````````
2571 * ^^ LaTeX's special syntax for characters results in "strange" replacements
2572   (both with \href and \url).
2574   `file with ^^ <../strange^^name>`__:
2575   `<../strange^^name>`__
2577 * Unbalanced braces, { or }, will fail (both with \href and \url)::
2579     `file with { <../strange{name>`__
2580     `<../strange{name>`__
2582 Currently, a warning is written to the error output stream.
2584 For correct printing, we can
2586 * use the \href command with "normal" escaped name argument, or
2587 * define a url-command in the preamble ::
2589     \urldef{\fragileURLi}\nolinkurl{myself%node@gateway.net}
2591 but need to find a way to insert it as href argument.
2593 The following fails::
2595     \href{http://www.w3.org/XML/Schema^^dev}{\fragileURLi}
2597 Use %-replacement like http://nowhere/url_with%28parens%29 ?
2599 -> does not work for file paths (with pdflatex and xpdf).
2602 add-stylesheet option
2603 `````````````````````
2605 From http://article.gmane.org/gmane.text.docutils.devel/3429/
2607 The problem is that since we have a default value, we have to
2608 differentiate between adding another stylesheet and replacing the
2609 default.  I suggest that the existing --stylesheet & --stylesheet-path
2610 options keep their semantics to replace the existing settings.  We
2611 could introduce new --add-stylesheet & --add-stylesheet-path options,
2612 which accumulate; further --stylesheet/--stylesheet-path options would
2613 clear these lists.  The stylesheet or stylesheet_path setting (only
2614 one may be set), plus the added_stylesheets and added_stylesheet_paths
2615 settings, describe the combined styles.
2617 For example, this run will have only one custom stylesheet:
2619     rstpep2html.py --stylesheet-path custom.css ...
2621 This run will use the default stylesheet, and the custom one:
2623     rstpep2html.py --add-stylesheet-path custom.css ...
2625 This run will use the default stylesheet, a custom local stylesheet,
2626 and an external stylesheet:
2628     rstpep2html.py --add-stylesheet-path custom.css \
2629         --add-stylesheet http://www.example.org/external.css ...
2631 This run will use only the second custom stylesheet:
2633     rstpep2html.py --add-stylesheet-path custom.css \
2634         --stylesheet-path second.css ...
2639 Front-End Tools
2640 ===============
2642 * What about if we don't know which Reader and/or Writer we are
2643   going to use?  If the Reader/Writer is specified on the
2644   command-line?  (Will this ever happen?)
2646   Perhaps have different types of front ends:
2648   a) _`Fully qualified`: Reader and Writer are hard-coded into the
2649      front end (e.g. ``pep2html [options]``, ``pysource2pdf
2650      [options]``).
2652   b) _`Partially qualified`: Reader is hard-coded, and the Writer is
2653      specified a sub-command (e.g. ``pep2 html [options]``,
2654      ``pysource2 pdf [options]``).  The Writer is known before option
2655      processing happens, allowing the OptionParser to be built
2656      dynamically.  Alternatively, the Writer could be hard-coded and
2657      the Reader specified as a sub-command (e.g. ``htmlfrom pep
2658      [options]``).
2660   c) _`Unqualified`: Reader and Writer are specified as subcommands
2661      (e.g. ``publish pep html [options]``, ``publish pysource pdf
2662      [options]``).  A single front end would be sufficient, but
2663      probably only useful for testing purposes.
2665   d) _`Dynamic`: Reader and/or Writer are specified by options, with
2666      defaults if unspecified (e.g. ``publish --writer pdf
2667      [options]``).  Is this possible?  The option parser would have
2668      to be told about new options it needs to handle, on the fly.
2669      Component-specific options would have to be specified *after*
2670      the component-specifying option.
2672   Allow common options before subcommands, as in CVS?  Or group all
2673   options together?  In the case of the `fully qualified`_
2674   front ends, all the options will have to be grouped together
2675   anyway, so there's no advantage (we can't use it to avoid
2676   conflicts) to splitting common and component-specific options
2677   apart.
2679 * Parameterize help text & defaults somehow?  Perhaps a callback?  Or
2680   initialize ``settings_spec`` in ``__init__`` or ``init_options``?
2682 * Disable common options that don't apply?
2683   (This should now be easier with ``frontend.filter_settings_spec``.)
2685 * Add ``--section-numbering`` command line option.  The "sectnum"
2686   directive should override the ``--no-section-numbering`` command
2687   line option then.
2689 * Create a single dynamic_ or unqualified_ front end that can be
2690   installed?
2694    Local Variables:
2695    mode: indented-text
2696    indent-tabs-mode: nil
2697    sentence-end-double-space: t
2698    fill-column: 70
2699    End: