Documentation update.
[docutils.git] / docs / dev / todo.txt
blobbb904c7f1d9432796335e504aafd2951e43b07ab
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 * Move to single source for Python 2 and Python 3.
75   (Cf. `Porting Python 2 Code to Python 3`_ and
76   `clean single-source support for Python 2/3`_.)
78   - Gradually phase out support for Python 2.4 and 2.5 first.
80   .. _Porting Python 2 Code to Python 3:
81       https://docs.python.org/3/howto/pyporting.html
82   .. _clean single-source support for Python 2/3:
83       http://python-future.org
85 * Encoding of command line arguments can only be guessed:
87   * try UTF-8/strict first, then try the locale's encoding with
88     strict error handling, then ASCII/replace?
90     UTF-8 is almost 100% safe to try first; false positives are rare,
91     The locale's encoding with strict error handling may be a
92     reasonable compromise, but any error would indicate that the
93     locale's encoding is inappropriate.  The only safe fallback is
94     ASCII/replace.
96   * Do not decode argv before option parsing but individual string
97     values?
99     +1  Allows for separate command-line vs. filesystem encodings,
100         respectively to keep file names encoded.
101     +1  Allows to configure command-line encoding in a config file,
102     -1  More complicated.
104   Cf. <http://thread.gmane.org/gmane.text.docutils.user/2890/focus=2957>.
106 * Improve handling on Windows:
108   - Get graphical installer.
109   - Make rst2html.py an .exe file using py2exe.
111 * .. _GUI:
113   The user interface is very difficult to use for most Windows users;
114   you can't really expect them to use the command line.  We need some
115   kind of GUI that can launch rst2html.py, and save the HTML output to
116   a file, and launch a browser.  What's important is that we get
117   settings to work with the GUI.  So we need some way to dynamically
118   generate a list of settings for the GUI.  The current settings_spec
119   for OptionParser doesn't seem to be usable for this for the
120   following reasons:
122   - It's biased toward the command line -- there are *two* options for
123     one boolean setting.
125   - You cannot have both a one-line description and a longer
126     description for tooltips/help-texts.
128   - It doesn't provide hints for the input type.  You cannot easily
129     infer the type of a setting from its validator, because any
130     component can add new validators.  In fact, it may be necessary to
131     have both a hint about the input type (e.g. string) and a
132     validator (valid ID), or it may be necessary to have a different
133     set of choices for the CLI (1, INFO, 2, ...) and for the GUI
134     (INFO, WARNING, ...).
136   - It's coupled to the OptionParser.  We want to be able to change
137     the underlying system without breaking everything.
139   - It's a bunch of primitive structures.  We want an extensible (thus
140     object-oriented) interface.
142   So we probably need to create a class for storing all the settings,
143   and auto-generate the OptionParser data from that.
145   I talked to Stephan Deibel about getting Docutils integrated into
146   Wing IDE.  He said it's possible, and he'd be willing to help.
147   There's a scripting interface to Wing, which we'd use.  We can
148   dynamically generate a list of preferences and not worry too much
149   about the rendering (from what I understood); Wing's whole GUI is
150   dynamic anyway.  The interface could be made usable for other GUIs.
151   For example, we could try to get option support for DocFactory.  //
152   FW
154 * Allow different report levels for STDERR and system_messages inside
155   the document?
157 * Change the docutils-update script (in sandbox/infrastructure), to
158   support arbitrary branch snapshots.
160 * Move some general-interest sandboxes out of individuals'
161   directories, into subprojects?
163 * Add option for file (and URL) access restriction to make Docutils
164   usable in Wikis and similar applications.
166   2005-03-21: added ``file_insertion_enabled`` & ``raw_enabled``
167   settings.  These partially solve the problem, allowing or disabling
168   **all** file accesses, but not limited access.
170 * Configuration file handling needs discussion:
172   - There should be some error checking on the contents of config
173     files.  How much checking should be done?  How loudly should
174     Docutils complain if it encounters an error/problem?
176   - Docutils doesn't complain when it doesn't find a configuration
177     file supplied with the ``--config`` option.  Should it?  (If yes,
178     error or warning?)
180 * Internationalization:
182   - I18n needs refactoring, the language dictionaries are difficult to
183     maintain.  Maybe have a look at gettext or similar tools.
185     (This would make a nice Google Summer of Code project)
187   - Language modules: in accented languages it may be useful to have
188     both accented and unaccented entries in the
189     ``bibliographic_fields`` mapping for versatility.
191   - Add a "--strict-language" option & setting: no English fallback
192     for language-dependent features.
194     Make this the default for output (as opposed to input)?
195     Throw an error with a helpfull message, e.g.
197       Default "contents" title for language %s missing, please specify
198       an explicit title.
200     or
202      "attention" title for language %s missing, please use a generic
203      admonition with explicit title.
205   - Add internationalization to _`footer boilerplate text` (resulting
206     from "--generator", "--source-link", and "--date" etc.), allowing
207     translations.
210 * Add validation?  See http://pytrex.sourceforge.net, RELAX NG, pyRXP.
212 * In ``docutils.readers.get_reader_class`` (& ``parsers`` &
213   ``writers`` too), should we be importing "standalone" or
214   "docutils.readers.standalone"?  (This would avoid importing
215   top-level modules if the module name is not in docutils/readers.
216   Potential nastiness.)
218 * Perhaps store a _`name-to-id mapping file`?  This could be stored
219   permanently, read by subsequent processing runs, and updated with
220   new entries.  ("Persistent ID mapping"?)
222 * Perhaps the ``Component.supports`` method should deal with
223   individual features ("meta" etc.) instead of formats ("html" etc.)?
225 * Think about _`large documents` made up of multiple subdocument
226   files.  Issues: continuity (`persistent sequences`_ above),
227   cross-references (`name-to-id mapping file`_ above and `targets in
228   other documents`_ below), splitting (`document splitting`_ below).
230   When writing a book, the author probably wants to split it up into
231   files, perhaps one per chapter (but perhaps even more detailed).
232   However, we'd like to be able to have references from one chapter to
233   another, and have continuous numbering (pages and chapters, as
234   applicable).  Of course, none of this is implemented yet.  There has
235   been some thought put into some aspects; see `the "include"
236   directive`__ and the `Reference Merging`_ transform below.
238   When I was working with SGML in Japan, we had a system where there
239   was a top-level coordinating file, book.sgml, which contained the
240   top-level structure of a book: the <book> element, containing the
241   book <title> and empty component elements (<preface>, <chapter>,
242   <appendix>, etc.), each with filename attributes pointing to the
243   actual source for the component.  Something like this::
245       <book id="bk01">
246       <title>Title of the Book</title>
247       <preface inrefid="pr01"></preface>
248       <chapter inrefid="ch01"></chapter>
249       <chapter inrefid="ch02"></chapter>
250       <chapter inrefid="ch03"></chapter>
251       <appendix inrefid="ap01"></appendix>
252       </book>
254   (The "inrefid" attribute stood for "insertion reference ID".)
256   The processing system would process each component separately, but
257   it would recognize and use the book file to coordinate chapter and
258   page numbering, and keep a persistent ID to (title, page number)
259   mapping database for cross-references.  Docutils could use a similar
260   system for large-scale, multipart documents.
262   __ ../ref/rst/directives.html#including-an-external-document-fragment
264   Aahz's idea:
266       First the ToC::
268           .. ToC-list::
269               Introduction.txt
270               Objects.txt
271               Data.txt
272               Control.txt
274       Then a sample use::
276           .. include:: ToC.txt
278           As I said earlier in chapter :chapter:`Objects.txt`, the
279           reference count gets increased every time a binding is made.
281       Which produces::
283           As I said earlier in chapter 2, the
284           reference count gets increased every time a binding is made.
286       The ToC in this form doesn't even need to be references to actual
287       reST documents; I'm simply doing it that way for a minimum of
288       future-proofing, in case I do want to add the ability to pick up
289       references within external chapters.
291   Perhaps, instead of ToC (which would overload the "contents"
292   directive concept already in use), we could use "manifest".  A
293   "manifest" directive might associate local reference names with
294   files::
296       .. manifest::
297          intro: Introduction.txt
298          objects: Objects.txt
299          data: Data.txt
300          control: Control.txt
302   Then the sample becomes::
304       .. include:: manifest.txt
306       As I said earlier in chapter :chapter:`objects`, the
307       reference count gets increased every time a binding is made.
309 * Add support for _`multiple output files` and _`generic data
310   handling`:
312   It should be possible for a component to **emit or reference** data
313   to be either **included or referenced** in the output document.
314   Examples of such data are stylesheets or images.
316   For this, we need a "data" object which stores the data either
317   inline or by referring to a file.  The Docutils framework is
318   responsible for either:
320   * storing the data in the appropriate location (e.g. in the
321     directory of the output file, or in a user-specified directory)
322     and providing the paths of the stored files to the writer, *or*
324   * providing the data itself to the writer so that it can be embedded
325     in the output document.
327   This approach decouples data handling from the data source (which
328   can either be embedded or referenced) and the destination (which can
329   either be embedded or referenced as well).
331   See <http://article.gmane.org/gmane.text.docutils.devel/3631>.
333 * Add testing for Docutils' front end tools?
335 * Publisher: "Ordinary setup" shouldn't requre specific ordering; at
336   the very least, there ought to be error checking higher up in the
337   call chain.  [Aahz]
339   ``Publisher.get_settings`` requires that all components be set up
340   before it's called.  Perhaps the I/O *objects* shouldn't be set, but
341   I/O *classes*.  Then options are set up (``.set_options``), and
342   ``Publisher.set_io`` (or equivalent code) is called with source &
343   destination paths, creating the I/O objects.
345   Perhaps I/O objects shouldn't be instantiated until required.  For
346   split output, the Writer may be called multiple times, once for each
347   doctree, and each doctree should have a separate Output object (with
348   a different path).  Is the "Builder" pattern applicable here?
350 * Perhaps I/O objects should become full-fledged components (i.e.
351   subclasses of ``docutils.Component``, as are Readers, Parsers, and
352   Writers now), and thus have associated option/setting specs and
353   transforms.
355 * Multiple file I/O suggestion from Michael Hudson: use a file-like
356   object or something you can iterate over to get file-like objects.
358 * Add an "--input-language" option & setting?  Specify a different
359   language module for input (bibliographic fields, directives) than
360   for output.  The "--language" option would set both input & output
361   languages.
363 * Auto-generate reference tables for language-dependent features?
364   Could be generated from the source modules.  A special command-line
365   option could be added to Docutils front ends to do this.  (Idea from
366   Engelbert Gruber.)
368 * Enable feedback of some kind from internal decisions, such as
369   reporting the successful input encoding.  Modify runtime settings?
370   System message?  Simple stderr output?
372 * Rationalize Writer settings (HTML/LaTeX/PEP) -- share settings.
374 * Add an "--include file" command-line option (config setting too?),
375   equivalent to ".. include:: file" as the first line of the doc text?
376   Especially useful for character entity sets, text transform specs,
377   boilerplate, etc.
379 * Parameterize the Reporter object or class?  See the `2004-02-18
380   "rest checking and source path"`_ thread.
382   .. _2004-02-18 "rest checking and source path":
383      http://thread.gmane.org/gmane.text.docutils.user/1112
385 * Add a "disable_transforms" setting?  And a dummy Writer subclass
386   that does nothing when its .write() method is called?  Would allow
387   for easy syntax checking.  See the `2004-02-18 "rest checking and
388   source path"`_ thread.
390 * Add a generic meta-stylesheet mechanism?  An external file could
391   associate style names ("class" attributes) with specific elements.
392   Could be generalized to arbitrary output attributes; useful for HTML
393   & XMLs.  Aahz implemented something like this in
394   sandbox/aahz/Effective/EffMap.py.
396 * .. _classes for table cells:
398   William Dode suggested that table cells be assigned "class"
399   attributes by columns, so that stylesheets can affect text
400   alignment.  Unfortunately, there doesn't seem to be a way (in HTML
401   at least) to leverage the "colspec" elements (HTML "col" tags) by
402   adding classes to them.  The resulting HTML is very verbose::
404       <td class="col1">111</td>
405       <td class="col2">222</td>
406       ...
408   At the very least, it should be an option.  People who don't use it
409   shouldn't be penalized by increases in their HTML file sizes.
411   Table rows could also be assigned classes (like odd/even).  That
412   would be easier to implement.
414   How should it be implemented?
416   * There could be writer options (column classes & row classes) with
417     standard values.
419   * The table directive could grow some options.  Something like
420     ":cell-classes: col1 col2 col3" (either must match the number of
421     columns, or repeat to fill?)  and ":row-classes: odd even" (repeat
422     to fill; body rows only, or header rows too?).
424   Probably per-table directive options are best.  The "class" values
425   could be used by any writer, and applying such classes to all tables
426   in a document with writer options is too broad.
428 * Add file-specific settings support to config files, like::
430       [file index.txt]
431       compact-lists: no
433   Is this even possible?  Should the criterion be the name of the
434   input file or the output file?  Alternative (more explicit) syntax::
436       [source_file index.txt]
437       ...
439       [dest_file index.html]
440       ...
442   Or rather allow settings configuration from the rst source file
443   (see misc.settings_ directive)?
445 * The "validator" support added to OptionParser is very similar to
446   "traits_" in SciPy_.  Perhaps something could be done with them?
447   (Had I known about traits when I was implementing docutils.frontend,
448   I may have used them instead of rolling my own.)
450   .. _traits: http://code.enthought.com/traits/
451   .. _SciPy: http://www.scipy.org/
453 * tools/buildhtml.py: Extend the --prune option ("prune" config
454   setting) to accept file names (generic path) in addition to
455   directories (e.g. --prune=docs/user/rst/cheatsheet.txt, which should
456   *not* be converted to HTML).
458 * Add support for _`plugins`.
460 * _`Config directories`: Currently, ~/.docutils, ./docutils.conf/, &
461   /etc/docutils.conf are read as configuration files.  Proposal: allow
462   ~/.docutils to be a a configuration *directory*, along with
463   /etc/docutils/ and ./docutils.conf/.  Within these directories,
464   check for config.txt files.  We can also have subdirectories here,
465   for plugins, S5 themes, components (readers/writers/parsers) etc.
467   Docutils will continue to support configuration files for backwards
468   compatibility.
470 * Add support for document decorations other than headers & footers?
471   For example, top/bottom/side navigation bars for web pages.  Generic
472   decorations?
474   Seems like a bad idea as long as it isn't independent from the ouput
475   format (for example, navigation bars are only useful for web pages).
477 * docutils_update: Check for a ``Makefile`` in a directory, and run
478   ``make`` if found?  This would allow for variant processing on
479   specific source files, such as running rst2s5.py instead of
480   rst2html.py.
482 * Add a "disable table of contents" setting?  The S5 writer could set
483   it as a default.  Rationale:
485       The ``contents`` (table of contents) directive must not be used
486       [in S5/HTML documents].  It changes the CSS class of headings
487       and they won't show up correctly in the screen presentation.
489       -- `Easy Slide Shows With reStructuredText & S5
490       <../user/slide-shows.html>`_
492   Analogue to the ``sectnum_xform`` setting, it could be used by the
493   latex writer to switch to a LaTeX generated ToC (currently, the latex
494   writer calls it "use_latex_toc").
496 object numbering and object references
497 --------------------------------------
499 For equations, tables & figures.
501 These would be the equivalent of DocBook's "formal" elements.
503 In LaTeX, automatic counters are implemented for sections, equations and
504 floats (figures, tables) (configurable via stylesheets or in the
505 latex-preamble). Objects can be given `reference names`_ with the
506 ``\label{<refname}`` command, ``\ref{<refname>}`` inserts the
507 corresponding number.
509 No such mechanism exists in HTML.
511 * We need _`persistent sequences`, similar to chapter and footnote
512   numbers. See `OpenOffice.org XML`_ "fields".
514   - Should the sequences be automatic or manual (user-specifyable)?
516 * It is already possible to give `reference names`_ to objects via
517   internal hyperlink targets or the "name" directive option::
519       .. _figure name:
521       .. figure:: image.png
523   or ::
525       .. figure:: image.png
526          :name: figure name
528   Improve the mapping of "phrase references" to IDs/labels with
529   Literal transcription (i.e. ü -> ue, ß -> ss, å -> aa) instead of just
530   stripping the accents and other non-ASCII chars.
531   Use http://pypi.python.org/pypi/Unidecode?
533   A "table" directive has been implemented, supporting table titles.
535   Perhaps the name could derive from the title/caption?
537   .. _reference names: ../ref/rst/restructuredtext.html#reference-names
539 * We need syntax for object references.  Cf. `OpenOffice.org XML`_
540   "reference fields":
542   - Parameterized substitutions are too complicated
543     (cf. `or not to do`: `object references`_)
545   - An interpreted text approach is simpler and better::
547       See Figure :ref:`figure name` and Equation :ref:`eq:identity`.
549   - "equation", "figure", and "page" roles could generate appropriate
550     boilerplate text::
552         See :figure:`figure name` on :page:`figure name`.
554     See `Interpreted Text`_ below.
556     Reference boilerplate could be specified in the document
557     (defaulting to nothing)::
559         .. fignum::
560            :prefix-ref: "Figure "
561            :prefix-caption: "Fig. "
562            :suffix-caption: :
564     The position of the role (prefix or suffix) could also be utilized
566   .. _OpenOffice.org XML: http://xml.openoffice.org/
567   .. _object references: rst/alternatives.html#object-references
569 See also the `Modified rst2html
570 <http://www.loria.fr/~rougier/coding/article/rst2html.py>`__
571 by Nicolas Rougier for a sample implementation.
574 Documentation
575 =============
577 User Docs
578 ---------
580 * Add a FAQ entry about using Docutils (with reStructuredText) on a
581   server and that it's terribly slow.  See the first paragraphs in
582   <http://article.gmane.org/gmane.text.docutils.user/1584>.
584 * Add document about what Docutils has previously been used for
585   (web/use-cases.txt?).
587 * Improve index in docs/user/config.txt.
590 Developer Docs
591 --------------
593 * Complete `Docutils Runtime Settings <../api/runtime-settings.html>`_.
595 * Improve the internal module documentation (docstrings in the code).
596   Specific deficiencies listed below.
598   - docutils.parsers.rst.states.State.build_table: data structure
599     required (including StringList).
601   - docutils.parsers.rst.states: more complete documentation of parser
602     internals.
604 * docs/ref/doctree.txt: DTD element structural relationships,
605   semantics, and attributes.  In progress; element descriptions to be
606   completed.
608 * Document the ``pending`` elements, how they're generated and what
609   they do.
611 * Document the transforms (perhaps in docstrings?): how they're used,
612   what they do, dependencies & order considerations.
614 * Document the HTML classes used by html4css1.py.
616 * Write an overview of the Docutils architecture, as an introduction
617   for developers.  What connects to what, why, and how.  Either update
618   PEP 258 (see PEPs_ below) or as a separate doc.
620 * Give information about unit tests.  Maybe as a howto?
622 * Document the docutils.nodes APIs.
624 * Complete the docs/api/publisher.txt docs.
627 How-Tos
628 -------
630 * Creating Docutils Writers
632 * Creating Docutils Readers
634 * Creating Docutils Transforms
636 * Creating Docutils Parsers
638 * Using Docutils as a Library
641 PEPs
642 ----
644 * Complete PEP 258 Docutils Design Specification.
646   - Fill in the blanks in API details.
648   - Specify the nodes.py internal data structure implementation?
650         [Tibs:] Eventually we need to have direct documentation in
651         there on how it all hangs together - the DTD is not enough
652         (indeed, is it still meant to be correct?  [Yes, it is.
653         --DG]).
655 * Rework PEP 257, separating style from spec from tools, wrt Docutils?
656   See Doc-SIG from 2001-06-19/20.
659 Python Source Reader
660 ====================
662 General:
664 * Analyze Tony Ibbs' PySource code.
666 * Analyze Doug Hellmann's HappyDoc project.
668 * Investigate how POD handles literate programming.
670 * Take the best ideas and integrate them into Docutils.
672 Miscellaneous ideas:
674 * Ask Python-dev for opinions (GvR for a pronouncement) on special
675   variables (__author__, __version__, etc.): convenience vs. namespace
676   pollution.  Ask opinions on whether or not Docutils should recognize
677   & use them.
679 * If we can detect that a comment block begins with ``##``, a la
680   JavaDoc, it might be useful to indicate interspersed section headers
681   & explanatory text in a module.  For example::
683       """Module docstring."""
685       ##
686       # Constants
687       # =========
689       a = 1
690       b = 2
692       ##
693       # Exception Classes
694       # =================
696       class MyException(Exception): pass
698       # etc.
700 * Should standalone strings also become (module/class) docstrings?
701   Under what conditions?  We want to prevent arbitrary strings from
702   becomming docstrings of prior attribute assignments etc.  Assume
703   that there must be no blank lines between attributes and attribute
704   docstrings?  (Use lineno of NEWLINE token.)
706   Triple-quotes are sometimes used for multi-line comments (such as
707   commenting out blocks of code).  How to reconcile?
709 * HappyDoc's idea of using comment blocks when there's no docstring
710   may be useful to get around the conflict between `additional
711   docstrings`_ and ``from __future__ import`` for module docstrings.
712   A module could begin like this::
714       #!/usr/bin/env python
715       # :Author: Me
716       # :Copyright: whatever
718       """This is the public module docstring (``__doc__``)."""
720       # More docs, in comments.
721       # All comments at the beginning of a module could be
722       # accumulated as docstrings.
723       # We can't have another docstring here, because of the
724       # ``__future__`` statement.
726       from __future__ import division
728   Using the JavaDoc convention of a doc-comment block beginning with
729   ``##`` is useful though.  It allows doc-comments and implementation
730   comments.
732   .. _additional docstrings:
733      ../peps/pep-0258.html#additional-docstrings
735 * HappyDoc uses an initial comment block to set "parser configuration
736   values".  Do the same thing for Docutils, to set runtime settings on
737   a per-module basis?  I.e.::
739       # Docutils:setting=value
741   Could be used to turn on/off function parameter comment recognition
742   & other marginal features.  Could be used as a general mechanism to
743   augment config files and command-line options (but which takes
744   precedence?).
746 * Multi-file output should be divisible at arbitrary level.
748 * Support all forms of ``import`` statements:
750   - ``import module``: listed as "module"
751   - ``import module as alias``: "alias (module)"
752   - ``from module import identifier``: "identifier (from module)"
753   - ``from module import identifier as alias``: "alias (identifier
754     from module)"
755   - ``from module import *``: "all identifiers (``*``) from module"
757 * Have links to colorized Python source files from API docs?  And
758   vice-versa: backlinks from the colorized source files to the API
759   docs!
761 * In summaries, use the first *sentence* of a docstring if the first
762   line is not followed by a blank line.
765 reStructuredText Parser
766 =======================
768 Also see the `... Or Not To Do?`__ list.
770 __ rst/alternatives.html#or-not-to-do
772 Misc
773 ----
775 * Another list problem::
777       * foo
778             * bar
779             * baz
781   This ends up as a definition list.  This is more of a usability
782   issue.
784 * This case is probably meant to be a nested list, but it ends up as a
785   list inside a block-quote without an error message::
787       - foo
789        - bar
791   It should probably just be an error.
793   The problem with this is that you don't notice easily in HTML that
794   it's not a nested list but a block-quote -- there's not much of a
795   visual difference.
797 * Treat enumerated lists that are not arabic and consist of only one
798   item in a single line as ordinary paragraphs.  See
799   <http://article.gmane.org/gmane.text.docutils.user/2635>.
801 * The citation syntax could use some improvements.  See
802   <http://thread.gmane.org/gmane.text.docutils.user/2499> (and the
803   sub-thread at
804   <http://thread.gmane.org/gmane.text.docutils.user/2499/focus=3028>,
805   and the follow-ups at
806   <http://thread.gmane.org/gmane.text.docutils.user/3087>,
807   <http://thread.gmane.org/gmane.text.docutils.user/3110>,
808   <http://thread.gmane.org/gmane.text.docutils.user/3114>),
809   <http://thread.gmane.org/gmane.text.docutils.user/2443>,
810   <http://thread.gmane.org/gmane.text.docutils.user/2715>,
811   <http://thread.gmane.org/gmane.text.docutils.user/3027>,
812   <http://thread.gmane.org/gmane.text.docutils.user/3120>,
813   <http://thread.gmane.org/gmane.text.docutils.user/3253>.
815 * The current list-recognition logic has too many false positives, as
816   in ::
818       * Aorta
819       * V. cava superior
820       * V. cava inferior
822   Here ``V.`` is recognized as an enumerator, which leads to
823   confusion.  We need to find a solution that resolves such problems
824   without complicating the spec to much.
826   See <http://thread.gmane.org/gmane.text.docutils.user/2524>.
828 * Add indirect links via citation references & footnote references.
829   Example::
831       `Goodger (2005)`_ is helpful.
833       .. _Goodger (2005): [goodger2005]_
834       .. [goodger2005] citation text
836   See <http://thread.gmane.org/gmane.text.docutils.user/2499>.
838 * Complain about bad URI characters
839   (http://article.gmane.org/gmane.text.docutils.user/2046) and
840   disallow internal whitespace
841   (http://article.gmane.org/gmane.text.docutils.user/2214).
843 * Create ``info``-level system messages for unnecessarily
844   backslash-escaped characters (as in ``"\something"``, rendered as
845   "something") to allow checking for errors which silently slipped
846   through.
848 * Add (functional) tests for untested roles.
850 * Add test for ":figwidth: image" option of "figure" directive.  (Test
851   code needs to check if PIL is available on the system.)
853 * Add support for CJK double-width whitespace (indentation) &
854   punctuation characters (markup; e.g. double-width "*", "-", "+")?
856 * Add motivation sections for constructs in spec.
858 * Support generic hyperlink references to _`targets in other
859   documents`?  Not in an HTML-centric way, though (it's trivial to say
860   ``http://www.example.com/doc#name``, and useless in non-HTML
861   contexts).  XLink/XPointer?  ``.. baseref::``?  See Doc-SIG
862   2001-08-10.
864 * .. _adaptable file extensions:
866   In target URLs, it would be useful to not explicitly specify the
867   file extension.  If we're generating HTML, then ".html" is
868   appropriate; if PDF, then ".pdf"; etc.  How about using ".*" to
869   indicate "choose the most appropriate filename extension"?  For
870   example::
872       .. _Another Document: another.*
874   What is to be done for output formats that don't *have* hyperlinks?
875   For example, LaTeX targeted at print.  Hyperlinks may be "called
876   out", as footnotes with explicit URLs.  (Don't convert the links.)
878   But then there's also LaTeX targeted at PDFs, which *can* have
879   links.  Perhaps a runtime setting for "*" could explicitly provide
880   the extension, defaulting to the output file's extension.
882   Should the system check for existing files?  No, not practical.
884   Handle documents only, or objects (images, etc.) also?
886   If this handles images also, how to differentiate between document
887   and image links?  Element context (within "image")?  Which image
888   extension to use for which document format?  Again, a runtime
889   setting would suffice.
891   This may not be just a parser issue; it may need framework support.
893   Mailing list threads: `Images in both HTML and LaTeX`__ (especially
894   `this summary of Lea's objections`__), `more-universal links?`__,
895   `Output-format-sensitive link targets?`__
897   __ http://thread.gmane.org/gmane.text.docutils.user/1239
898   __ http://article.gmane.org/gmane.text.docutils.user/1278
899   __ http://thread.gmane.org/gmane.text.docutils.user/1915
900   __ http://thread.gmane.org/gmane.text.docutils.user/2438
902   Idea from Jim Fulton: an external lookup table of targets:
904       I would like to specify the extension (e.g. .txt) [in the
905       source, rather than ``filename.*``], but tell the converter to
906       change references to the files anticipating that the files will
907       be converted too.
909       For example::
911         .. _Another Document: another.txt
913         rst2html.py --convert-links "another.txt bar.txt" foo.txt
915       That is, name the files for which extensions should be converted.
917       Note that I want to refer to original files in the original text
918       (another.txt rather than another.txt) because I want the
919       unconverted text to stand on its own.
921       Note that in most cases, people will be able to use globs::
923         rst2html.py --convert-link-extensions-for "`echo *.txt`" foo.txt
925       It might be nice to be able to use multiple arguments, as in::
927         rst2html.py --convert-link-extensions-for *.txt -- foo.txt
929       ::
931       > What is to be done for output formats
932       > that don't have hyperlinks?
934       Don't convert the links.
936       ::
938       > Handle documents only, or objects
939       > (images, etc.) also?
941       No, documents only, but there really is no need for gueswork.
942       Just get the file names as command-line arguments.  EIBTI
943       [explicit is better than implicit].
945   For images, we probably need separate solution (which is being
946   worked on), whereas for documents, the issue is basically
947   interlinking between reStructuredText documents.  IMO, this cries
948   for support for multiple input and output files, i.e. support for
949   documents which comprise multiple files.  Adding adaptable file
950   extensions seems like a kludge.  // FW
952 * Implement the header row separator modification to table.el.  (Wrote
953   to Takaaki Ota & the table.el mailing list on 2001-08-12, suggesting
954   support for "=====" header rows.  On 2001-08-17 he replied, saying
955   he'd put it on his to-do list, but "don't hold your breath".)
957 * Fix the parser's indentation handling to conform with the stricter
958   definition in the spec.  (Explicit markup blocks should be strict or
959   forgiving?)
961   .. XXX What does this mean?  Can you elaborate, David?
963 * Make the parser modular.  Allow syntax constructs to be added or
964   disabled at run-time.  Subclassing is probably not enough because it
965   makes it difficult to apply multiple extensions.
967 * Generalize the "doctest block" construct (which is overly
968   Python-centric) to other interactive sessions?  "Doctest block"
969   could be renamed to "I/O block" or "interactive block", and each of
970   these could also be recognized as such by the parser:
972   - Shell sessions::
974         $ cat example1.txt
975         A block beginning with a "$ " prompt is interpreted as a shell
976         session interactive block.  As with Doctest blocks, the
977         interactive block ends with the first blank line, and wouldn't
978         have to be indented.
980   - Root shell sessions::
982         # cat example2.txt
983         A block beginning with a "# " prompt is interpreted as a root
984         shell session (the user is or has to be logged in as root)
985         interactive block.  Again, the block ends with a blank line.
987   Other standard (and unambiguous) interactive session prompts could
988   easily be added (such as "> " for WinDOS).
990   Tony Ibbs spoke out against this idea (2002-06-14 Doc-SIG thread
991   "docutils feedback").
993 * Add support for pragma (syntax-altering) directives.
995   Some pragma directives could be local-scope unless explicitly
996   specified as global/pragma using ":global:" options.
998 * Support whitespace in angle-bracketed standalone URLs according to
999   Appendix E ("Recommendations for Delimiting URI in Context") of `RFC
1000   2396`_.
1002   .. _RFC 2396: http://www.rfc-editor.org/rfc/rfc2396.txt
1004 * Use the vertical spacing of the source text to determine the
1005   corresponding vertical spacing of the output?
1007 * [From Mark Nodine]  For cells in simple tables that comprise a
1008   single line, the justification can be inferred according to the
1009   following rules:
1011   1. If the text begins at the leftmost column of the cell,
1012      then left justification, ELSE
1013   2. If the text begins at the rightmost column of the cell,
1014      then right justification, ELSE
1015   3. Center justification.
1017   The onus is on the author to make the text unambiguous by adding
1018   blank columns as necessary.  There should be a parser setting to
1019   turn off justification-recognition (normally on would be fine).
1021   Decimal justification?
1023   All this shouldn't be done automatically.  Only when it's requested
1024   by the user, e.g. with something like this::
1026       .. table::
1027          :auto-indent:
1029          (Table goes here.)
1031   Otherwise it will break existing documents.
1033 * Generate a warning or info message for paragraphs which should have
1034   been lists, like this one::
1036       1. line one
1037       3. line two
1039 * Generalize the "target-notes" directive into a command-line option
1040   somehow?  See docutils-develop 2003-02-13.
1042 * Allow a "::"-only paragraph (first line, actually) to introduce a
1043   _`literal block without a blank line`?  (Idea from Paul Moore.) ::
1045       ::
1046           This is a literal block
1048   Is indentation enough to make the separation between a paragraph
1049   which contains just a ``::`` and the literal text unambiguous?
1050   (There's one problem with this concession: If one wants a definition
1051   list item which defines the term "::", we'd have to escape it.)  It
1052   would only be reasonable to apply it to "::"-only paragraphs though.
1053   I think the blank line is visually necessary if there's text before
1054   the "::"::
1056       The text in this paragraph needs separation
1057       from the literal block following::
1058           This doesn't look right.
1060 * Add new syntax for _`nested inline markup`?  Or extend the parser to
1061   parse nested inline markup somehow?  See the `collected notes
1062   <rst/alternatives.html#nested-inline-markup>`__.
1064 * Drop the backticks from embedded URIs with omitted reference text?
1065   Should the angle brackets be kept in the output or not? ::
1067       <file_name>_
1069   Probably not worth the trouble.
1071 * How about a syntax for alternative hyperlink behavior, such as "open
1072   in a new window" (as in HTML's ``<a target="_blank">``)?
1074   The MoinMoin wiki uses a caret ("^") at the beginning of the URL
1075   ("^" is not a legal URI character).  That could work for both inline
1076   and explicit targets::
1078       The `reference docs <^url>`__ may be handy.
1080       .. _name: ^url
1082   This may be too specific to HTML.  It hasn't been requested very
1083   often either.
1085 * Add an option to add URI schemes at runtime.
1087 * _`Segmented lists`::
1089       : segment : segment : segment
1090       : segment : segment : very long
1091         segment
1092       : segment : segment : segment
1094   The initial colon (":") can be thought of as a type of bullet
1096   We could even have segment titles::
1098       :: title  : title   : title
1099       : segment : segment : segment
1100       : segment : segment : segment
1102   This would correspond well to DocBook's SegmentedList.  Output could
1103   be tabular or "name: value" pairs, as described in DocBook's docs.
1105 * Allow backslash-escaped colons in field names::
1107       :Case Study\: Event Handling: This chapter will be dropped.
1109 * Enable grid _`tables inside XML comments`, where "``--``" ends comments.
1111   Implementation possibilities:
1113   1. Make the table syntax characters into "table" directive options.
1114      This is the most flexible but most difficult, and we probably
1115      don't need that much flexibility.
1117   2. Substitute "~" for "-" with a specialized directive option
1118      (e.g. ":tildes:").
1120   3. Make the standard table syntax recognize "~" as well as "-", even
1121      without a directive option.  Individual tables would have to be
1122      internally consistent.
1124   4. Allow Unicode box characters for table markup
1125      (`feature request [6]`_)
1127   Directive options are preferable to configuration settings, because
1128   tables are document-specific.  A pragma directive would be another
1129   approach, to set the syntax once for a whole document.
1131   Unicode box character markup would kill two birds with one stone.
1133   In the meantime, the list-table_ directive is a good replacement for
1134   grid tables inside XML comments.
1136   .. _feature request [6]:
1137       http://sourceforge.net/p/docutils/feature-requests/6
1138   .. _list-table: ../ref/rst/directives.html#list-table
1141 * Generalize docinfo contents (bibliographic fields): remove specific
1142   fields, and have only a single generic "field"?
1144 * _`Line numbers` and "source" in system messages:
1146   - Add "source" and "line" keyword arguments to all Reporter calls?
1147     This would require passing source/line arguments along all
1148     intermediate functions (where currently only `line` is used).
1150     Or rather specify "line" only if actually needed?
1152     Currently, `document.reporter` uses a state machine instance to
1153     determine the "source" and "line" info from
1154     `statemachine.input_lines` if not given explicitely. Except for
1155     special cases, the "line" argument is not needed because,
1156     `document.statemachine` keeps record of the current line number.
1158   - For system messages generated after the parsing is completed (i.e. by
1159     transforms or the writer) "line" info must be present in the doctree
1160     elements.
1162     Elements' .line assignments should be checked.  (Assign to .source
1163     too?  Add a set_info method?  To what?)
1165     The "source" (and line number in the source) can either be added
1166     explicitely to the elements or determined from the “raw” line
1167     number by `document.statemachine.get_source_and_line`.
1169   - Some line numbers in elements are not being set properly
1170     (explicitly), just implicitly/automatically.  See rev. 1.74 of
1171     docutils/parsers/rst/states.py for an example of how to set.
1173   - The line numbers of definition list items are wrong::
1175         $ rst2pseudoxml.py --expose-internal-attribute line
1176         1
1177           2
1178           3
1180         5
1181           6
1182           7
1184         <document source="<stdin>">
1185             <definition_list>
1186                 <definition_list_item internal:line="3">
1187                     <term>
1188                         1
1189                     <definition>
1190                         <paragraph internal:line="2">
1191                             2
1192                             3
1193                 <definition_list_item internal:line="6">
1194                     <term>
1195                         5
1196                     <definition>
1197                         <paragraph internal:line="6">
1198                             6
1199                             7
1201 * .. _none source:
1203   Quite a few nodes are getting a "None" source attribute as well.  In
1204   particular, see the bodies of definition lists.
1208 Math Markup
1209 -----------
1211 Since Docutils 0.8, a "math" role and directive using LaTeX math
1212 syntax as input format is part of reStructuredText.
1214 Open issues:
1216 * Use a "Transform" for math format conversions as extensively discussed in
1217   the "math directive issues" thread in May 2008
1218   (http://osdir.com/ml/text.docutils.devel/2008-05/threads.html)?
1220 * Generic "math-output" option (currently specific to HTML).
1221   (List of math-output preferences?)
1223 * Try to be compatible with `Math support in Sphinx`_?
1225   * The ``:label:`` option selects a label for the equation, by which it
1226     can be cross-referenced, and causes an equation number to be issued.
1227     In Docutils, the option ``:name:`` sets the label.
1228     Equation numbering is not implemented yet.
1230   * Option ``:nowrap:`` prevents wrapping of the given math in a
1231     math environment (you have to specify the math environment in the
1232     content).
1234 .. _Math support in Sphinx: http://sphinx.pocoo.org/ext/math.html
1236 * Equation numbering and references. (Should be handled in a unified way
1237   with other numbered entities like formal tables and images.)
1239 alternative input formats
1240 `````````````````````````
1242 Use a directive option to specify an alternative input format, e.g. (but not
1243 limited to):
1245 MathML_
1246   Not for hand-written code but maybe usefull when pasted in (or included
1247   from a file)
1249   For an overview of MathML implementations and tests, see, e.g.,
1250   the `mathweb wiki`_ or the `ConTeXT MathML page`_.
1252   .. _MathML: http://www.w3.org/TR/MathML2/
1253   .. _mathweb wiki: http://www.mathweb.org/wiki/MathML
1254   .. _ConTeXT MathML page: http://wiki.contextgarden.net/MathML
1257 ASCIIMath_
1258   Simple, ASCII based math input language (see also `ASCIIMath tutorial`_).
1260   * The Python module ASCIIMathML_ translates a string with ASCIIMath into a
1261     MathML tree. Used, e.g., by MultiMarkdown__.
1263     A more comprehensive implementation is ASCIIMathPython_ by
1264     Paul Trembley (also used in his sandbox projects).
1266   * For conversion to LaTeX, there is a JavaScript script at
1267     http://dlippman.imathas.com/asciimathtex/ASCIIMath2TeX.js
1269   .. _ASCIIMath: http://www1.chapman.edu/~jipsen/mathml/asciimath.html
1270   .. _ASCIIMath tutorial:
1271      http://www.wjagray.co.uk/maths/ASCIIMathTutorial.html
1272   .. _ASCIIMathML: http://pypi.python.org/pypi/asciimathml/
1273   .. _ASCIIMathPython: http://sourceforge.net/projects/asciimathpython/
1274   __ http://fletcherpenney.net/multimarkdown/
1276 `Unicode Nearly Plain Text Encoding of Mathematics`_
1277    format for lightly marked-up representation of mathematical
1278    expressions in Unicode.
1280    (Unicode Technical Note. Sole responsibility for its contents rests
1281    with the author(s). Publication does not imply any endorsement by
1282    the Unicode Consortium.)
1284    .. _Unicode Nearly Plain Text Encoding of Mathematics:
1285       http://www.unicode.org/notes/tn28/
1287 itex
1288   See `the culmination of a relevant discussion in 2003
1289   <http://article.gmane.org/gmane.text.docutils.user/118>`__.
1293 LaTeX output
1294 ````````````
1296 Which equation environments should be supported by the math directive?
1298 * one line:
1300   + numbered: `equation`
1301   + unnumbered: `equation*`
1303 * multiline (test for ``\\`` outside of a nested environment
1304   (e.g. `array` or `cases`)
1306   + numbered: `align` (number every line)
1308     (To give one common number to all lines, put them in a `split`
1309     environment. Docutils then places it in an `equation` environment.)
1311   + unnumbered: `align*`
1313   + Sphinx math also supports `gather` (checking for blank lines in
1314     the content). Docutils puts content blocks separated by blank
1315     lines in separate math-block doctree nodes. (The only difference of
1316     `gather` to two consecutive "normal" environments seems to be that
1317     page-breaks between the two are prevented.)
1319 See http://www.math.uiuc.edu/~hildebr/tex/displays.html.
1322 HTML output
1323 ```````````
1325 There is no native math support in HTML.
1327 MathML_
1328   Converters from LaTeX to MathML include
1330   * latex_math_ (Python) by Jens Jørgen Mortensen in the Docutils sandbox
1332     This is the base for Docutils latex2mathml_ module used by
1333     default with ``--math-output=MathML``.
1335   * blahtexml_ (C++), supported with ``--math-output=MathML blahtexml``.
1337     Fast conversion, support for many symbols and environments, but
1338     no "align" (or other equation-aligning) environment.
1340   * LaTeXML_ (Perl), supported with ``--math-output=MathML latexml``.
1342     Comprehensive macro support but very slow
1344   * TtM_ (C), ``--math-output=MathML ttm``, support may be removed.
1346     No "matrix", "align" and  "cases" environments.
1348   * MathToWeb_ (Java)
1349   * TeX4ht_ (TeX based)
1350   * itex_ (also `used in Abiword`__)
1351   * `Steve’s LATEX-to-MathML translator`_
1352     ('mini-language', javascript, Python)
1355   * Write a new converter? E.g. based on:
1357     * a generic tokenizer (see e.g. a `latex-codec recipe`_,
1358       `updated latex-codec`_, )
1359     * the Unicode-Char <-> LaTeX mappings database unimathsymbols_
1361   __ http://msevior.livejournal.com/26377.html
1362   .. _MathML: http://www.w3.org/TR/MathML2/
1363   .. _latex_math: ../../../sandbox/jensj/latex_math/
1364   .. _latex2mathml: ../../docutils/math/latex2mathml.py
1365   .. _blahtexml: http://gva.noekeon.org/blahtexml/
1366   .. _LaTeXML: http://dlmf.nist.gov/LaTeXML/
1367   .. _ttm: http://hutchinson.belmont.ma.us/tth/mml/
1368   .. _TeX4ht: http://www.tug.org/applications/tex4ht/mn.html
1369   .. _MathToWeb:  http://www.mathtoweb.com/
1370   .. _itex: http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html
1371   .. _Steve’s LATEX-to-MathML translator:
1372      http://www.gold-saucer.org/mathml/greasemonkey/dist/display-latex
1373   .. _latex-codec recipe:
1374      http://code.activestate.com/recipes/252124-latex-codec/
1375   .. _updated latex-codec:
1376      http://mirror.ctan.org/biblio/bibtex/utils/mab2bib/latex.py
1377   .. _unimathsymbols: http://milde.users.sourceforge.net/LUCR/Math/
1379 .. URL seems down:
1380    .. _itex: http://pear.math.pitt.edu/mathzilla/itex2mmlItex.html
1383 HTML/CSS
1384   format math in standard HTML enhanced by CSS rules
1385   (Overview__, `Examples and experiments`__).
1387   The ``math-output=html`` option uses the converter from eLyXer_
1388   (included with Docutils).
1390   Alternatives: LaTeX-math to HTML/CSS converters include
1392   * TtH_ (C)
1393   * Hevea_ (Objective Caml)
1395   __ http://www.cs.tut.fi/~jkorpela/math/
1396   __ http://www.zipcon.net/~swhite/docs/math/math.html
1397   .. _elyxer: http://elyxer.nongnu.org/
1398   .. _TtH: ttp://hutchinson.belmont.ma.us/tth/index.html
1399   .. _Hevea: http://para.inria.fr/~maranget/hevea/
1401 images
1402   (PNG or SVG) like e.g. Wikipedia. (e.g. with dvisvgm_ or the
1403   pure-python MathML->SVG converter SVGMath_)
1405   .. _dvisvgm: http://dvisvgm.sourceforge.net/
1406   .. _SVGMath: http://www.grigoriev.ru/svgmath/
1409 OpenOffice output
1410 `````````````````
1412 * The `OpenDocument standard`_ version 1.1 says:
1414     Mathematical content is represented by MathML 2.0
1416   However, putting MathML into an ODP file seems tricky as these
1417   (maybe outdated) links suppose:
1418   http://idippedut.dk/post/2008/01/25/Do-your-math-ODF-and-MathML.aspx
1419   http://idippedut.dk/post/2008/03/03/Now-I-get-it-ODF-and-MathML.aspx
1421   .. _OpenDocument standard:
1422     http://www.oasis-open.org/standards#opendocumentv1.1
1424 * OOoLaTeX__:  "a set of macros designed to bring the power of LaTeX
1425   into OpenOffice."
1427   __ http://ooolatex.sourceforge.net/
1430 Directives
1431 ----------
1433 Directives below are often referred to as "module.directive", the
1434 directive function.  The "module." is not part of the directive name
1435 when used in a document.
1437 * Allow for field lists in list tables.  See
1438   <http://thread.gmane.org/gmane.text.docutils.devel/3392>.
1440 * .. _unify tables:
1442   Unify table implementations and unify options of table directives
1443   (http://article.gmane.org/gmane.text.docutils.user/1857).
1445 * Allow directives to be added at run-time?
1447 * Use the language module for directive option names?
1449 * Add "substitution_only" and "substitution_ok" function attributes,
1450   and automate context checking?
1452 * Implement options or features on existing directives:
1454   - All directives that produce titled elements should grow implicit
1455     reference names based on the titles.
1457   - Allow the _`:trim:` option for all directives when they occur in a
1458     substitution definition, not only the unicode_ directive.
1460     .. _unicode: ../ref/rst/directives.html#unicode-character-codes
1462   - Add the "class" option to the unicode_ directive.  For example, you
1463     might want to get characters or strings with borders around them.
1465   - _`images.figure`: "title" and "number", to indicate a formal
1466     figure?
1468   - _`parts.sectnum`: "local"?, "refnum"
1470     A "local" option could enable numbering for sections from a
1471     certain point down, and sections in the rest of the document are
1472     not numbered.  For example, a reference section of a manual might
1473     be numbered, but not the rest.  OTOH, an all-or-nothing approach
1474     would probably be enough.
1476     The "sectnum" directive should be usable multiple times in a
1477     single document.  For example, in a long document with "chapter"
1478     and "appendix" sections, there could be a second "sectnum" before
1479     the first appendix, changing the sequence used (from 1,2,3... to
1480     A,B,C...).  This is where the "local" concept comes in.  This part
1481     of the implementation can be left for later.
1483     A "refnum" option (better name?) would insert reference names
1484     (targets) consisting of the reference number.  Then a URL could be
1485     of the form ``http://host/document.html#2.5`` (or "2-5"?).  Allow
1486     internal references by number?  Allow name-based *and*
1487     number-based ids at the same time, or only one or the other (which
1488     would the table of contents use)?  Usage issue: altering the
1489     section structure of a document could render hyperlinks invalid.
1491   - _`parts.contents`: Add a "suppress" or "prune" option?  It would
1492     suppress contents display for sections in a branch from that point
1493     down.  Or a new directive, like "prune-contents"?
1495     Add an option to include topics in the TOC?  Another for sidebars?
1496     The "topic" directive could have a "contents" option, or the
1497     "contents" directive" could have an "include-topics" option.  See
1498     docutils-develop 2003-01-29.
1500   - _`parts.header` & _`parts.footer`: Support multiple, named headers
1501     & footers?  For example, separate headers & footers for odd, even,
1502     and the first page of a document.
1504     This may be too specific to output formats which have a notion of
1505     "pages".
1507   - _`misc.class`:
1509     - Add a ``:parent:`` option for setting the parent's class
1510       (http://article.gmane.org/gmane.text.docutils.devel/3165).
1512   - _`misc.include`:
1514     - Option to label lines?
1516     - How about an environment variable, say RSTINCLUDEPATH or
1517       RSTPATH, for standard includes (as in ``.. include:: <name>``)?
1518       This could be combined with a setting/option to allow
1519       user-defined include directories.
1521     - Add support for inclusion by URL? ::
1523           .. include::
1524              :url: http://www.example.org/inclusion.txt
1526     - Strip blank lines from begin and end of a literal included file or
1527       file section. This would correspond to the way a literal block is
1528       handled.
1530       As nodes.literal_block expects (and we have) the text as a string
1531       (rather than a list of lines), using a regexp seems the way.
1533   - _`misc.raw`: add a "destination" option to the "raw" directive? ::
1535         .. raw:: html
1536            :destination: head
1538            <link ...>
1540     It needs thought & discussion though, to come up with a consistent
1541     set of destination labels and consistent behavior.
1543     And placing HTML code inside the <head> element of an HTML
1544     document is rather the job of a templating system.
1546   - _`body.sidebar`: Allow internal section structure?  Adornment
1547     styles would be independent of the main document.
1549     That is really complicated, however, and the document model
1550     greatly benefits from its simplicity.
1552 * Implement directives.  Each of the list items below begins with an
1553   identifier of the form, "module_name.directive_function_name".  The
1554   directive name itself could be the same as the
1555   directive_function_name, or it could differ.
1557   - _`html.imagemap`
1559     It has the disadvantage that it's only easily implementable for
1560     HTML, so it's specific to one output format.
1562     (For non-HTML writers, the imagemap would have to be replaced with
1563     the image only.)
1565   - _`parts.endnotes` (or "footnotes"): See `Footnote & Citation Gathering`_.
1567   - _`parts.citations`: See `Footnote & Citation Gathering`_.
1569   - _`misc.language`: Specify (= change) the language of a document at
1570     parse time?
1572     * The misc.settings_ directive suggested below offers a more generic
1573       approach.
1575     * The language of document parts can be indicated by the "special class
1576       value" ``"language-"`` + `BCP 47`_ language code. Class arguments to
1577       the title are attached to the document's base node - hence titled
1578       documents can be given a different language at parse time. However,
1579       "language by class attribute" does not change parsing (localized
1580       directives etc.), only supporting writers.
1582     .. _BCP 47: http://www.rfc-editor.org/rfc/bcp/bcp47.txt
1585   - _`misc.settings`: Set any(?) Docutils runtime setting from within
1586     a document?  Needs much thought and discussion.
1588     Security concerns need to be taken into account (it shouldn't be
1589     possible to enable ``file_insertion_enabled`` from within a
1590     document), and settings that only would have taken effect before
1591     the directive (like ``tab-width``) shouldn't be accessible either.
1593     See this sub-thread:
1594     <http://thread.gmane.org/gmane.text.docutils.user/3620/focus=3649>
1596   - _`misc.gather`: Gather (move, or copy) all instances of a specific
1597     element.  A generalization of the `Footnote & Citation Gathering`_
1598     ideas.
1600   - Add a custom "directive" directive, equivalent to "role"?  For
1601     example::
1603         .. directive:: incr
1605            .. class:: incremental
1607         .. incr::
1609         "``.. incr::``" above is equivalent to "``.. class:: incremental``".
1611     Another example::
1613         .. directive:: printed-links
1615            .. topic:: Links
1616               :class: print-block
1618               .. target-notes::
1619                  :class: print-inline
1621     This acts like macros.  The directive contents will have to be
1622     evaluated when referenced, not when defined.
1624     * Needs a better name?  "Macro", "substitution"?
1625     * What to do with directive arguments & options when the
1626       macro/directive is referenced?
1628   - Make the meaning of block quotes overridable?  Only a 1-shot
1629     though; doesn't solve the general problem.
1631   - _`conditional directives`:
1633     .. note:: See also the implementation in Sphinx_.
1635     Docutils already has the ability to say "use this content for
1636     Writer X" via the "raw" directive. It also does have the ability
1637     to say "use this content for any Writer other than X" via the
1638     "strip-elements with class" config value.  However, using "raw"
1639     input just to select a special writer is inconvenient in many
1640     cases.
1641     It wouldn't be difficult to get more straightforward support, though.
1643     My first idea would be to add a set of conditional directives.
1644     Let's call them "writer-is" and "writer-is-not" for discussion
1645     purposes (don't worry about implemention details).  We might
1646     have::
1648          .. writer-is:: text-only
1650             ::
1652                 +----------+
1653                 |   SNMP   |
1654                 +----------+
1655                 |   UDP    |
1656                 +----------+
1657                 |    IP    |
1658                 +----------+
1659                 | Ethernet |
1660                 +----------+
1662          .. writer-is:: pdf
1664             .. figure:: protocol_stack.eps
1666          .. writer-is-not:: text-only pdf
1668             .. figure:: protocol_stack.png
1670     This could be an interface to the Filter transform
1671     (docutils.transforms.components.Filter).
1673     The ideas in `adaptable file extensions`_ above may also be
1674     applicable here.
1676     SVG's "switch" statement may provide inspiration.
1678     Here's an example of a directive that could produce multiple
1679     outputs (*both* raw troff pass-through *and* a GIF, for example)
1680     and allow the Writer to select. ::
1682         .. eqn::
1684            .EQ
1685            delim %%
1686            .EN
1687            %sum from i=o to inf c sup i~=~lim from {m -> inf}
1688            sum from i=0 to m sup i%
1689            .EQ
1690            delim off
1691            .EN
1693   - _`body.example`: Examples; suggested by Simon Hefti.  Semantics as
1694     per Docbook's "example"; admonition-style, numbered, reference,
1695     with a caption/title.
1697   - _`body.index`: Index targets.
1699     See `Index Entries & Indexes
1700     <./rst/alternatives.html#index-entries-indexes>`__.
1702   - _`body.literal`: Literal block, possibly "formal" (see `object
1703     numbering and object references`_ above).  Possible options:
1705     - "highlight" a range of lines
1707     - include only a specified range of lines
1709     - "number" or "line-numbers"? (since 0.9 available with "code" directive)
1711     - "styled" could indicate that the directive should check for
1712       style comments at the end of lines to indicate styling or
1713       markup.
1715       Specific derivatives (i.e., a "python-interactive" directive)
1716       could interpret style based on cues, like the ">>> " prompt and
1717       "input()"/"raw_input()" calls.
1719     See docutils-users 2003-03-03.
1721   - _`body.listing`: Code listing with title (to be numbered
1722     eventually), equivalent of "figure" and "table" directives.
1724   - _`pysource.usage`: Extract a usage message from the program,
1725     either by running it at the command line with a ``--help`` option
1726     or through an exposed API.  [Suggestion for Optik.]
1729 Interpreted Text
1730 ----------------
1732 Interpreted text is entirely a reStructuredText markup construct, a
1733 way to get around built-in limitations of the medium.  Some roles are
1734 intended to introduce new doctree elements, such as "title-reference".
1735 Others are merely convenience features, like "RFC".
1737 All supported interpreted text roles must already be known to the
1738 Parser when they are encountered in a document.  Whether pre-defined
1739 in core/client code, or in the document, doesn't matter; the roles
1740 just need to have already been declared.  Adding a new role may
1741 involve adding a new element to the DTD and may require extensive
1742 support, therefore such additions should be well thought-out.  There
1743 should be a limited number of roles.
1745 The only place where no limit is placed on variation is at the start,
1746 at the Reader/Parser interface.  Transforms are inserted by the Reader
1747 into the Transformer's queue, where non-standard elements are
1748 converted.  Once past the Transformer, no variation from the standard
1749 Docutils doctree is possible.
1751 An example is the Python Source Reader, which will use interpreted
1752 text extensively.  The default role will be "Python identifier", which
1753 will be further interpreted by namespace context into <class>,
1754 <method>, <module>, <attribute>, etc. elements (see pysource.dtd),
1755 which will be transformed into standard hyperlink references, which
1756 will be processed by the various Writers.  No Writer will need to have
1757 any knowledge of the Python-Reader origin of these elements.
1759 * Add explicit interpreted text roles for the rest of the implicit
1760   inline markup constructs: named-reference, anonymous-reference,
1761   footnote-reference, citation-reference, substitution-reference,
1762   target, uri-reference (& synonyms).
1764 * Add directives for each role as well?  This would allow indirect
1765   nested markup::
1767       This text contains |nested inline markup|.
1769       .. |nested inline markup| emphasis::
1771          nested ``inline`` markup
1773 * Implement roles:
1775   - "_`raw-wrapped`" (or "_`raw-wrap`"): Base role to wrap raw text
1776     around role contents.
1778     For example, the following reStructuredText source ... ::
1780         .. role:: red(raw-formatting)
1781            :prefix:
1782                :html: <font color="red">
1783                :latex: {\color{red}
1784            :suffix:
1785                :html: </font>
1786                :latex: }
1788         colored :red:`text`
1790     ... will yield the following document fragment::
1792         <paragraph>
1793             colored
1794             <inline classes="red">
1795                 <raw format="html">
1796                     <font color="red">
1797                 <raw format="latex">
1798                     {\color{red}
1799                 <inline classes="red">
1800                     text
1801                 <raw format="html">
1802                     </font>
1803                 <raw format="latex">
1804                     }
1806     Possibly without the intermediate "inline" node.
1808   - _`"acronym" and "abbreviation"`: Associate the full text with a
1809     short form.  Jason Diamond's description:
1811         I want to translate ```reST`:acronym:`` into ``<acronym
1812         title='reStructuredText'>reST</acronym>``.  The value of the
1813         title attribute has to be defined out-of-band since you can't
1814         parameterize interpreted text.  Right now I have them in a
1815         separate file but I'm experimenting with creating a directive
1816         that will use some form of reST syntax to let you define them.
1818     Should Docutils complain about undefined acronyms or
1819     abbreviations?
1821     What to do if there are multiple definitions?  How to
1822     differentiate between CSS (Content Scrambling System) and CSS
1823     (Cascading Style Sheets) in a single document?  David Priest
1824     responds,
1826         The short answer is: you don't.  Anyone who did such a thing
1827         would be writing very poor documentation indeed.  (Though I
1828         note that `somewhere else in the docs`__, there's mention of
1829         allowing replacement text to be associated with the
1830         abbreviation.  That takes care of the duplicate
1831         acronyms/abbreviations problem, though a writer would be
1832         foolish to ever need it.)
1834         __ `inline parameter syntax`_
1836     How to define the full text?  Possibilities:
1838     1. With a directive and a definition list? ::
1840            .. acronyms::
1842               reST
1843                   reStructuredText
1844               DPS
1845                   Docstring Processing System
1847        Would this list remain in the document as a glossary, or would
1848        it simply build an internal lookup table?  A "glossary"
1849        directive could be used to make the intention clear.
1850        Acronyms/abbreviations and glossaries could work together.
1852        Then again, a glossary could be formed by gathering individual
1853        definitions from around the document.
1855     2. Some kind of `inline parameter syntax`_? ::
1857            `reST <reStructuredText>`:acronym: is `WYSIWYG <what you
1858            see is what you get>`:acronym: plaintext markup.
1860        .. _inline parameter syntax:
1861           rst/alternatives.html#parameterized-interpreted-text
1863     3. A combination of 1 & 2?
1865        The multiple definitions issue could be handled by establishing
1866        rules of priority.  For example, directive-based lookup tables
1867        have highest priority, followed by the first inline definition.
1868        Multiple definitions in directive-based lookup tables would
1869        trigger warnings, similar to the rules of `implicit hyperlink
1870        targets`__.
1872        __ ../ref/rst/restructuredtext.html#implicit-hyperlink-targets
1874     4. Using substitutions? ::
1876            .. |reST| acronym:: reST
1877               :text: reStructuredText
1879     What do we do for other formats than HTML which do not support
1880     tool tips?  Put the full text in parentheses?
1882   - "figure", "table", "listing", "chapter", "page", etc: See `object
1883     numbering and object references`_ above.
1885   - "glossary-term": This would establish a link to a glossary.  It
1886     would require an associated "glossary-entry" directive, whose
1887     contents could be a definition list::
1889         .. glossary-entry::
1891            term1
1892                definition1
1893            term2
1894                definition2
1896     This would allow entries to be defined anywhere in the document,
1897     and collected (via a "glossary" directive perhaps) at one point.
1900 Doctree pruning
1901 ---------------
1903 The number of doctree nodes can be reduced by "normalizing" some related
1904 nodes. This makes the document model and the writers somewhat simpler.
1906 * The "doctest" element should go away.  The construct could simply be
1907   a front-end to generic literal blocks.  We could immediately (in 0.7)
1908   remove the doctest node from the doctree, but leave the
1909   syntax in reST.  The reST parser could represent doctest blocks as
1910   literal blocks with a class attribute.  The syntax could be left in
1911   reST (for a set period of time?).
1913 * "Normalize" special admonitions (note, hint, warning, ...) during parsing
1914   (similar to _`transforms.writer_aux.Admonitions`). There is no need to
1915   keep them as distinct elements in the doctree specification.
1917   Keep the special admonition directives in reStructuredText syntax?
1920 Unimplemented Transforms
1921 ========================
1923 * _`Footnote & Citation Gathering`
1925   Collect and move footnotes & citations to the end of a document or the
1926   place of a "footnotes" or "citations" directive
1927   (see `<./ref/rst/directives.html>_`)
1929   Footnotes:
1930     Collect all footnotes that are referenced in the document before the
1931     directive (and after an eventually preceding ``.. footnotes::``
1932     directive) and insert at this place.
1934     Allows "endnotes" at a configurable place.
1936   Citations:
1937     Collect citations that are referenced ...
1939     Citations can be:
1941     a) defined in the document as citation elements
1943     b) auto-generated from entries in a bibliographic database.
1945        + based on bibstuff_?
1946        + also have a look at
1948          * CrossTeX_, a backwards-compatible, improved bibtex
1949            re-implementation in Python (including HTML export).
1950            (development stalled since 2 years)
1952          * Pybtex_,a drop-in replacement for BibTeX written in Python.
1954            * BibTeX styles & (experimental) pythonic style API.
1955            * Database in BibTeX, BibTeXML and YAML formats.
1956            * full Unicode support.
1957            * Write to TeX, HTML and plain text.
1959          * `Zotero plain <http://e6h.org/%7Eegh/hg/zotero-plain/>`__
1960            supports Zotero databases and CSL_ styles with Docutils with an
1961            ``xcite`` role.
1963          * `sphinxcontrib-bibtex`_ Sphinx extension with "bibliography"
1964            directive and "cite" role supporting BibTeX databases.
1966          * `Modified rst2html
1967            <http://www.loria.fr/~rougier/coding/article/rst2html.py>`__ by
1968            Nicolas Rougier.
1971     * Automatically insert a "References" heading?
1973 .. _CrossTeX: http://www.cs.cornell.edu/people/egs/crosstex/
1974 .. _Pybtex:   http://pybtex.sourceforge.net/
1975 .. _CSL: http://www.citationstyles.org/
1976 .. _sphinxcontrib-bibtex: http://sphinxcontrib-bibtex.readthedocs.org/
1978 * _`Reference Merging`
1980   When merging two or more subdocuments (such as docstrings),
1981   conflicting references may need to be resolved.  There may be:
1983   * duplicate reference and/or substitution names that need to be made
1984     unique; and/or
1985   * duplicate footnote numbers that need to be renumbered.
1987   Should this be done before or after reference-resolving transforms
1988   are applied?  What about references from within one subdocument to
1989   inside another?
1991 * _`Document Splitting`
1993   If the processed document is written to multiple files (possibly in
1994   a directory tree), it will need to be split up.  Internal references
1995   will have to be adjusted.
1997   (HTML only?  Initially, yes.  Eventually, anything should be
1998   splittable.)
2000   Ideas:
2002   - Insert a "destination" attribute into the root element of each
2003     split-out document, containing the path/filename.  The Output
2004     object or Writer will recognize this attribute and split out the
2005     files accordingly.  Must allow for common headers & footers,
2006     prev/next, breadcrumbs, etc.
2008   - Transform a single-root document into a document containing
2009     multiple subdocuments, recursively.  The content model of the
2010     "document" element would have to change to::
2012         <!ELEMENT document
2013             ( (title, subtitle?)?,
2014               decoration?,
2015               (docinfo, transition?)?,
2016               %structure.model;,
2017               document* )>
2019     (I.e., add the last line -- 0 or more document elements.)
2021     Let's look at the case of hierarchical (directories and files)
2022     HTML output.  Each document element containing further document
2023     elements would correspond to a directory (with an index.html file
2024     for the content preceding the subdocuments).  Each document
2025     element containing no subdocuments (i.e., structure model elements
2026     only) corresponds to a concrete file with no directory.
2028     The natural transform would be to map sections to subdocuments,
2029     but possibly only a given number of levels deep.
2031 * _`Navigation`
2033   If a document is split up, each segment will need navigation links:
2034   parent, children (small TOC), previous (preorder), next (preorder).
2035   Part of `Document Splitting`_?
2037 * _`List of System Messages`
2039   The ``system_message`` elements are inserted into the document tree,
2040   adjacent to the problems themselves where possible.  Some (those
2041   generated post-parse) are kept until later, in
2042   ``document.messages``, and added as a special final section,
2043   "Docutils System Messages".
2045   Docutils could be made to generate hyperlinks to all known
2046   system_messages and add them to the document, perhaps to the end of
2047   the "Docutils System Messages" section.
2049   Fred L. Drake, Jr. wrote:
2051       I'd like to propose that both parse- and transformation-time
2052       messages are included in the "Docutils System Messages" section.
2053       If there are no objections, I can make the change.
2055   The advantage of the current way of doing things is that parse-time
2056   system messages don't require a transform; they're already in the
2057   document.  This is valuable for testing (unit tests,
2058   tools/quicktest.py).  So if we do decide to make a change, I think
2059   the insertion of parse-time system messages ought to remain as-is
2060   and the Messages transform ought to move all parse-time system
2061   messages (remove from their originally inserted positions, insert in
2062   System Messages section).
2064 * _`Index Generation`
2067 HTML Writer
2068 ===========
2070 * Make it easier to find out fragment names (#foo-bar) of ``_`inline
2071   targets```.  Currently you have to either look at the source or
2072   guess the fragment.
2074   For example, we could add support for self-referencing targets
2075   (i.e. inline targets would [unobtrusively] link to themselves, so
2076   that you can just click them and then copy the address).  Or we
2077   could add support for titles that display the fragment name (as in
2078   <http://subversion.tigris.org/mailing-list-guidelines.html>; just
2079   hover the paragraphs).
2081   Either way it should be optional and deactivated by default.
2083   This would be useful for documents like Docutils' bug list or to-do
2084   list.
2086 * Make the _`list compacting` logic more generic: For example, allow
2087   for literal blocks or line blocks inside of compact list items.
2089   This is not implementable as long as list compacting is done by
2090   omitting ``<p>`` tags.  List compacting would need to be done by
2091   adjusting CSS margins instead.
2093   :2015-04-02: The new html writer no longer strips <p> tags but adds the
2094                class value ``simple`` to the list.
2095                Formatting is done by CSS --- configurable by a custom style
2096                sheet.
2098                Auto-compactization can be overridden by the ``open`` vs.
2099                ``compact`` class arguments.
2101 * Idea for field-list rendering: hanging indent::
2103       Field name (bold): First paragraph of field body begins
2104           with the field name inline.
2106           If the first item of a field body is not a paragraph,
2107           it would begin on the following line.
2109   :2015-04-02: The new html writer writes field-lists as definition lists
2110                with class ``field-list``.
2111                Formatting is done by CSS --- configurable by a custom style
2112                sheet. The default style sheet has some examples, including a
2113                run-in field-list style.
2115 * Add more support for <link> elements, especially for navigation
2116   bars.
2118   The framework does not have a notion of document relationships, so
2119   probably raw.destination_ should be used.
2121   We'll have framework support for document relationships when support
2122   for `multiple output files`_ is added.  The HTML writer could
2123   automatically generate <link> elements then.
2125   .. _raw.destination: misc.raw_
2127 * Base list compaction on the spacing of source list?  Would require
2128   parser support.  (Idea: fantasai, 16 Dec 2002, doc-sig.)
2130 * Add a tool tip ("title" attribute?) to footnote back-links
2131   identifying them as such.  Text in Docutils language module.
2134 PEP/HTML Writer
2135 ===============
2137 * Remove the generic style information (duplicated from html4css1.css)
2138   from pep.css to avoid redundancy.
2140   Set ``stylesheet-path`` to "html4css.css,pep.css" and the
2141   ``stylesheet-dirs`` accordingly instead. (See the xhtml11 writer for an
2142   example.)
2145 S5/HTML Writer
2146 ==============
2148 * Add a way to begin an untitled slide.
2150 * Add a way to begin a new slide, continuation, using the same title
2151   as the previous slide?  (Unnecessary?)  You need that if you have a
2152   lot of items in one section which don't fit on one slide.
2154   Maybe either this item or the previous one can be realized using
2155   transitions.
2157 * Have a timeout on incremental items, so the colour goes away after 1
2158   second.
2160 * Add an empty, black last slide (optionally).  Currently the handling
2161   of the last slide is not very nice, it re-cycles through the
2162   incremental items on the last slide if you hit space-bar after the
2163   last item.
2165 * Add a command-line option to disable advance-on-click.
2167 * Add a speaker's master document, which would contain a small version
2168   of the slide text with speaker's notes interspersed.  The master
2169   document could use ``target="whatever"`` to direct links to a
2170   separate window on a second monitor (e.g., a projector).
2172   .. Note:: This item and the following items are partially
2173      accomplished by the S5 1.2 code (currently in alpha), which has
2174      not yet been integrated into Docutils.
2176 * Speaker's notes -- how to intersperse?  Could use reST comments
2177   (".."), but make them visible in the speaker's master document.  If
2178   structure is necessary, we could use a "comment" directive (to avoid
2179   nonsensical DTD changes, the "comment" directive could produce an
2180   untitled topic element).
2182   The speaker's notes could (should?) be separate from S5's handout
2183   content.
2185 * The speaker's master document could use frames for easy navigation:
2186   TOC on the left, content on the right.
2188   - It would be nice if clicking in the TOC frame simultaneously
2189     linked to both the speaker's notes frame and to the slide window,
2190     synchronizing both.  Needs JavaScript?
2192   - TOC would have to be tightly formatted -- minimal indentation.
2194   - TOC auto-generated, as in the PEP Reader.  (What if there already
2195     is a "contents" directive in the document?)
2197   - There could be another frame on the left (top-left or bottom-left)
2198     containing a single "Next" link, always pointing to the next slide
2199     (synchronized, of course).  Also "Previous" link?  FF/Rew go to
2200     the beginning of the next/current parent section?  First/Last
2201     also?  Tape-player-style buttons like ``|<<  <<  <  >  >>  >>|``?
2203 Epub/HTML Writer
2204 ================
2206 Add epub as an output format.
2208   epub is an open file format for ebooks based on HTML, specified by the
2209   `International Digital Publishing Forum`_. Thus, documents in epub
2210   format are suited to be read with `electronic reading devices`_.
2212 Pack the output of a HTML writer and supporting files (e.g. images)
2213 into one single epub document.
2215 There are `links to two 3rd party ePub writers`__ in the Docutils link list.
2216 Test and consider moving the better one into the docutils core.
2218 __ ../user/links.html#ePub
2219 .. _International Digital Publishing Forum: http://www.idpf.org/
2220 .. _electronic reading devices:
2221    http://en.wikipedia.org/wiki/List_of_e-book_readers
2224 LaTeX writer
2225 ============
2227 Also see the Problems__ section in the `latex writer documentation`_.
2229 __ ../user/latex.html#problems
2231 .. _latex writer documentation: ../user/latex.html
2233 .. _latex-variants:
2234    ../../../sandbox/latex-variants/README.html
2236 Bug fixes
2237 ---------
2239 * A multirow cell in a table expects empty cells in the spanned rows while
2240   the doctree contains only the remaining cells ("Exchange Table Model", see
2241   docs/ref/soextblx.dtd).
2243   Needs bookkeeping of "open" multirow cells (how many how long) and
2244   insertion of additional '&'s.
2246   See `<../../test/functional/input/data/latex.txt>`__
2248 * Too deeply nested lists fail: generate a warning and provide
2249   a workaround.
2251 * Spaces in inline literal text::
2253     Now note    the
2254     spacing    between the    words of    this sentence    (words
2255     should    be grouped    in pairs).
2257   Discuss the desired behaviour and implement a consistent one.
2259 * An enumerated list in the docinfo fails (\newcounter definition inside
2260   tabularx).
2262 * File names of included graphics (see also `grffile` package).
2264 Generate clean and configurable LaTeX source
2265 ----------------------------------------------
2267 * Check the generated source with package `nag`.
2269 Configurable placement of figure and table floats
2270 `````````````````````````````````````````````````
2272 * Special class argument to individually place figures?
2274   Either:
2276     placement-<optional arg>  -> \figure[<optional arg>]{...}
2278   e.g. ``.. class::  placement-htb``,
2280   or more verbose:
2282   :H: place-here
2283   :h: place-here-if-possible
2284   :t: place-top
2285   :b: place-bottom
2286   :p: place-on-extra-page
2288   e.g.: ``.. class:: place-here-if-possible place-top place-bottom``
2290   Maybe support both variants?
2293 LaTeX constructs and packages instead of re-implementations
2294 ```````````````````````````````````````````````````````````
2296 Which packages do we want to use?
2298   + base and "recommended" packages
2300     (packages that should be in a "reasonably sized and reasonably modern
2301     LaTeX installation like the `texlive-latex-recommended` Debian package,
2302     say):
2304   + No "fancy" or "exotic" requirements.
2306   + pointers to advanced packages and their use in the `latex writer
2307     documentation`_.
2309 * ``alltt`` environment for literal block.
2311 * footnotes
2313   + True footnotes with LaTeX auto-numbering (as option ``--latex-footnotes``)
2314     (also for target-footnotes):
2316     - attach footnote text to footnote-symobol node
2317     - write \footnote{<footnote text>}
2318     - consider cases where LaTeX does not support footnotes
2319       (inside tables, headings, ...)?
2320     - consider multiple footnote refs to common footnote text.
2322     .. Quote:
2324      If the symbol you want is not one of the ones listed, you'll need to
2325      redefine ``\@fnsymbol`` and add it, e.g. perhaps like::
2327       \def\@fnsymbol#1{\ifcase#1\hbox{}\or *\or \dagger\or \ddagger\or
2328       \mathchar "278\or \mathchar "27B\or \|\or **\or \dagger\dagger \or
2329       \ddagger\ddagger \or \mathchar"27C \else\@ctrerr\fi\relax}
2331      which would allow \symbolfootnote[10]{footnote} to have a club as its
2332      mark.
2334   + document customization (links to how-to and packages):
2336   .. Footnote packages:
2338      :footnote: texlive-latex-recommended % savenotes environment
2339      :footmisc: texlive-latex-extra       % formatting options
2340      :manyfoot: texlive-latex-extra
2341      :bigfoot: texlive-latex-extra
2342      :perpage: texlive-latex-extra
2343      :ftnxtra: new on CTAN
2344                fixes the issue of footnote inside \caption{},
2345                tabular environment and \section{} like commands.
2348      German tutorial:
2349      http://www2.informatik.hu-berlin.de/~ahamann/studies/footnotes.pdf
2351   .. Footnote FAQs:
2353      `Footnotes whose texts are identical
2354      <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=repfootnote>`__
2356      * label per hand or use footmisc
2358      `More than one sequence of footnotes
2359      <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=multfoot>`__
2361      * manyfoot, bigfoot
2363      `Footnotes in tables
2364      <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=footintab>`__
2366      * `tabularx` and longtable allow footnotes.
2367      * `footnote` provides a "savenotes" environment which collects all
2368        footnotes and emits them at ``end{savenotes}``
2370      `Footnotes in LaTeX section headings
2371      <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ftnsect>`__
2373      * Take advantage of the fact that the mandatory argument doesn't
2374        move if the optional argument is present::
2376            \section[title] {title\footnote{title ftnt}}
2378      * Use the footmisc package, with package option stable - this modifies
2379        footnotes so that they softly and silently vanish away if used in a
2380        moving argument.
2382      * Use ftnxtra.
2384      `Footnotes numbered per page
2385      <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=footnpp>`__
2387      * perpage provides a general mechanism for resetting counters per page
2388      * footmisc provides a package option perpage
2390 * use `eqlist` or `enumitem` (texlive-latex-extra) for field-lists?
2392 * ``--use-latex-when-possible`` »super option« that would set the
2393   following::
2395       --no-section-numbering
2396       --use-latex-toc
2397       --use-latex-docinfo
2398       --use-latex-abstract
2399       --use-latex-footnotes
2400       --use-latex-citations
2402    ? (My preference is to default to use-latex-* whenever possible [GM])
2405 Default layout
2406 --------------
2408 * Use italic instead of slanted for titlereference?
2410 * Start a new paragraph after lists (as currently)
2411   or continue (no blank line in source, no parindent in output)?
2413   Overriding:
2415   * continue if the `compound paragraph`_ directive is used, or
2416   * force a new paragraph with an empty comment.
2418 * Sidebar handling (environment with `framed`, `marginnote`, `wrapfig`,
2419   ...)?
2421 * Use optionlist for docinfo?
2423 * Keep literal-blocks together on a page, avoid pagebreaks.
2425   Failed experiments up to now: samepage, minipage, pagebreak 1 to 4 before
2426   the block.
2428   Should be possible with ``--literal-block-env==lstlistings`` and some
2429   configuration...
2431 * More space between title and subtitle? ::
2433      -  \\ % subtitle%
2434      +  \\[0.5em] % subtitle%
2436 .. _PSNFSS documentation:
2437    http://mirror.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf
2438 .. _compound paragraph:
2439    ../ref/rst/directives.html#compound-paragraph
2440 .. _fixltx2e:
2441    http://mirror.ctan.org/help/Catalogue/entries/fixltx2e.html
2443 Tables
2444 ``````
2446 * Improve/simplify logic to set the column width in the output.
2448   + Assumed reST line length for table width setting configurable, or
2449   + use `ltxtable` (a combination of `tabularx` (auto-width) and
2450     `longtable` (page breaks)), or
2451   + use tabularx column type ``X`` and let LaTeX decide width, or
2452   + use tabulary_?
2454   .. _tabulary:
2455      http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=tabulary
2457 * From comp.text.tex (13. 4. 2011):
2459     When using fixed width columns, you should ensure that the total
2460     width does not exceed \linewidth: if the first column is p{6cm}
2461     the second one should be p{\dimexpr\linewidth-6cm-4\tabcolsep}
2462     because the glue \tabcolsep is added twice at every column edge.
2463     You may also consider to set \tabcolsep to a different value...
2465 * csv-tables do not have a colwidth.
2467 * Add more classes or options, e.g. for
2469   + column width set by latex,
2470   + horizontal alignment and rules.
2471   + long table vs. tabular (see next item).
2473 * Use tabular instead of longtable for tables in legends or generally
2474   inside a float?
2476   Alternatively, default to tabular and use longtable only if specified
2477   by config setting or class argument (analogue to booktable)?
2479 * Table heads and footer for longtable (firstpage lastpage ..)?
2481 * In tools.txt the option tables right column, there should be some more
2482   spacing between the description and the next paragraph "Default:".
2484 * Paragraph separation in tables is hairy.
2485   see http://www.tex.ac.uk/cgi-bin/texfaq2html?label=struttab
2487   - The strut solution did not work.
2488   - setting extrarowheight added ad top of row not between paragraphs in
2489     a cell. ALTHOUGH i set it to 2pt because, text is too close to the topline.
2490   - baselineskip/stretch does not help.
2492 * Should there be two hlines after table head and on table end?
2494 * Place titled tables in a float ('table' environment)?
2496   The 'table', 'csv-table', and 'list-table' directives support an (optional)
2497   table title. In analogy to the 'figure' directive this should map to a
2498   table float.
2500 Image and figure directives
2501 ```````````````````````````
2503 * compare the test case in:
2505   + `<../../test/functional/input/data/standard.txt>`__
2506   + `<../../test/functional/expected/standalone_rst_html4css1.html>`__
2507   + `<../../test/functional/expected/standalone_rst_latex.tex>`__
2509 * According to the HTML standard
2510   http://www.w3.org/TR/html4/struct/objects.html#adef-align-IMG a right- or
2511   left-aligned image should be floated alongside the paragraph.
2513   + Use this default also for LaTeX?
2515   + Wrap text around figures/images with class argument "wrap"
2516     (like the odt writer)?
2518   Use `wrapfig` (or other recommended) package.
2520 * support more graphic formats (especially SVG, the only standard
2521   vector format for HTML)
2523   There is a `SWF package`_ at CTAN.
2525 .. _SWF package:
2526    http://mirror.ctan.org/macros/latex/contrib/flashmovie
2529 Missing features
2530 ----------------
2532 * support "figwidth" argument for figures.
2534   As the 'figwidth' argument is still ignored and the "natural width" of
2535   a figure in LaTeX is 100 % of the text width, setting the 'align'
2536   argument has currently no effect on the LaTeX output.
2539 * Let `meta` directive insert PDF-keywords into header?
2541 * Multiple author entries in docinfo (same thing as in html).
2542   (already solved?)
2544 * Consider supporting the "compact" option and class argument (from
2545   rst2html) as some lists look better compact and others need the space.
2547 * Better citation support
2548   (see `Footnote & Citation Gathering`_).
2550 * If ``use-latex-citations`` is used, a bibliography is inserted right at the
2551   end of the document.
2553   Put in place of the to-be-implemented "citations" directive
2554   (see `Footnote & Citation Gathering`_).
2557 Unicode to LaTeX
2558 ````````````````
2560 The `LyX <http://www.lyx.org>`_ document processor has a comprehensive
2561 Unicode to LaTeX conversion feature with a file called ``unicodesymbols``
2562 that lists LaTeX counterparts for a wide range of Unicode characters.
2564 * Use this in the LaTeXTranslator?
2565   Think of copyright issues!
2567 * The "ucs" package has many translations in ...doc/latex/ucs/config/
2569 * The bibstuff_ tool ships a `latex_codec` Python module!
2571 .. _bibstuff: http://code.google.com/p/bibstuff/
2573 Allow choice between utf8 (standard) and utf8x (extended) encodings
2574 ```````````````````````````````````````````````````````````````````
2576 * Allow the user to select *utf8* or *utf8x* LaTeX encoding. (Docutil's
2577   output encoding becomes LaTeX's input encoding.)
2579 The `ucs` package provides extended support for UTF-8 encoding in LaTeX
2580 via the `inputenc`-option ``utf8x``.  It is, however, a non-standard
2581 extension and no longer developed.
2583 Ideas:
2584   a) Python has 4 names for the UTF-8 encoding (``utf_8, U8, UTF, utf8``)
2585      give a special meaning to one of the aliases,
2587   b) scan "stylesheets" and "latex-preamble" options and use ``utf8x``
2588      if it contains ``ucs``
2590 XeTeX writer
2591 ````````````
2593 * Glyphs missing in the font are left out in the PDF without warning
2594   (e.g. ⇔ left-right double arrow in the functional test output).
2596 * Disable word-wrap (hyphenation) in literal text locally with
2597   ``providecommand{\nohyphenation}{\addfontfeatures{HyphenChar=None}}``?
2600 problematic URLs
2601 ````````````````
2603 * ^^ LaTeX's special syntax for characters results in "strange" replacements
2604   (both with \href and \url).
2606   `file with ^^ <../strange^^name>`__:
2607   `<../strange^^name>`__
2609 * Unbalanced braces, { or }, will fail (both with \href and \url)::
2611     `file with { <../strange{name>`__
2612     `<../strange{name>`__
2614 Currently, a warning is written to the error output stream.
2616 For correct printing, we can
2618 * use the \href command with "normal" escaped name argument, or
2619 * define a url-command in the preamble ::
2621     \urldef{\fragileURLi}\nolinkurl{myself%node@gateway.net}
2623 but need to find a way to insert it as href argument.
2625 The following fails::
2627     \href{http://www.w3.org/XML/Schema^^dev}{\fragileURLi}
2629 Use %-replacement like http://nowhere/url_with%28parens%29 ?
2631 -> does not work for file paths (with pdflatex and xpdf).
2634 add-stylesheet option
2635 `````````````````````
2637 From http://article.gmane.org/gmane.text.docutils.devel/3429/
2639 The problem is that since we have a default value, we have to
2640 differentiate between adding another stylesheet and replacing the
2641 default.  I suggest that the existing --stylesheet & --stylesheet-path
2642 options keep their semantics to replace the existing settings.  We
2643 could introduce new --add-stylesheet & --add-stylesheet-path options,
2644 which accumulate; further --stylesheet/--stylesheet-path options would
2645 clear these lists.  The stylesheet or stylesheet_path setting (only
2646 one may be set), plus the added_stylesheets and added_stylesheet_paths
2647 settings, describe the combined styles.
2649 For example, this run will have only one custom stylesheet:
2651     rstpep2html.py --stylesheet-path custom.css ...
2653 This run will use the default stylesheet, and the custom one:
2655     rstpep2html.py --add-stylesheet-path custom.css ...
2657 This run will use the default stylesheet, a custom local stylesheet,
2658 and an external stylesheet:
2660     rstpep2html.py --add-stylesheet-path custom.css \
2661         --add-stylesheet http://www.example.org/external.css ...
2663 This run will use only the second custom stylesheet:
2665     rstpep2html.py --add-stylesheet-path custom.css \
2666         --stylesheet-path second.css ...
2671 Front-End Tools
2672 ===============
2674 * What about if we don't know which Reader and/or Writer we are
2675   going to use?  If the Reader/Writer is specified on the
2676   command-line?  (Will this ever happen?)
2678   Perhaps have different types of front ends:
2680   a) _`Fully qualified`: Reader and Writer are hard-coded into the
2681      front end (e.g. ``pep2html [options]``, ``pysource2pdf
2682      [options]``).
2684   b) _`Partially qualified`: Reader is hard-coded, and the Writer is
2685      specified a sub-command (e.g. ``pep2 html [options]``,
2686      ``pysource2 pdf [options]``).  The Writer is known before option
2687      processing happens, allowing the OptionParser to be built
2688      dynamically.  Alternatively, the Writer could be hard-coded and
2689      the Reader specified as a sub-command (e.g. ``htmlfrom pep
2690      [options]``).
2692   c) _`Unqualified`: Reader and Writer are specified as subcommands
2693      (e.g. ``publish pep html [options]``, ``publish pysource pdf
2694      [options]``).  A single front end would be sufficient, but
2695      probably only useful for testing purposes.
2697   d) _`Dynamic`: Reader and/or Writer are specified by options, with
2698      defaults if unspecified (e.g. ``publish --writer pdf
2699      [options]``).  Is this possible?  The option parser would have
2700      to be told about new options it needs to handle, on the fly.
2701      Component-specific options would have to be specified *after*
2702      the component-specifying option.
2704   Allow common options before subcommands, as in CVS?  Or group all
2705   options together?  In the case of the `fully qualified`_
2706   front ends, all the options will have to be grouped together
2707   anyway, so there's no advantage (we can't use it to avoid
2708   conflicts) to splitting common and component-specific options
2709   apart.
2711 * Parameterize help text & defaults somehow?  Perhaps a callback?  Or
2712   initialize ``settings_spec`` in ``__init__`` or ``init_options``?
2714 * Disable common options that don't apply?
2715   (This should now be easier with ``frontend.filter_settings_spec``.)
2717 * Add ``--section-numbering`` command line option.  The "sectnum"
2718   directive should override the ``--no-section-numbering`` command
2719   line option then.
2721 * Create a single dynamic_ or unqualified_ front end that can be
2722   installed?
2726    Local Variables:
2727    mode: indented-text
2728    indent-tabs-mode: nil
2729    sentence-end-double-space: t
2730    fill-column: 70
2731    End: