| 1 |
====================== |
| 2 |
Docutils_ To Do List |
| 3 |
====================== |
| 4 |
|
| 5 |
:Author: David Goodger (with input from many); open to all Docutils |
| 6 |
developers |
| 7 |
:Contact: [email protected] |
| 8 |
:Date: $Date$ |
| 9 |
:Revision: $Revision$ |
| 10 |
:Copyright: This document has been placed in the public domain. |
| 11 |
|
| 12 |
.. _Docutils: https://docutils.sourceforge.io/ |
| 13 |
|
| 14 |
.. contents:: |
| 15 |
|
| 16 |
|
| 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. |
| 20 |
|
| 21 |
Many of these items are awaiting champions. If you see something |
| 22 |
you'd like to tackle, please do! |
| 23 |
Please see also the Bugs_ document for a list of bugs in Docutils. |
| 24 |
|
| 25 |
.. _bugs: ../../BUGS.html |
| 26 |
|
| 27 |
|
| 28 |
Minimum Requirements for Python Standard Library Candidacy |
| 29 |
========================================================== |
| 30 |
|
| 31 |
Below are action items that must be added and issues that must be |
| 32 |
addressed before Docutils can be considered suitable to be proposed |
| 33 |
for inclusion in the Python standard library. |
| 34 |
|
| 35 |
Many of these are now handled by Sphinx_ |
| 36 |
|
| 37 |
* Support for `document splitting`_. May require some major code |
| 38 |
rework. |
| 39 |
|
| 40 |
* Support for subdocuments (see `large documents`_). |
| 41 |
|
| 42 |
* `Object numbering and object references`_. |
| 43 |
|
| 44 |
* `Nested inline markup`_. |
| 45 |
|
| 46 |
* `Python Source Reader`_. |
| 47 |
|
| 48 |
* The HTML writer needs to be rewritten (or a second HTML writer |
| 49 |
added) to allow for custom classes, and for arbitrary splitting |
| 50 |
(stack-based?). |
| 51 |
|
| 52 |
* Documentation_ of the architecture. Other docs too. |
| 53 |
|
| 54 |
* Plugin support. |
| 55 |
|
| 56 |
* Suitability for `Python module documentation |
| 57 |
<https://docutils.sourceforge.io/sandbox/README.html#documenting-python>`_. |
| 58 |
|
| 59 |
.. _Sphinx: http://www.sphinx-doc.org/ |
| 60 |
|
| 61 |
Repository |
| 62 |
========== |
| 63 |
|
| 64 |
Move to a Git repository. |
| 65 |
|
| 66 |
* This is a long standing `feature request`__ |
| 67 |
(with pointers to Sphinx issues and discussion). |
| 68 |
|
| 69 |
__ https://sourceforge.net/p/docutils/feature-requests/58/ |
| 70 |
|
| 71 |
* From a `post by David Goodger`__ |
| 72 |
|
| 73 |
An absolute requirement, for me, is that such a change be complete. |
| 74 |
We can't lose any data or have to refer to the old system as an |
| 75 |
"archive". So all the SVN history, all branches, and the full sandbox |
| 76 |
need to be converted at the same time. |
| 77 |
|
| 78 |
__ https://sourceforge.net/p/docutils/mailman/message/31878077/ |
| 79 |
|
| 80 |
Convert with reposurgeon_? |
| 81 |
|
| 82 |
If you are doing a full import rather than gatewaying, reposurgeon is |
| 83 |
probably what you want. It has been tested against a lot of large, old, |
| 84 |
nasty repositories and is thus known to be robust in the presence of |
| 85 |
repository malformations (a property regularly checked by a test suite |
| 86 |
that is a rogue's gallery of Subversion botches). |
| 87 |
|
| 88 |
-- `Git Wiki`__ |
| 89 |
|
| 90 |
The comprehensive `Reposurgeon documentation`_ comes with |
| 91 |
`a guide to repository conversion`__ |
| 92 |
as well as info about `reading Subversion repositories`__. |
| 93 |
Converting from an SVN dump file is faster than from a checkout. |
| 94 |
|
| 95 |
.. _reposurgeon: http://www.catb.org/esr/reposurgeon/ |
| 96 |
.. _reposurgeon documentation: |
| 97 |
http://www.catb.org/esr/reposurgeon/repository-editing.html |
| 98 |
__ https://git.wiki.kernel.org/index.php/ |
| 99 |
Interfaces,_frontends,_and_tools#Subversion |
| 100 |
__ http://www.catb.org/esr/reposurgeon/repository-editing.html#conversion |
| 101 |
__ http://www.catb.org/esr/reposurgeon/repository-editing.html |
| 102 |
#_reading_subversion_repositories |
| 103 |
|
| 104 |
|
| 105 |
Adam Turner wrote a conversion Makefile and ``.lift`` scripts that |
| 106 |
downloads the repo from SF with rsync, converts it to a SVN mirror and |
| 107 |
finally to Git, splitting sandbox, prest, and web from docutils. |
| 108 |
|
| 109 |
|
| 110 |
Sourceforge supports multiple Git repositories per project, so we can |
| 111 |
switch the version control system independent of the decision on an |
| 112 |
eventual switch of the host. |
| 113 |
Cf. https://sourceforge.net/p/forge/documentation/Git/ |
| 114 |
|
| 115 |
|
| 116 |
General |
| 117 |
======= |
| 118 |
|
| 119 |
Miscellaneous |
| 120 |
------------- |
| 121 |
|
| 122 |
Code cleanup and modernization: |
| 123 |
Use flake8_? See also the configuration in `<../../tox.ini>`__. |
| 124 |
|
| 125 |
Check and solve issue from :PEP:`290` - Code Migration and Modernization. |
| 126 |
(Covers issues up to Python 2.4, is there an equivalent for more recent |
| 127 |
modernizations?) |
| 128 |
|
| 129 |
Ensure `backwards compatibility`_! |
| 130 |
|
| 131 |
.. _flake8: https://pypi.org/project/flake8/ |
| 132 |
.. _backwards compatibility: policies.html#backwards-compatibility-policy |
| 133 |
|
| 134 |
* Encoding of command line arguments can only be guessed: |
| 135 |
|
| 136 |
* try UTF-8/strict first, then try the locale's encoding with |
| 137 |
strict error handling, then ASCII/replace? |
| 138 |
|
| 139 |
UTF-8 is almost 100% safe to try first; false positives are rare, |
| 140 |
The locale's encoding with strict error handling may be a |
| 141 |
reasonable compromise, but any error would indicate that the |
| 142 |
locale's encoding is inappropriate. The only safe fallback is |
| 143 |
ASCII/replace. |
| 144 |
|
| 145 |
* Do not decode argv before option parsing but individual string |
| 146 |
values? |
| 147 |
|
| 148 |
+1 Allows for separate command-line vs. filesystem encodings, |
| 149 |
respectively to keep file names encoded. |
| 150 |
+1 Allows to configure command-line encoding in a config file, |
| 151 |
-1 More complicated. |
| 152 |
|
| 153 |
Cf. <http://thread.gmane.org/gmane.text.docutils.user/2890/focus=2957>. |
| 154 |
|
| 155 |
* Improve handling on Windows: |
| 156 |
|
| 157 |
- Get graphical installer. |
| 158 |
- Make rst2html.py an .exe file using py2exe. |
| 159 |
|
| 160 |
* .. _GUI: |
| 161 |
|
| 162 |
The user interface is very difficult to use for most Windows users; |
| 163 |
you can't really expect them to use the command line. We need some |
| 164 |
kind of GUI that can launch rst2html.py, and save the HTML output to |
| 165 |
a file, and launch a browser. What's important is that we get |
| 166 |
settings to work with the GUI. So we need some way to dynamically |
| 167 |
generate a list of settings for the GUI. The current settings_spec |
| 168 |
for OptionParser doesn't seem to be usable for this for the |
| 169 |
following reasons: |
| 170 |
|
| 171 |
- It's biased toward the command line -- there are *two* options for |
| 172 |
one boolean setting. |
| 173 |
|
| 174 |
- You cannot have both a one-line description and a longer |
| 175 |
description for tooltips/help-texts. |
| 176 |
|
| 177 |
- It doesn't provide hints for the input type. You cannot easily |
| 178 |
infer the type of a setting from its validator, because any |
| 179 |
component can add new validators. In fact, it may be necessary to |
| 180 |
have both a hint about the input type (e.g. string) and a |
| 181 |
validator (valid ID), or it may be necessary to have a different |
| 182 |
set of choices for the CLI (1, INFO, 2, ...) and for the GUI |
| 183 |
(INFO, WARNING, ...). |
| 184 |
|
| 185 |
- It's coupled to the OptionParser. We want to be able to change |
| 186 |
the underlying system without breaking everything. |
| 187 |
|
| 188 |
- It's a bunch of primitive structures. We want an extensible (thus |
| 189 |
object-oriented) interface. |
| 190 |
|
| 191 |
So we probably need to create a class for storing all the settings, |
| 192 |
and auto-generate the OptionParser data from that. |
| 193 |
|
| 194 |
I talked to Stephan Deibel about getting Docutils integrated into |
| 195 |
Wing IDE. He said it's possible, and he'd be willing to help. |
| 196 |
There's a scripting interface to Wing, which we'd use. We can |
| 197 |
dynamically generate a list of preferences and not worry too much |
| 198 |
about the rendering (from what I understood); Wing's whole GUI is |
| 199 |
dynamic anyway. The interface could be made usable for other GUIs. |
| 200 |
For example, we could try to get option support for DocFactory. // |
| 201 |
FW |
| 202 |
|
| 203 |
* Allow different report levels for STDERR and system_messages inside |
| 204 |
the document? |
| 205 |
|
| 206 |
* Change the docutils-update script (in sandbox/infrastructure), to |
| 207 |
support arbitrary branch snapshots. |
| 208 |
|
| 209 |
* Move some general-interest sandboxes out of individuals' |
| 210 |
directories, into subprojects? |
| 211 |
|
| 212 |
* Add option for file (and URL) access restriction to make Docutils |
| 213 |
usable in Wikis and similar applications. |
| 214 |
|
| 215 |
2005-03-21: added ``file_insertion_enabled`` & ``raw_enabled`` |
| 216 |
settings. These partially solve the problem, allowing or disabling |
| 217 |
**all** file accesses, but not limited access. |
| 218 |
|
| 219 |
* Configuration_ file handling needs discussion: |
| 220 |
|
| 221 |
- There should be some error checking on the contents of config |
| 222 |
files. How much checking should be done? How loudly should |
| 223 |
Docutils complain if it encounters an error/problem? |
| 224 |
|
| 225 |
- Docutils doesn't complain when it doesn't find a configuration |
| 226 |
file supplied with the ``--config`` option. Should it? (If yes, |
| 227 |
error or warning?) |
| 228 |
|
| 229 |
* Internationalization: |
| 230 |
|
| 231 |
- I18n needs refactoring, the language dictionaries are difficult to |
| 232 |
maintain. Maybe have a look at gettext or similar tools. |
| 233 |
|
| 234 |
(This would make a nice Google Summer of Code project) |
| 235 |
|
| 236 |
- Language modules: in accented languages it may be useful to have |
| 237 |
both accented and unaccented entries in the |
| 238 |
``bibliographic_fields`` mapping for versatility. |
| 239 |
|
| 240 |
- Add a "--strict-language" option & setting: no English fallback |
| 241 |
for language-dependent features. |
| 242 |
|
| 243 |
Make this the default for output (as opposed to input)? |
| 244 |
Throw an error with a helpful message, e.g. |
| 245 |
|
| 246 |
Default "contents" title for language %s missing, please specify |
| 247 |
an explicit title. |
| 248 |
|
| 249 |
or |
| 250 |
|
| 251 |
"attention" title for language %s missing, please use a generic |
| 252 |
admonition with explicit title. |
| 253 |
|
| 254 |
- Add internationalization to _`footer boilerplate text` (resulting |
| 255 |
from "--generator", "--source-link", and "--date" etc.), allowing |
| 256 |
translations. |
| 257 |
|
| 258 |
|
| 259 |
* Add validation? See http://pytrex.sourceforge.net, RELAX NG, pyRXP. |
| 260 |
|
| 261 |
* In ``docutils.readers.get_reader_class`` (& ``parsers`` & |
| 262 |
``writers`` too), should we be importing "standalone" or |
| 263 |
"docutils.readers.standalone"? (This would avoid importing |
| 264 |
top-level modules if the module name is not in docutils/readers. |
| 265 |
Potential nastiness.) |
| 266 |
|
| 267 |
* Perhaps store a _`name-to-id mapping file`? This could be stored |
| 268 |
permanently, read by subsequent processing runs, and updated with |
| 269 |
new entries. ("Persistent ID mapping"?) |
| 270 |
|
| 271 |
* Perhaps the ``Component.supports`` method should deal with |
| 272 |
individual features ("meta" etc.) instead of formats ("html" etc.)? |
| 273 |
Currently, it is not used at all. |
| 274 |
|
| 275 |
Do we need it at all? Or rather let the writers just ignore some |
| 276 |
nodes (like we already do for "class" values)? |
| 277 |
|
| 278 |
The current implementation of the framework also leads to bug |
| 279 |
`bug #241`__ "doctree-based publishing != publish_string". |
| 280 |
The "components.Filter" transform is run by publish_doctree(). When |
| 281 |
filtering based on the output format, it should be run by |
| 282 |
publish_from_doctree() instead because only then the writer is |
| 283 |
known. |
| 284 |
|
| 285 |
So we need to either remove or fix the framework. |
| 286 |
|
| 287 |
__ https://sourceforge.net/p/docutils/bugs/241/ |
| 288 |
|
| 289 |
|
| 290 |
* Think about _`large documents` made up of multiple subdocument |
| 291 |
files. Issues: continuity (`persistent sequences`_ above), |
| 292 |
cross-references (`name-to-id mapping file`_ above and `targets in |
| 293 |
other documents`_ below), splitting (`document splitting`_ below). |
| 294 |
|
| 295 |
When writing a book, the author probably wants to split it up into |
| 296 |
files, perhaps one per chapter (but perhaps even more detailed). |
| 297 |
However, we'd like to be able to have references from one chapter to |
| 298 |
another, and have continuous numbering (pages and chapters, as |
| 299 |
applicable). Of course, none of this is implemented yet. There has |
| 300 |
been some thought put into some aspects; see `the "include" |
| 301 |
directive`__ and the `Reference Merging`_ transform below. |
| 302 |
|
| 303 |
When I was working with SGML in Japan, we had a system where there |
| 304 |
was a top-level coordinating file, book.sgml, which contained the |
| 305 |
top-level structure of a book: the <book> element, containing the |
| 306 |
book <title> and empty component elements (<preface>, <chapter>, |
| 307 |
<appendix>, etc.), each with filename attributes pointing to the |
| 308 |
actual source for the component. Something like this:: |
| 309 |
|
| 310 |
<book id="bk01"> |
| 311 |
<title>Title of the Book</title> |
| 312 |
<preface inrefid="pr01"></preface> |
| 313 |
<chapter inrefid="ch01"></chapter> |
| 314 |
<chapter inrefid="ch02"></chapter> |
| 315 |
<chapter inrefid="ch03"></chapter> |
| 316 |
<appendix inrefid="ap01"></appendix> |
| 317 |
</book> |
| 318 |
|
| 319 |
(The "inrefid" attribute stood for "insertion reference ID".) |
| 320 |
|
| 321 |
The processing system would process each component separately, but |
| 322 |
it would recognize and use the book file to coordinate chapter and |
| 323 |
page numbering, and keep a persistent ID to (title, page number) |
| 324 |
mapping database for cross-references. Docutils could use a similar |
| 325 |
system for large-scale, multipart documents. |
| 326 |
|
| 327 |
__ ../ref/rst/directives.html#including-an-external-document-fragment |
| 328 |
|
| 329 |
Aahz's idea: |
| 330 |
|
| 331 |
First the ToC:: |
| 332 |
|
| 333 |
.. ToC-list:: |
| 334 |
Introduction.txt |
| 335 |
Objects.txt |
| 336 |
Data.txt |
| 337 |
Control.txt |
| 338 |
|
| 339 |
Then a sample use:: |
| 340 |
|
| 341 |
.. include:: ToC.txt |
| 342 |
|
| 343 |
As I said earlier in chapter :chapter:`Objects.txt`, the |
| 344 |
reference count gets increased every time a binding is made. |
| 345 |
|
| 346 |
Which produces:: |
| 347 |
|
| 348 |
As I said earlier in chapter 2, the |
| 349 |
reference count gets increased every time a binding is made. |
| 350 |
|
| 351 |
The ToC in this form doesn't even need to be references to actual |
| 352 |
reST documents; I'm simply doing it that way for a minimum of |
| 353 |
future-proofing, in case I do want to add the ability to pick up |
| 354 |
references within external chapters. |
| 355 |
|
| 356 |
Perhaps, instead of ToC (which would overload the "contents" |
| 357 |
directive concept already in use), we could use "manifest". A |
| 358 |
"manifest" directive might associate local reference names with |
| 359 |
files:: |
| 360 |
|
| 361 |
.. manifest:: |
| 362 |
intro: Introduction.txt |
| 363 |
objects: Objects.txt |
| 364 |
data: Data.txt |
| 365 |
control: Control.txt |
| 366 |
|
| 367 |
Then the sample becomes:: |
| 368 |
|
| 369 |
.. include:: manifest.txt |
| 370 |
|
| 371 |
As I said earlier in chapter :chapter:`objects`, the |
| 372 |
reference count gets increased every time a binding is made. |
| 373 |
|
| 374 |
* Add support for _`multiple output files` and _`generic data |
| 375 |
handling`: |
| 376 |
|
| 377 |
It should be possible for a component to **emit or reference** data |
| 378 |
to be either **included or referenced** in the output document. |
| 379 |
Examples of such data are stylesheets or images. |
| 380 |
|
| 381 |
For this, we need a "data" object which stores the data either |
| 382 |
inline or by referring to a file. The Docutils framework is |
| 383 |
responsible for either: |
| 384 |
|
| 385 |
* storing the data in the appropriate location (e.g. in the |
| 386 |
directory of the output file, or in a user-specified directory) |
| 387 |
and providing the paths of the stored files to the writer, *or* |
| 388 |
|
| 389 |
* providing the data itself to the writer so that it can be embedded |
| 390 |
in the output document. |
| 391 |
|
| 392 |
This approach decouples data handling from the data source (which |
| 393 |
can either be embedded or referenced) and the destination (which can |
| 394 |
either be embedded or referenced as well). |
| 395 |
|
| 396 |
See <http://article.gmane.org/gmane.text.docutils.devel/3631>. |
| 397 |
|
| 398 |
* Add testing for Docutils' front end tools? |
| 399 |
|
| 400 |
* Publisher: "Ordinary setup" shouldn't require specific ordering; at |
| 401 |
the very least, there ought to be error checking higher up in the |
| 402 |
call chain. [Aahz] |
| 403 |
|
| 404 |
``Publisher.get_settings`` requires that all components be set up |
| 405 |
before it's called. Perhaps the I/O *objects* shouldn't be set, but |
| 406 |
I/O *classes*. Then options are set up (``.set_options``), and |
| 407 |
``Publisher.set_io`` (or equivalent code) is called with source & |
| 408 |
destination paths, creating the I/O objects. |
| 409 |
|
| 410 |
Perhaps I/O objects shouldn't be instantiated until required. For |
| 411 |
split output, the Writer may be called multiple times, once for each |
| 412 |
doctree, and each doctree should have a separate Output object (with |
| 413 |
a different path). Is the "Builder" pattern applicable here? |
| 414 |
|
| 415 |
* Perhaps I/O objects should become full-fledged components (i.e. |
| 416 |
subclasses of ``docutils.Component``, as are Readers, Parsers, and |
| 417 |
Writers now), and thus have associated option/setting specs and |
| 418 |
transforms. |
| 419 |
|
| 420 |
* Multiple file I/O suggestion from Michael Hudson: use a file-like |
| 421 |
object or something you can iterate over to get file-like objects. |
| 422 |
|
| 423 |
* Add an "--input-language" option & setting? Specify a different |
| 424 |
language module for input (bibliographic fields, directives) than |
| 425 |
for output. The "--language" option would set both input & output |
| 426 |
languages. |
| 427 |
|
| 428 |
* Auto-generate reference tables for language-dependent features? |
| 429 |
Could be generated from the source modules. A special command-line |
| 430 |
option could be added to Docutils front ends to do this. (Idea from |
| 431 |
Engelbert Gruber.) |
| 432 |
|
| 433 |
* Enable feedback of some kind from internal decisions, such as |
| 434 |
reporting the successful input encoding. Modify runtime settings? |
| 435 |
System message? Simple stderr output? |
| 436 |
|
| 437 |
* Rationalize Writer settings (HTML/LaTeX/PEP) -- share settings. |
| 438 |
|
| 439 |
* Add an "--include file" command-line option (config setting too?), |
| 440 |
equivalent to ".. include:: file" as the first line of the doc text? |
| 441 |
Especially useful for character entity sets, text transform specs, |
| 442 |
boilerplate, etc. |
| 443 |
|
| 444 |
* Support "include" as embedded inline-compatible directive in substitution |
| 445 |
definitions, e.g. :: |
| 446 |
|
| 447 |
.. |version| include:: version.txt |
| 448 |
|
| 449 |
This document describes version |version| of ... |
| 450 |
|
| 451 |
(cf. Grzegorz Adam Hankiewicz's post from 2014-10-01 in docutils-devel) |
| 452 |
|
| 453 |
* Add an ``:optional: <replacement text>`` option to the "include" |
| 454 |
directive? This would not throw an error for a missing file, instead a |
| 455 |
warning is given and ``<replacement text>`` is used instead. It would be |
| 456 |
the responsibility of the author to ensure the missing file does not lead |
| 457 |
to problems later in the document. |
| 458 |
|
| 459 |
Use cases: |
| 460 |
|
| 461 |
+ Standard rST syntax to replace Sphinx's "literalinclude":: |
| 462 |
|
| 463 |
.. include:: blah.cpp |
| 464 |
:literal: |
| 465 |
:optional: file ``blah.cpp`` not found |
| 466 |
|
| 467 |
+ Variable content taken from a file, e.g. |
| 468 |
|
| 469 |
version.txt:: |
| 470 |
|
| 471 |
.. |version| replace:: 3.1 |
| 472 |
|
| 473 |
optionally used as:: |
| 474 |
|
| 475 |
.. include:: version.txt |
| 476 |
:optional: .. |version| replace:: unknown |
| 477 |
|
| 478 |
This document describes version |version| of ... |
| 479 |
|
| 480 |
(cf. Grzegorz Adam Hankiewicz's post from 2014-10-01 in docutils-devel) |
| 481 |
|
| 482 |
* Parameterize the Reporter object or class? See the `2004-02-18 |
| 483 |
"rest checking and source path"`_ thread. |
| 484 |
|
| 485 |
.. _2004-02-18 "rest checking and source path": |
| 486 |
http://thread.gmane.org/gmane.text.docutils.user/1112 |
| 487 |
|
| 488 |
* Add a "disable_transforms" setting? Would allow for easy syntax |
| 489 |
checking. Where ("null" writer, generic, parser(s))? |
| 490 |
Cf. the `2004-02-18 "rest checking and source path"`_ thread. |
| 491 |
|
| 492 |
* Add a generic meta-stylesheet mechanism? An external file could |
| 493 |
associate style names ("class" attributes) with specific elements. |
| 494 |
Could be generalized to arbitrary output attributes; useful for HTML |
| 495 |
& XMLs. Aahz implemented something like this in |
| 496 |
sandbox/aahz/Effective/EffMap.py. |
| 497 |
|
| 498 |
* .. _classes for table cells: |
| 499 |
|
| 500 |
William Dode suggested that table cells be assigned "class" |
| 501 |
attributes by columns, so that stylesheets can affect text |
| 502 |
alignment. Unfortunately, there doesn't seem to be a way (in HTML |
| 503 |
at least) to leverage the "colspec" elements (HTML "col" tags) by |
| 504 |
adding classes to them. The resulting HTML is very verbose:: |
| 505 |
|
| 506 |
<td class="col1">111</td> |
| 507 |
<td class="col2">222</td> |
| 508 |
... |
| 509 |
|
| 510 |
At the very least, it should be an option. People who don't use it |
| 511 |
shouldn't be penalized by increases in their HTML file sizes. |
| 512 |
|
| 513 |
Table rows could also be assigned classes (like odd/even). That |
| 514 |
would be easier to implement. |
| 515 |
|
| 516 |
How should it be implemented? |
| 517 |
|
| 518 |
* There could be writer options (column classes & row classes) with |
| 519 |
standard values. |
| 520 |
|
| 521 |
* The table directive could grow some options. Something like |
| 522 |
":cell-classes: col1 col2 col3" (either must match the number of |
| 523 |
columns, or repeat to fill?) and ":row-classes: odd even" (repeat |
| 524 |
to fill; body rows only, or header rows too?). |
| 525 |
|
| 526 |
Probably per-table directive options are best. The "class" values |
| 527 |
could be used by any writer, and applying such classes to all tables |
| 528 |
in a document with writer options is too broad. |
| 529 |
|
| 530 |
See also the `table_styling Sphinx extension`_ which defines |
| 531 |
|
| 532 |
:widths: also in Docutils core (but different implementation) |
| 533 |
:column-alignment: Sets per-column text alignment |
| 534 |
:column-wrapping: Sets per-column text wrapping |
| 535 |
:column-dividers: Add dividers between columns |
| 536 |
:column-classes: Add per-column css classes. |
| 537 |
:header-columns: Specify number of “stub” columns |
| 538 |
|
| 539 |
.. _table_styling Sphinx extension: https://pythonhosted.org/cloud_sptheme/ |
| 540 |
lib/cloud_sptheme.ext.table_styling.html |
| 541 |
|
| 542 |
* Add file-specific settings support to config files, like:: |
| 543 |
|
| 544 |
[file index.txt] |
| 545 |
compact-lists: no |
| 546 |
|
| 547 |
Is this even possible? Should the criterion be the name of the |
| 548 |
input file or the output file? Alternative (more explicit) syntax:: |
| 549 |
|
| 550 |
[source_file index.txt] |
| 551 |
... |
| 552 |
|
| 553 |
[dest_file index.html] |
| 554 |
... |
| 555 |
|
| 556 |
Or rather allow settings configuration from the rst source file |
| 557 |
(see misc.settings_ directive)? |
| 558 |
|
| 559 |
* The "validator" support added to OptionParser is very similar to |
| 560 |
"traits_" in SciPy_. Perhaps something could be done with them? |
| 561 |
(Had I known about traits when I was implementing docutils.frontend, |
| 562 |
I may have used them instead of rolling my own.) |
| 563 |
|
| 564 |
.. _traits: http://code.enthought.com/traits/ |
| 565 |
.. _SciPy: http://www.scipy.org/ |
| 566 |
|
| 567 |
* tools/buildhtml.py: Extend the --prune option ("prune" config |
| 568 |
setting) to accept file names (generic path) in addition to |
| 569 |
directories (e.g. --prune=docs/user/rst/cheatsheet.txt, which should |
| 570 |
*not* be converted to HTML). |
| 571 |
|
| 572 |
* Add support for _`plugins`. |
| 573 |
|
| 574 |
* _`Config directories`: Currently, ~/.docutils, ./docutils.conf/, & |
| 575 |
/etc/docutils.conf are read as configuration_ files. Proposal: allow |
| 576 |
~/.docutils to be a a configuration *directory*, along with |
| 577 |
/etc/docutils/ and ./docutils.conf/. Within these directories, |
| 578 |
check for config.txt files. We can also have subdirectories here, |
| 579 |
for plugins, S5 themes, components (readers/writers/parsers) etc. |
| 580 |
|
| 581 |
Docutils will continue to support configuration files for backwards |
| 582 |
compatibility. |
| 583 |
|
| 584 |
* Add support for document decorations other than headers & footers? |
| 585 |
For example, top/bottom/side navigation bars for web pages. Generic |
| 586 |
decorations? |
| 587 |
|
| 588 |
Seems like a bad idea as long as it isn't independent from the output |
| 589 |
format (for example, navigation bars are only useful for web pages). |
| 590 |
|
| 591 |
* docutils_update: Check for a ``Makefile`` in a directory, and run |
| 592 |
``make`` if found? This would allow for variant processing on |
| 593 |
specific source files, such as running rst2s5.py instead of |
| 594 |
rst2html.py. |
| 595 |
|
| 596 |
* Add a "disable table of contents" setting? The S5 writer could set |
| 597 |
it as a default. Rationale: |
| 598 |
|
| 599 |
The ``contents`` (table of contents) directive must not be used |
| 600 |
[in S5/HTML documents]. It changes the CSS class of headings |
| 601 |
and they won't show up correctly in the screen presentation. |
| 602 |
|
| 603 |
-- `Easy Slide Shows With reStructuredText & S5 |
| 604 |
<../user/slide-shows.html>`_ |
| 605 |
|
| 606 |
Analogue to the ``sectnum_xform`` setting, it could be used by the |
| 607 |
latex writer to switch to a LaTeX generated ToC (currently, the latex |
| 608 |
writer calls it "use_latex_toc"). |
| 609 |
|
| 610 |
object numbering and object references |
| 611 |
-------------------------------------- |
| 612 |
|
| 613 |
For equations, tables & figures. |
| 614 |
|
| 615 |
These would be the equivalent of DocBook's "formal" elements. |
| 616 |
|
| 617 |
In LaTeX, automatic counters are implemented for sections, equations and |
| 618 |
floats (figures, tables) (configurable via stylesheets or in the |
| 619 |
latex-preamble). Objects can be given `reference names`_ with the |
| 620 |
``\label{<refname}`` command, ``\ref{<refname>}`` inserts the |
| 621 |
corresponding number. |
| 622 |
|
| 623 |
No such mechanism exists in HTML. |
| 624 |
|
| 625 |
* We need _`persistent sequences`, similar to chapter and footnote |
| 626 |
numbers. See `OpenOffice.org XML`_ "fields". |
| 627 |
|
| 628 |
- Should the sequences be automatic or manual (user-specifyable)? |
| 629 |
|
| 630 |
* It is already possible to give `reference names`_ to objects via |
| 631 |
internal hyperlink targets or the "name" directive option:: |
| 632 |
|
| 633 |
.. _figure name: |
| 634 |
|
| 635 |
.. figure:: image.png |
| 636 |
|
| 637 |
or :: |
| 638 |
|
| 639 |
.. figure:: image.png |
| 640 |
:name: figure name |
| 641 |
|
| 642 |
Improve the mapping of "phrase references" to IDs/labels with Literal |
| 643 |
transcription (i.e. ü -> ue, ß -> ss, å -> aa) instead of just |
| 644 |
stripping the accents and other non-ASCII chars. See also the feature |
| 645 |
request `allow more characters when transforming "names" to "ids"`__. |
| 646 |
|
| 647 |
A "table" directive has been implemented, supporting table titles. |
| 648 |
|
| 649 |
Perhaps the name could derive from the title/caption? |
| 650 |
|
| 651 |
.. _reference names: ../ref/rst/restructuredtext.html#reference-names |
| 652 |
__ https://sourceforge.net/p/docutils/feature-requests/66/ |
| 653 |
|
| 654 |
* We need syntax for object references. Cf. `OpenOffice.org XML`_ |
| 655 |
"reference fields": |
| 656 |
|
| 657 |
- Parameterized substitutions are too complicated |
| 658 |
(cf. `or not to do`: `object references`_) |
| 659 |
|
| 660 |
- An interpreted text approach is simpler and better:: |
| 661 |
|
| 662 |
See Figure :ref:`figure name` and Equation :ref:`eq:identity`. |
| 663 |
|
| 664 |
- "equation", "figure", and "page" roles could generate appropriate |
| 665 |
boilerplate text:: |
| 666 |
|
| 667 |
See :figure:`figure name` on :page:`figure name`. |
| 668 |
|
| 669 |
See `Interpreted Text`_ below. |
| 670 |
|
| 671 |
Reference boilerplate could be specified in the document |
| 672 |
(defaulting to nothing):: |
| 673 |
|
| 674 |
.. fignum:: |
| 675 |
:prefix-ref: "Figure " |
| 676 |
:prefix-caption: "Fig. " |
| 677 |
:suffix-caption: : |
| 678 |
|
| 679 |
The position of the role (prefix or suffix) could also be utilized |
| 680 |
|
| 681 |
.. _OpenOffice.org XML: http://xml.openoffice.org/ |
| 682 |
.. _object references: rst/alternatives.html#object-references |
| 683 |
|
| 684 |
See also the `Modified rst2html |
| 685 |
<http://www.loria.fr/~rougier/coding/article/rst2html.py>`__ |
| 686 |
by Nicolas Rougier for a sample implementation. |
| 687 |
|
| 688 |
|
| 689 |
Documentation |
| 690 |
============= |
| 691 |
|
| 692 |
User Docs |
| 693 |
--------- |
| 694 |
|
| 695 |
* Add a FAQ entry about using Docutils (with reStructuredText) on a |
| 696 |
server and that it's terribly slow. See the first paragraphs in |
| 697 |
<http://article.gmane.org/gmane.text.docutils.user/1584>. |
| 698 |
|
| 699 |
* Add document about what Docutils has previously been used for |
| 700 |
(web/use-cases.txt?). |
| 701 |
|
| 702 |
* Improve index in docs/user/config.txt. |
| 703 |
|
| 704 |
|
| 705 |
Developer Docs |
| 706 |
-------------- |
| 707 |
|
| 708 |
* Improve the internal module documentation (docstrings in the code). |
| 709 |
Specific deficiencies listed below. |
| 710 |
|
| 711 |
- docutils.parsers.rst.states.State.build_table: data structure |
| 712 |
required (including StringList). |
| 713 |
|
| 714 |
- docutils.parsers.rst.states: more complete documentation of parser |
| 715 |
internals. |
| 716 |
|
| 717 |
* docs/ref/doctree.txt: DTD element structural relationships, |
| 718 |
semantics, and attributes. In progress; element descriptions to be |
| 719 |
completed. |
| 720 |
|
| 721 |
* Document the ``pending`` elements, how they're generated and what |
| 722 |
they do. |
| 723 |
|
| 724 |
* Document the transforms_ (perhaps in docstrings?): how they're used, |
| 725 |
what they do, dependencies & order considerations. |
| 726 |
|
| 727 |
* Document the HTML classes used by html4css1.py. |
| 728 |
|
| 729 |
* Write an overview of the Docutils architecture, as an introduction |
| 730 |
for developers. What connects to what, why, and how. Either update |
| 731 |
PEP 258 (see PEPs_ below) or as a separate doc. |
| 732 |
|
| 733 |
* Give information about unit tests. Maybe as a howto? |
| 734 |
|
| 735 |
* Document the docutils.nodes APIs. |
| 736 |
|
| 737 |
* Complete the docs/api/publisher.txt docs. |
| 738 |
|
| 739 |
|
| 740 |
How-Tos |
| 741 |
------- |
| 742 |
|
| 743 |
* Creating Docutils Writers |
| 744 |
|
| 745 |
* Creating Docutils Readers |
| 746 |
|
| 747 |
* Creating Docutils Transforms_ |
| 748 |
|
| 749 |
* Creating Docutils Parsers |
| 750 |
|
| 751 |
* Using Docutils as a Library |
| 752 |
|
| 753 |
|
| 754 |
PEPs |
| 755 |
---- |
| 756 |
|
| 757 |
* Complete PEP 258 Docutils Design Specification. |
| 758 |
|
| 759 |
- Fill in the blanks in API details. |
| 760 |
|
| 761 |
- Specify the nodes.py internal data structure implementation? |
| 762 |
|
| 763 |
[Tibs:] Eventually we need to have direct documentation in |
| 764 |
there on how it all hangs together - the DTD is not enough |
| 765 |
(indeed, is it still meant to be correct? [Yes, it is. |
| 766 |
--DG]). |
| 767 |
|
| 768 |
* Rework PEP 257, separating style from spec from tools, wrt Docutils? |
| 769 |
See Doc-SIG from 2001-06-19/20. |
| 770 |
|
| 771 |
|
| 772 |
Python Source Reader |
| 773 |
==================== |
| 774 |
|
| 775 |
General: |
| 776 |
|
| 777 |
* Analyze Tony Ibbs' PySource code. |
| 778 |
|
| 779 |
* Analyze Doug Hellmann's HappyDoc project. |
| 780 |
|
| 781 |
* Investigate how POD handles literate programming. |
| 782 |
|
| 783 |
* Take the best ideas and integrate them into Docutils. |
| 784 |
|
| 785 |
Miscellaneous ideas: |
| 786 |
|
| 787 |
* Ask Python-dev for opinions (GvR for a pronouncement) on special |
| 788 |
variables (__author__, __version__, etc.): convenience vs. namespace |
| 789 |
pollution. Ask opinions on whether or not Docutils should recognize |
| 790 |
& use them. |
| 791 |
|
| 792 |
* If we can detect that a comment block begins with ``##``, a la |
| 793 |
JavaDoc, it might be useful to indicate interspersed section headers |
| 794 |
& explanatory text in a module. For example:: |
| 795 |
|
| 796 |
"""Module docstring.""" |
| 797 |
|
| 798 |
## |
| 799 |
# Constants |
| 800 |
# ========= |
| 801 |
|
| 802 |
a = 1 |
| 803 |
b = 2 |
| 804 |
|
| 805 |
## |
| 806 |
# Exception Classes |
| 807 |
# ================= |
| 808 |
|
| 809 |
class MyException(Exception): pass |
| 810 |
|
| 811 |
# etc. |
| 812 |
|
| 813 |
* Should standalone strings also become (module/class) docstrings? |
| 814 |
Under what conditions? We want to prevent arbitrary strings from |
| 815 |
becoming docstrings of prior attribute assignments etc. Assume |
| 816 |
that there must be no blank lines between attributes and attribute |
| 817 |
docstrings? (Use lineno of NEWLINE token.) |
| 818 |
|
| 819 |
Triple-quotes are sometimes used for multi-line comments (such as |
| 820 |
commenting out blocks of code). How to reconcile? |
| 821 |
|
| 822 |
* HappyDoc's idea of using comment blocks when there's no docstring |
| 823 |
may be useful to get around the conflict between `additional |
| 824 |
docstrings`_ and ``from __future__ import`` for module docstrings. |
| 825 |
A module could begin like this:: |
| 826 |
|
| 827 |
#!/usr/bin/env python |
| 828 |
# :Author: Me |
| 829 |
# :Copyright: whatever |
| 830 |
|
| 831 |
"""This is the public module docstring (``__doc__``).""" |
| 832 |
|
| 833 |
# More docs, in comments. |
| 834 |
# All comments at the beginning of a module could be |
| 835 |
# accumulated as docstrings. |
| 836 |
# We can't have another docstring here, because of the |
| 837 |
# ``__future__`` statement. |
| 838 |
|
| 839 |
from __future__ import division |
| 840 |
|
| 841 |
Using the JavaDoc convention of a doc-comment block beginning with |
| 842 |
``##`` is useful though. It allows doc-comments and implementation |
| 843 |
comments. |
| 844 |
|
| 845 |
.. _additional docstrings: |
| 846 |
../peps/pep-0258.html#additional-docstrings |
| 847 |
|
| 848 |
* HappyDoc uses an initial comment block to set "parser configuration |
| 849 |
values". Do the same thing for Docutils, to set runtime settings on |
| 850 |
a per-module basis? I.e.:: |
| 851 |
|
| 852 |
# Docutils:setting=value |
| 853 |
|
| 854 |
Could be used to turn on/off function parameter comment recognition |
| 855 |
& other marginal features. Could be used as a general mechanism to |
| 856 |
augment config files and command-line options (but which takes |
| 857 |
precedence?). |
| 858 |
|
| 859 |
* Multi-file output should be divisible at arbitrary level. |
| 860 |
|
| 861 |
* Support all forms of ``import`` statements: |
| 862 |
|
| 863 |
- ``import module``: listed as "module" |
| 864 |
- ``import module as alias``: "alias (module)" |
| 865 |
- ``from module import identifier``: "identifier (from module)" |
| 866 |
- ``from module import identifier as alias``: "alias (identifier |
| 867 |
from module)" |
| 868 |
- ``from module import *``: "all identifiers (``*``) from module" |
| 869 |
|
| 870 |
* Have links to colorized Python source files from API docs? And |
| 871 |
vice-versa: backlinks from the colorized source files to the API |
| 872 |
docs! |
| 873 |
|
| 874 |
* In summaries, use the first *sentence* of a docstring if the first |
| 875 |
line is not followed by a blank line. |
| 876 |
|
| 877 |
|
| 878 |
reStructuredText Parser |
| 879 |
======================= |
| 880 |
|
| 881 |
Also see the `... Or Not To Do?`__ list. |
| 882 |
|
| 883 |
__ rst/alternatives.html#or-not-to-do |
| 884 |
|
| 885 |
Bugs |
| 886 |
---- |
| 887 |
|
| 888 |
* A container directive with ``:class:`` option gets the spurious |
| 889 |
class value "class". |
| 890 |
|
| 891 |
Misc |
| 892 |
---- |
| 893 |
|
| 894 |
* Another list problem:: |
| 895 |
|
| 896 |
* foo |
| 897 |
* bar |
| 898 |
* baz |
| 899 |
|
| 900 |
This ends up as a definition list. This is more of a usability |
| 901 |
issue. |
| 902 |
|
| 903 |
* This case is probably meant to be a nested list, but it ends up as a |
| 904 |
list inside a block-quote without an error message:: |
| 905 |
|
| 906 |
- foo |
| 907 |
|
| 908 |
- bar |
| 909 |
|
| 910 |
It should probably just be an error. |
| 911 |
|
| 912 |
The problem with this is that you don't notice easily in HTML that |
| 913 |
it's not a nested list but a block-quote -- there's not much of a |
| 914 |
visual difference. |
| 915 |
|
| 916 |
* Treat enumerated lists that are not arabic and consist of only one |
| 917 |
item in a single line as ordinary paragraphs. See |
| 918 |
<http://article.gmane.org/gmane.text.docutils.user/2635>. |
| 919 |
|
| 920 |
* The citation syntax could use some improvements. See |
| 921 |
<http://thread.gmane.org/gmane.text.docutils.user/2499> (and the |
| 922 |
sub-thread at |
| 923 |
<http://thread.gmane.org/gmane.text.docutils.user/2499/focus=3028>, |
| 924 |
and the follow-ups at |
| 925 |
<http://thread.gmane.org/gmane.text.docutils.user/3087>, |
| 926 |
<http://thread.gmane.org/gmane.text.docutils.user/3110>, |
| 927 |
<http://thread.gmane.org/gmane.text.docutils.user/3114>), |
| 928 |
<http://thread.gmane.org/gmane.text.docutils.user/2443>, |
| 929 |
<http://thread.gmane.org/gmane.text.docutils.user/2715>, |
| 930 |
<http://thread.gmane.org/gmane.text.docutils.user/3027>, |
| 931 |
<http://thread.gmane.org/gmane.text.docutils.user/3120>, |
| 932 |
<http://thread.gmane.org/gmane.text.docutils.user/3253>. |
| 933 |
|
| 934 |
* The current list-recognition logic has too many false positives, as |
| 935 |
in :: |
| 936 |
|
| 937 |
* Aorta |
| 938 |
* V. cava superior |
| 939 |
* V. cava inferior |
| 940 |
|
| 941 |
Here ``V.`` is recognized as an enumerator, which leads to |
| 942 |
confusion. We need to find a solution that resolves such problems |
| 943 |
without complicating the spec to much. |
| 944 |
|
| 945 |
See <http://thread.gmane.org/gmane.text.docutils.user/2524>. |
| 946 |
|
| 947 |
* Add indirect links via citation references & footnote references. |
| 948 |
Example:: |
| 949 |
|
| 950 |
`Goodger (2005)`_ is helpful. |
| 951 |
|
| 952 |
.. _Goodger (2005): [goodger2005]_ |
| 953 |
.. [goodger2005] citation text |
| 954 |
|
| 955 |
See <http://thread.gmane.org/gmane.text.docutils.user/2499>. |
| 956 |
|
| 957 |
* Complain about bad URI characters |
| 958 |
(http://article.gmane.org/gmane.text.docutils.user/2046) and |
| 959 |
disallow internal whitespace |
| 960 |
(http://article.gmane.org/gmane.text.docutils.user/2214). |
| 961 |
|
| 962 |
* Create ``info``-level system messages for unnecessarily |
| 963 |
backslash-escaped characters (as in ``"\something"``, rendered as |
| 964 |
"something") to allow checking for errors which silently slipped |
| 965 |
through. |
| 966 |
|
| 967 |
* Add (functional) tests for untested roles. |
| 968 |
|
| 969 |
* Add test for ":figwidth: image" option of "figure" directive. (Test |
| 970 |
code needs to check if PIL is available on the system.) |
| 971 |
|
| 972 |
* Add support for CJK double-width whitespace (indentation) & |
| 973 |
punctuation characters (markup; e.g. double-width "*", "-", "+")? |
| 974 |
|
| 975 |
* Add motivation sections for constructs in spec. |
| 976 |
|
| 977 |
* Support generic hyperlink references to _`targets in other |
| 978 |
documents`? Not in an HTML-centric way, though (it's trivial to say |
| 979 |
``https://www.example.org/doc#name``, and useless in non-HTML |
| 980 |
contexts). XLink/XPointer? ``.. baseref::``? See Doc-SIG |
| 981 |
2001-08-10. |
| 982 |
|
| 983 |
* Implement the header row separator modification to table.el. (Wrote |
| 984 |
to Takaaki Ota & the table.el mailing list on 2001-08-12, suggesting |
| 985 |
support for "=====" header rows. On 2001-08-17 he replied, saying |
| 986 |
he'd put it on his to-do list, but "don't hold your breath".) |
| 987 |
|
| 988 |
* Fix the parser's indentation handling to conform with the stricter |
| 989 |
definition in the spec. (Explicit markup blocks should be strict or |
| 990 |
forgiving?) |
| 991 |
|
| 992 |
.. XXX What does this mean? Can you elaborate, David? |
| 993 |
|
| 994 |
* Make the parser modular. Allow syntax constructs to be added or |
| 995 |
disabled at run-time. Subclassing is probably not enough because it |
| 996 |
makes it difficult to apply multiple extensions. |
| 997 |
|
| 998 |
* Generalize the "doctest block" construct (which is overly |
| 999 |
Python-centric) to other interactive sessions? "Doctest block" |
| 1000 |
could be renamed to "I/O block" or "interactive block", and each of |
| 1001 |
these could also be recognized as such by the parser: |
| 1002 |
|
| 1003 |
- Shell sessions:: |
| 1004 |
|
| 1005 |
$ cat example1.txt |
| 1006 |
A block beginning with a "$ " prompt is interpreted as a shell |
| 1007 |
session interactive block. As with Doctest blocks, the |
| 1008 |
interactive block ends with the first blank line, and wouldn't |
| 1009 |
have to be indented. |
| 1010 |
|
| 1011 |
- Root shell sessions:: |
| 1012 |
|
| 1013 |
# cat example2.txt |
| 1014 |
A block beginning with a "# " prompt is interpreted as a root |
| 1015 |
shell session (the user is or has to be logged in as root) |
| 1016 |
interactive block. Again, the block ends with a blank line. |
| 1017 |
|
| 1018 |
Other standard (and unambiguous) interactive session prompts could |
| 1019 |
easily be added (such as "> " for WinDOS). |
| 1020 |
|
| 1021 |
Tony Ibbs spoke out against this idea (2002-06-14 Doc-SIG thread |
| 1022 |
"docutils feedback"). |
| 1023 |
|
| 1024 |
* Add support for pragma (syntax-altering) directives. |
| 1025 |
|
| 1026 |
Some pragma directives could be local-scope unless explicitly |
| 1027 |
specified as global/pragma using ":global:" options. |
| 1028 |
|
| 1029 |
* Support whitespace in angle-bracketed standalone URLs according to |
| 1030 |
Appendix E ("Recommendations for Delimiting URI in Context") of `RFC |
| 1031 |
2396`_. |
| 1032 |
|
| 1033 |
.. _RFC 2396: https://www.rfc-editor.org/rfc/rfc2396.txt |
| 1034 |
|
| 1035 |
* Use the vertical spacing of the source text to determine the |
| 1036 |
corresponding vertical spacing of the output? |
| 1037 |
|
| 1038 |
* [From Mark Nodine] For cells in simple tables that comprise a |
| 1039 |
single line, the justification can be inferred according to the |
| 1040 |
following rules: |
| 1041 |
|
| 1042 |
1. If the text begins at the leftmost column of the cell, |
| 1043 |
then left justification, ELSE |
| 1044 |
2. If the text begins at the rightmost column of the cell, |
| 1045 |
then right justification, ELSE |
| 1046 |
3. Center justification. |
| 1047 |
|
| 1048 |
The onus is on the author to make the text unambiguous by adding |
| 1049 |
blank columns as necessary. There should be a parser setting to |
| 1050 |
turn off justification-recognition (normally on would be fine). |
| 1051 |
|
| 1052 |
Decimal justification? |
| 1053 |
|
| 1054 |
All this shouldn't be done automatically. Only when it's requested |
| 1055 |
by the user, e.g. with something like this:: |
| 1056 |
|
| 1057 |
.. table:: |
| 1058 |
:auto-indent: |
| 1059 |
|
| 1060 |
(Table goes here.) |
| 1061 |
|
| 1062 |
Otherwise it will break existing documents. |
| 1063 |
|
| 1064 |
* Generate a warning or info message for paragraphs which should have |
| 1065 |
been lists, like this one:: |
| 1066 |
|
| 1067 |
1. line one |
| 1068 |
3. line two |
| 1069 |
|
| 1070 |
* Generalize the "target-notes" directive into a command-line option |
| 1071 |
somehow? See docutils-develop 2003-02-13. |
| 1072 |
|
| 1073 |
* Allow a "::"-only paragraph (first line, actually) to introduce a |
| 1074 |
_`literal block without a blank line`? (Idea from Paul Moore.) :: |
| 1075 |
|
| 1076 |
:: |
| 1077 |
This is a literal block |
| 1078 |
|
| 1079 |
Is indentation enough to make the separation between a paragraph |
| 1080 |
which contains just a ``::`` and the literal text unambiguous? |
| 1081 |
(There's one problem with this concession: If one wants a definition |
| 1082 |
list item which defines the term "::", we'd have to escape it.) It |
| 1083 |
would only be reasonable to apply it to "::"-only paragraphs though. |
| 1084 |
I think the blank line is visually necessary if there's text before |
| 1085 |
the "::":: |
| 1086 |
|
| 1087 |
The text in this paragraph needs separation |
| 1088 |
from the literal block following:: |
| 1089 |
This doesn't look right. |
| 1090 |
|
| 1091 |
* Add new syntax for _`nested inline markup`? Or extend the parser to |
| 1092 |
parse nested inline markup somehow? See the `collected notes |
| 1093 |
<rst/alternatives.html#nested-inline-markup>`__. |
| 1094 |
|
| 1095 |
* Drop the backticks from embedded URIs with omitted reference text? |
| 1096 |
Should the angle brackets be kept in the output or not? :: |
| 1097 |
|
| 1098 |
<file_name>_ |
| 1099 |
|
| 1100 |
Probably not worth the trouble. |
| 1101 |
|
| 1102 |
* How about a syntax for alternative hyperlink behavior, such as "open |
| 1103 |
in a new window" (as in HTML's ``<a target="_blank">``)? |
| 1104 |
|
| 1105 |
The MoinMoin wiki uses a caret ("^") at the beginning of the URL |
| 1106 |
("^" is not a legal URI character). That could work for both inline |
| 1107 |
and explicit targets:: |
| 1108 |
|
| 1109 |
The `reference docs <^url>`__ may be handy. |
| 1110 |
|
| 1111 |
.. _name: ^url |
| 1112 |
|
| 1113 |
This may be too specific to HTML. It hasn't been requested very |
| 1114 |
often either. |
| 1115 |
|
| 1116 |
* Add an option to add URI schemes at runtime. |
| 1117 |
|
| 1118 |
* _`Segmented lists`:: |
| 1119 |
|
| 1120 |
: segment : segment : segment |
| 1121 |
: segment : segment : very long |
| 1122 |
segment |
| 1123 |
: segment : segment : segment |
| 1124 |
|
| 1125 |
The initial colon (":") can be thought of as a type of bullet |
| 1126 |
|
| 1127 |
We could even have segment titles:: |
| 1128 |
|
| 1129 |
:: title : title : title |
| 1130 |
: segment : segment : segment |
| 1131 |
: segment : segment : segment |
| 1132 |
|
| 1133 |
This would correspond well to DocBook's SegmentedList. Output could |
| 1134 |
be tabular or "name: value" pairs, as described in DocBook's docs. |
| 1135 |
|
| 1136 |
* Enable grid _`tables inside XML comments`, where "``--``" ends comments. |
| 1137 |
|
| 1138 |
Implementation possibilities: |
| 1139 |
|
| 1140 |
1. Make the table syntax characters into "table" directive options. |
| 1141 |
This is the most flexible but most difficult, and we probably |
| 1142 |
don't need that much flexibility. |
| 1143 |
|
| 1144 |
2. Substitute "~" for "-" with a specialized directive option |
| 1145 |
(e.g. ":tildes:"). |
| 1146 |
|
| 1147 |
3. Make the standard table syntax recognize "~" as well as "-", even |
| 1148 |
without a directive option. Individual tables would have to be |
| 1149 |
internally consistent. |
| 1150 |
|
| 1151 |
4. Allow Unicode box characters for table markup |
| 1152 |
(`feature request [6]`_) |
| 1153 |
|
| 1154 |
Directive options are preferable to configuration settings, because |
| 1155 |
tables are document-specific. A pragma directive would be another |
| 1156 |
approach, to set the syntax once for a whole document. |
| 1157 |
|
| 1158 |
Unicode box character markup would kill two birds with one stone. |
| 1159 |
|
| 1160 |
In the meantime, the list-table_ directive is a good replacement for |
| 1161 |
grid tables inside XML comments. |
| 1162 |
|
| 1163 |
.. _feature request [6]: |
| 1164 |
https://sourceforge.net/p/docutils/feature-requests/6 |
| 1165 |
.. _list-table: ../ref/rst/directives.html#list-table |
| 1166 |
|
| 1167 |
|
| 1168 |
* Generalize docinfo contents (bibliographic fields): remove specific |
| 1169 |
fields, and have only a single generic "field"? |
| 1170 |
|
| 1171 |
* _`Line numbers` and "source" in system messages: |
| 1172 |
|
| 1173 |
- Add "source" and "line" keyword arguments to all Reporter calls? |
| 1174 |
This would require passing source/line arguments along all |
| 1175 |
intermediate functions (where currently only `line` is used). |
| 1176 |
|
| 1177 |
Or rather specify "line" only if actually needed? |
| 1178 |
|
| 1179 |
Currently, `document.reporter` uses a state machine instance to |
| 1180 |
determine the "source" and "line" info from |
| 1181 |
`statemachine.input_lines` if not given explicitly. Except for |
| 1182 |
special cases, the "line" argument is not needed because, |
| 1183 |
`document.statemachine` keeps record of the current line number. |
| 1184 |
|
| 1185 |
- For system messages generated after the parsing is completed (i.e. by |
| 1186 |
transforms or the writer) "line" info must be present in the doctree |
| 1187 |
elements. |
| 1188 |
|
| 1189 |
Elements' .line assignments should be checked. (Assign to .source |
| 1190 |
too? Add a set_info method? To what?) |
| 1191 |
|
| 1192 |
The "source" (and line number in the source) can either be added |
| 1193 |
explicitly to the elements or determined from the “raw” line |
| 1194 |
number by `document.statemachine.get_source_and_line`. |
| 1195 |
|
| 1196 |
- Some line numbers in elements are not being set properly |
| 1197 |
(explicitly), just implicitly/automatically. See rev. 1.74 of |
| 1198 |
docutils/parsers/rst/states.py for an example of how to set. |
| 1199 |
|
| 1200 |
- The line numbers of definition list items are wrong:: |
| 1201 |
|
| 1202 |
$ rst2pseudoxml.py --expose-internal-attribute line |
| 1203 |
1 |
| 1204 |
2 |
| 1205 |
3 |
| 1206 |
|
| 1207 |
5 |
| 1208 |
6 |
| 1209 |
7 |
| 1210 |
|
| 1211 |
<document source="<stdin>"> |
| 1212 |
<definition_list> |
| 1213 |
<definition_list_item internal:line="3"> |
| 1214 |
<term> |
| 1215 |
1 |
| 1216 |
<definition> |
| 1217 |
<paragraph internal:line="2"> |
| 1218 |
2 |
| 1219 |
3 |
| 1220 |
<definition_list_item internal:line="6"> |
| 1221 |
<term> |
| 1222 |
5 |
| 1223 |
<definition> |
| 1224 |
<paragraph internal:line="6"> |
| 1225 |
6 |
| 1226 |
7 |
| 1227 |
|
| 1228 |
* .. _none source: |
| 1229 |
|
| 1230 |
Quite a few nodes are getting a "None" source attribute as well. In |
| 1231 |
particular, see the bodies of definition lists. |
| 1232 |
|
| 1233 |
|
| 1234 |
Adaptable file extensions |
| 1235 |
------------------------- |
| 1236 |
|
| 1237 |
Questions |
| 1238 |
````````` |
| 1239 |
|
| 1240 |
Should Docutils support adaptable file extensions in hyperlinks? |
| 1241 |
|
| 1242 |
In the rST source, sister documents are ".txt" files. If we're |
| 1243 |
generating HTML, then ".html" is appropriate; if PDF, then ".pdf"; |
| 1244 |
etc. |
| 1245 |
|
| 1246 |
Handle documents only, or objects (images, etc.) also? |
| 1247 |
|
| 1248 |
Different output formats support different sets of image formats (HTML |
| 1249 |
supports ".svg" but not ".pdf", pdfLaTeX supports ".pdf" but not ".svg", |
| 1250 |
LaTeX supports only ".eps"). |
| 1251 |
|
| 1252 |
This is less urgent 2020 than 2004, as `pdflatex` and `lualatex` are |
| 1253 |
now standard and support most image formats. Also, a wrapper like |
| 1254 |
`rubber`__ that provides on-the-fly image conversion depends on the |
| 1255 |
"wrong" extension in the LaTeX source. |
| 1256 |
|
| 1257 |
__ https://pypi.org/project/rubber/ |
| 1258 |
|
| 1259 |
At what point should the extensions be substituted? |
| 1260 |
|
| 1261 |
Transforms_: |
| 1262 |
Fits well in the `Reader → Transformer → Writer`__ processing framework. |
| 1263 |
|
| 1264 |
* Filename/URL extension replacement can be done walking over the |
| 1265 |
Document tree transforming the document tree from a valid state |
| 1266 |
to another valid state. |
| 1267 |
|
| 1268 |
* Writer-specific configuration is still possible in the |
| 1269 |
respective sections of the configuration_ file. |
| 1270 |
|
| 1271 |
__ ../peps/pep-0258.html#id24 |
| 1272 |
|
| 1273 |
Pre- or post-processing: |
| 1274 |
Can be implemented independent of Docutils -- keeps Docutils simple. |
| 1275 |
|
| 1276 |
... those who need more sophisticated filename extension |
| 1277 |
tweaking can simply use regular expressions, which isn't too |
| 1278 |
difficult due to the determinability of the writers. So there |
| 1279 |
is no need to add a complex filename-extension-handling feature |
| 1280 |
to Docutils. |
| 1281 |
|
| 1282 |
--- `Lea Wiemann in docutils-users 2004-06-04`__ |
| 1283 |
|
| 1284 |
__ https://sourceforge.net/p/docutils/mailman/message/6918089/ |
| 1285 |
|
| 1286 |
|
| 1287 |
Proposals |
| 1288 |
````````` |
| 1289 |
|
| 1290 |
How about using ".*" to indicate "choose the most appropriate filename |
| 1291 |
extension"? For example:: |
| 1292 |
|
| 1293 |
.. _Another Document: another.* |
| 1294 |
|
| 1295 |
* My point about using ``.*`` is that any other mechanism inside reST |
| 1296 |
leads to too many ambiguities in reading reST documents; at least |
| 1297 |
with ``.*`` it's clear that some kind of substitution is going on. |
| 1298 |
|
| 1299 |
--- Aahz |
| 1300 |
|
| 1301 |
* What is to be done for output formats that don't *have* hyperlinks? |
| 1302 |
For example, LaTeX targeted at print. Hyperlinks may be "called |
| 1303 |
out", as footnotes with explicit URLs. (Don't convert the links.) |
| 1304 |
|
| 1305 |
But then there's also LaTeX targeted at PDFs, which *can* have |
| 1306 |
links. Perhaps a runtime setting for "*" could explicitly provide |
| 1307 |
the extension, defaulting to the output file's extension. |
| 1308 |
|
| 1309 |
* If this handles images also, how to differentiate between document |
| 1310 |
and image links? Element context (within "image")? Which image |
| 1311 |
extension to use for which document format? For HTML output, there |
| 1312 |
is no reliable way of determining which extension to use (svg, png, |
| 1313 |
jpg, jpeg, gif, ...). |
| 1314 |
|
| 1315 |
Should the system check for existing files? No, not practical (the |
| 1316 |
image files may be not available when the document is processed to HTML). |
| 1317 |
|
| 1318 |
Mailing list threads: `Images in both HTML and LaTeX`__ (especially |
| 1319 |
`this summary of Lea's objections`__). |
| 1320 |
|
| 1321 |
__ https://sourceforge.net/p/docutils/mailman/docutils-users/thread/40BAA4B7.5020801%40python.org/#msg6918066 |
| 1322 |
__ https://sourceforge.net/p/docutils/mailman/message/6918089/ |
| 1323 |
|
| 1324 |
Chris Liechti suggests a new ``:link:`` role in `more-universal |
| 1325 |
links?`__:: |
| 1326 |
|
| 1327 |
.. role:: link(rewrite) |
| 1328 |
:transform: .txt|.html |
| 1329 |
|
| 1330 |
and then to use it:: |
| 1331 |
|
| 1332 |
for more information see :link:`README.txt` |
| 1333 |
|
| 1334 |
it would be useful if it supported an additional option |
| 1335 |
``:format: html`` so that separate rules for each format can be |
| 1336 |
defined. (like the "raw" role) |
| 1337 |
|
| 1338 |
__ https://sourceforge.net/p/docutils/mailman/message/6919484/ |
| 1339 |
|
| 1340 |
|
| 1341 |
Idea from Jim Fulton: an external lookup table of targets: |
| 1342 |
|
| 1343 |
I would like to specify the extension (e.g. .txt) [in the |
| 1344 |
source, rather than ``filename.*``], but tell the converter to |
| 1345 |
change references to the files anticipating that the files will |
| 1346 |
be converted too. |
| 1347 |
|
| 1348 |
For example:: |
| 1349 |
|
| 1350 |
.. _Another Document: another.txt |
| 1351 |
|
| 1352 |
rst2html.py --convert-links "another.txt bar.txt" foo.txt |
| 1353 |
|
| 1354 |
That is, name the files for which extensions should be converted. |
| 1355 |
|
| 1356 |
Note that I want to refer to original files in the original text |
| 1357 |
(another.txt rather than another.*) because I want the |
| 1358 |
unconverted text to stand on its own. |
| 1359 |
|
| 1360 |
Note that in most cases, people will be able to use globs:: |
| 1361 |
|
| 1362 |
rst2html.py --convert-link-extensions-for "`echo *.txt`" foo.txt |
| 1363 |
|
| 1364 |
It might be nice to be able to use multiple arguments, as in:: |
| 1365 |
|
| 1366 |
rst2html.py --convert-link-extensions-for *.txt -- foo.txt |
| 1367 |
|
| 1368 |
> Handle documents only, or objects (images, etc.) also? |
| 1369 |
|
| 1370 |
No, documents only, but there really is no need for guesswork. |
| 1371 |
Just get the file names as command-line arguments. EIBTI |
| 1372 |
[explicit is better than implicit]. |
| 1373 |
|
| 1374 |
In `Patch #169`__ `Hyperlink extension rewriting`, John L. Clark |
| 1375 |
suggests command line options that map to-be-changed file extensions, e.g.:: |
| 1376 |
|
| 1377 |
rst2html --map-extension rst html --map-extension jpg png \ |
| 1378 |
input-filename.rst |
| 1379 |
|
| 1380 |
__ https://sourceforge.net/p/docutils/patches/169/ |
| 1381 |
|
| 1382 |
Specifying the mapping as regular expressions would make this |
| 1383 |
approach more generic and easier to implement (use ``re.replace`` |
| 1384 |
and refer to the "re" module's documentation instead of coding and |
| 1385 |
documenting a home-grown extraction and mapping procedure). |
| 1386 |
|
| 1387 |
|
| 1388 |
Math Markup |
| 1389 |
----------- |
| 1390 |
|
| 1391 |
Since Docutils 0.8, a "math" role and directive using LaTeX math |
| 1392 |
syntax as input format is part of reStructuredText. |
| 1393 |
|
| 1394 |
Open issues: |
| 1395 |
|
| 1396 |
* Use a "Transform" for math format conversions as extensively discussed in |
| 1397 |
the "math directive issues" thread in May 2008 |
| 1398 |
(http://osdir.com/ml/text.docutils.devel/2008-05/threads.html)? |
| 1399 |
|
| 1400 |
* Generic `math-output setting`_ (currently specific to HTML). |
| 1401 |
(List of math-output preferences?) |
| 1402 |
|
| 1403 |
* Try to be compatible with `Math support in Sphinx`_? |
| 1404 |
|
| 1405 |
* The ``:label:`` option selects a label for the equation, by which it |
| 1406 |
can be cross-referenced, and causes an equation number to be issued. |
| 1407 |
In Docutils, the option ``:name:`` sets the label. |
| 1408 |
Equation numbering is not implemented yet. |
| 1409 |
|
| 1410 |
* Option ``:nowrap:`` prevents wrapping of the given math in a |
| 1411 |
math environment (you have to specify the math environment in the |
| 1412 |
content). |
| 1413 |
|
| 1414 |
.. _Math support in Sphinx: http://sphinx.pocoo.org/ext/math.html |
| 1415 |
|
| 1416 |
* Equation numbering and references. (see the section on |
| 1417 |
`object numbering and object references` for equations, |
| 1418 |
formal tables, and images.) |
| 1419 |
|
| 1420 |
.. _math-output setting: ../user/config.html#math-output |
| 1421 |
|
| 1422 |
|
| 1423 |
alternative input formats |
| 1424 |
````````````````````````` |
| 1425 |
|
| 1426 |
Use a directive option to specify an alternative input format, e.g. (but not |
| 1427 |
limited to): |
| 1428 |
|
| 1429 |
MathML_ |
| 1430 |
Not for hand-written code but maybe useful when pasted in (or included |
| 1431 |
from a file) |
| 1432 |
|
| 1433 |
For an overview of MathML implementations and tests, see, e.g., |
| 1434 |
the `mathweb wiki`_ or the `ConTeXT MathML page`_. |
| 1435 |
|
| 1436 |
.. _MathML: https://www.w3.org/TR/MathML2/ |
| 1437 |
.. _mathweb wiki: http://www.mathweb.org/wiki/MathML |
| 1438 |
.. _ConTeXT MathML page: http://wiki.contextgarden.net/MathML |
| 1439 |
|
| 1440 |
A MathML to LaTeX XSLT sheet: |
| 1441 |
https://github.com/davidcarlisle/web-xslt/tree/master/pmml2tex |
| 1442 |
|
| 1443 |
|
| 1444 |
ASCIIMath_ |
| 1445 |
Simple, ASCII based math input language (see also `ASCIIMath tutorial`_). |
| 1446 |
|
| 1447 |
* The Python module ASCIIMathML_ translates a string with ASCIIMath into a |
| 1448 |
MathML tree. Used, e.g., by MultiMarkdown__. |
| 1449 |
|
| 1450 |
A more comprehensive implementation is ASCIIMathPython_ by |
| 1451 |
Paul Trembley (also used in his sandbox projects). |
| 1452 |
|
| 1453 |
* For conversion to LaTeX, there is |
| 1454 |
|
| 1455 |
- a JavaScript script at |
| 1456 |
http://dlippman.imathas.com/asciimathtex/ASCIIMath2TeX.js |
| 1457 |
|
| 1458 |
- The javascript `asciimath-to-latex` AsciiMath to LaTex converter at |
| 1459 |
the node package manager |
| 1460 |
https://www.npmjs.com/package/asciimath-to-latex |
| 1461 |
and at GitHub https://github.com/tylerlong/asciimath-to-latex |
| 1462 |
|
| 1463 |
- a javascript and a PHP converter script at GitHub |
| 1464 |
https://github.com/asciimath/asciimathml/tree/master/asciimath-based |
| 1465 |
|
| 1466 |
.. _ASCIIMath: http://www1.chapman.edu/~jipsen/mathml/asciimath.html |
| 1467 |
.. _ASCIIMath tutorial: |
| 1468 |
http://www.wjagray.co.uk/maths/ASCIIMathTutorial.html |
| 1469 |
.. _ASCIIMathML: http://pypi.python.org/pypi/asciimathml/ |
| 1470 |
.. _ASCIIMathPython: https://github.com/paulhtremblay/asciimathml |
| 1471 |
__ http://fletcherpenney.net/multimarkdown/ |
| 1472 |
|
| 1473 |
`Unicode Nearly Plain Text Encoding of Mathematics`_ |
| 1474 |
format for lightly marked-up representation of mathematical |
| 1475 |
expressions in Unicode. |
| 1476 |
|
| 1477 |
(Unicode Technical Note. Sole responsibility for its contents rests |
| 1478 |
with the author(s). Publication does not imply any endorsement by |
| 1479 |
the Unicode Consortium.) |
| 1480 |
|
| 1481 |
.. _Unicode Nearly Plain Text Encoding of Mathematics: |
| 1482 |
https://www.unicode.org/notes/tn28/ |
| 1483 |
|
| 1484 |
itex |
| 1485 |
See `the culmination of a relevant discussion in 2003 |
| 1486 |
<http://article.gmane.org/gmane.text.docutils.user/118>`__. |
| 1487 |
|
| 1488 |
|
| 1489 |
|
| 1490 |
LaTeX output |
| 1491 |
```````````` |
| 1492 |
|
| 1493 |
Which equation environments should be supported by the math directive? |
| 1494 |
|
| 1495 |
* one line: |
| 1496 |
|
| 1497 |
+ numbered: `equation` |
| 1498 |
+ unnumbered: `equation*` |
| 1499 |
|
| 1500 |
* multiline (test for ``\\`` outside of a nested environment |
| 1501 |
(e.g. `array` or `cases`) |
| 1502 |
|
| 1503 |
+ numbered: `align` (number every line) |
| 1504 |
|
| 1505 |
(To give one common number to all lines, put them in a `split` |
| 1506 |
environment. Docutils then places it in an `equation` environment.) |
| 1507 |
|
| 1508 |
+ unnumbered: `align*` |
| 1509 |
|
| 1510 |
+ Sphinx math also supports `gather` (checking for blank lines in |
| 1511 |
the content). Docutils puts content blocks separated by blank |
| 1512 |
lines in separate math-block doctree nodes. (The only difference of |
| 1513 |
`gather` to two consecutive "normal" environments seems to be that |
| 1514 |
page-breaks between the two are prevented.) |
| 1515 |
|
| 1516 |
See http://www.math.uiuc.edu/~hildebr/tex/displays.html. |
| 1517 |
|
| 1518 |
|
| 1519 |
HTML output |
| 1520 |
``````````` |
| 1521 |
|
| 1522 |
There is no native math support in HTML. |
| 1523 |
For supported math output variants see the `math-output setting`_. |
| 1524 |
Add more/better alternatives? |
| 1525 |
|
| 1526 |
MathML_ |
| 1527 |
Converters from LaTeX to MathML include |
| 1528 |
|
| 1529 |
* TtM_ (C), ``--math-output=MathML ttm``, undocumented, may be removed. |
| 1530 |
|
| 1531 |
No "matrix", "align" and "cases" environments. |
| 1532 |
|
| 1533 |
* MathToWeb_ (Java) |
| 1534 |
* TeX4ht_ (TeX based) |
| 1535 |
* itex_ (also `used in Abiword`__) |
| 1536 |
* `Steve’s LATEX-to-MathML translator`_ |
| 1537 |
('mini-language', javascript, Python) |
| 1538 |
* `MathJax for Node`_ |
| 1539 |
|
| 1540 |
* Write a new converter? E.g. based on: |
| 1541 |
|
| 1542 |
* a generic tokenizer (see e.g. a `latex-codec recipe`_, |
| 1543 |
`updated latex-codec`_, ) |
| 1544 |
* the Unicode-Char <-> LaTeX mappings database unimathsymbols_ |
| 1545 |
|
| 1546 |
__ http://msevior.livejournal.com/26377.html |
| 1547 |
.. _MathML: https://www.w3.org/TR/MathML2/ |
| 1548 |
.. _ttm: http://hutchinson.belmont.ma.us/tth/mml/ |
| 1549 |
.. _TeX4ht: http://www.tug.org/applications/tex4ht/mn.html |
| 1550 |
.. _MathToWeb: http://www.mathtoweb.com/ |
| 1551 |
.. _itex: http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html |
| 1552 |
.. _Steve’s LATEX-to-MathML translator: |
| 1553 |
http://www.gold-saucer.org/mathml/greasemonkey/dist/display-latex |
| 1554 |
.. _latex-codec recipe: |
| 1555 |
http://code.activestate.com/recipes/252124-latex-codec/ |
| 1556 |
.. _updated latex-codec: |
| 1557 |
http://mirror.ctan.org/biblio/bibtex/utils/mab2bib/latex.py |
| 1558 |
.. _unimathsymbols: http://milde.users.sourceforge.net/LUCR/Math/ |
| 1559 |
.. _MathJax for Node: https://github.com/mathjax/MathJax-node |
| 1560 |
|
| 1561 |
.. URL seems down: |
| 1562 |
.. _itex: http://pear.math.pitt.edu/mathzilla/itex2mmlItex.html |
| 1563 |
|
| 1564 |
|
| 1565 |
HTML/CSS |
| 1566 |
format math in standard HTML enhanced by CSS rules |
| 1567 |
(Overview__, `Examples and experiments`__). |
| 1568 |
The ``math-output=html`` option uses the converter from eLyXer_ |
| 1569 |
(included with Docutils). |
| 1570 |
|
| 1571 |
Alternatives: LaTeX-math to HTML/CSS converters include |
| 1572 |
|
| 1573 |
* TtH_ (C) |
| 1574 |
* Hevea_ (Objective Caml) |
| 1575 |
* `MathJax for Node`_ |
| 1576 |
* KaTeX_ |
| 1577 |
|
| 1578 |
__ http://www.cs.tut.fi/~jkorpela/math/ |
| 1579 |
__ http://www.zipcon.net/~swhite/docs/math/math.html |
| 1580 |
.. _elyxer: http://elyxer.nongnu.org/ |
| 1581 |
.. _TtH: ttp://hutchinson.belmont.ma.us/tth/index.html |
| 1582 |
.. _Hevea: http://para.inria.fr/~maranget/hevea/ |
| 1583 |
.. _KaTeX: https://katex.org |
| 1584 |
|
| 1585 |
images |
| 1586 |
(PNG or SVG) like e.g. Wikipedia. |
| 1587 |
|
| 1588 |
* dvisvgm_ |
| 1589 |
* the pure-python MathML->SVG converter SVGMath_) |
| 1590 |
* `MathJax for Node`_ |
| 1591 |
|
| 1592 |
.. _dvisvgm: http://dvisvgm.sourceforge.net/ |
| 1593 |
.. _SVGMath: http://www.grigoriev.ru/svgmath/ |
| 1594 |
|
| 1595 |
|
| 1596 |
client side JavaScript conversion |
| 1597 |
Use TeX notation in the web page and JavaScript in the displaying browser. |
| 1598 |
(implemented as `math-output setting`_ "mathjax"). |
| 1599 |
|
| 1600 |
* jqMath_ (faster and lighter than MathJax_) |
| 1601 |
|
| 1602 |
.. _MathJax: http://www.mathjax.org/ |
| 1603 |
.. _jqMath: http://mathscribe.com/author/jqmath.html |
| 1604 |
|
| 1605 |
OpenOffice output |
| 1606 |
````````````````` |
| 1607 |
|
| 1608 |
* The `OpenDocument standard`_ version 1.1 says: |
| 1609 |
|
| 1610 |
Mathematical content is represented by MathML 2.0 |
| 1611 |
|
| 1612 |
However, putting MathML into an ODP file seems tricky as these |
| 1613 |
(maybe outdated) links suppose: |
| 1614 |
http://idippedut.dk/post/2008/01/25/Do-your-math-ODF-and-MathML.aspx |
| 1615 |
http://idippedut.dk/post/2008/03/03/Now-I-get-it-ODF-and-MathML.aspx |
| 1616 |
|
| 1617 |
.. _OpenDocument standard: |
| 1618 |
http://www.oasis-open.org/standards#opendocumentv1.1 |
| 1619 |
|
| 1620 |
* OOoLaTeX__: "a set of macros designed to bring the power of LaTeX |
| 1621 |
into OpenOffice." |
| 1622 |
|
| 1623 |
__ http://ooolatex.sourceforge.net/ |
| 1624 |
|
| 1625 |
|
| 1626 |
Directives |
| 1627 |
---------- |
| 1628 |
|
| 1629 |
Directives below are often referred to as "module.directive", the |
| 1630 |
directive function. The "module." is not part of the directive name |
| 1631 |
when used in a document. |
| 1632 |
|
| 1633 |
* Allow for field lists in list tables. See |
| 1634 |
<http://thread.gmane.org/gmane.text.docutils.devel/3392>. |
| 1635 |
|
| 1636 |
* .. _unify tables: |
| 1637 |
|
| 1638 |
Unify table implementations and unify options of table directives |
| 1639 |
(http://article.gmane.org/gmane.text.docutils.user/1857). |
| 1640 |
|
| 1641 |
* Allow directives to be added at run-time? |
| 1642 |
|
| 1643 |
* Use the language module for directive option names? |
| 1644 |
|
| 1645 |
* Add "substitution_only" and "substitution_ok" function attributes, |
| 1646 |
and automate context checking? |
| 1647 |
|
| 1648 |
* Implement options or features on existing directives: |
| 1649 |
|
| 1650 |
- All directives that produce titled elements should grow implicit |
| 1651 |
reference names based on the titles. |
| 1652 |
|
| 1653 |
- Allow the _`:trim:` option for all directives when they occur in a |
| 1654 |
substitution definition, not only the unicode_ directive. |
| 1655 |
|
| 1656 |
.. _unicode: ../ref/rst/directives.html#unicode-character-codes |
| 1657 |
|
| 1658 |
- Add the "class" option to the unicode_ directive. For example, you |
| 1659 |
might want to get characters or strings with borders around them. |
| 1660 |
|
| 1661 |
- _`images.figure`: "title" and "number", to indicate a formal |
| 1662 |
figure? |
| 1663 |
|
| 1664 |
- _`parts.sectnum`: "local"?, "refnum" |
| 1665 |
|
| 1666 |
A "local" option could enable numbering for sections from a |
| 1667 |
certain point down, and sections in the rest of the document are |
| 1668 |
not numbered. For example, a reference section of a manual might |
| 1669 |
be numbered, but not the rest. OTOH, an all-or-nothing approach |
| 1670 |
would probably be enough. |
| 1671 |
|
| 1672 |
The "sectnum" directive should be usable multiple times in a |
| 1673 |
single document. For example, in a long document with "chapter" |
| 1674 |
and "appendix" sections, there could be a second "sectnum" before |
| 1675 |
the first appendix, changing the sequence used (from 1,2,3... to |
| 1676 |
A,B,C...). This is where the "local" concept comes in. This part |
| 1677 |
of the implementation can be left for later. |
| 1678 |
|
| 1679 |
A "refnum" option (better name?) would insert reference names |
| 1680 |
(targets) consisting of the reference number. Then a URL could be |
| 1681 |
of the form ``http://host/document.html#2.5`` (or "2-5"?). Allow |
| 1682 |
internal references by number? Allow name-based *and* |
| 1683 |
number-based ids at the same time, or only one or the other (which |
| 1684 |
would the table of contents use)? Usage issue: altering the |
| 1685 |
section structure of a document could render hyperlinks invalid. |
| 1686 |
|
| 1687 |
- _`parts.contents`: Add a "suppress" or "prune" option? It would |
| 1688 |
suppress contents display for sections in a branch from that point |
| 1689 |
down. Or a new directive, like "prune-contents"? |
| 1690 |
|
| 1691 |
Add an option to include topics in the TOC? Another for sidebars? |
| 1692 |
The "topic" directive could have a "contents" option, or the |
| 1693 |
"contents" directive" could have an "include-topics" option. See |
| 1694 |
docutils-develop 2003-01-29. |
| 1695 |
|
| 1696 |
- _`parts.header` & _`parts.footer`: Support multiple, named headers |
| 1697 |
& footers? For example, separate headers & footers for odd, even, |
| 1698 |
and the first page of a document. |
| 1699 |
|
| 1700 |
This may be too specific to output formats which have a notion of |
| 1701 |
"pages". |
| 1702 |
|
| 1703 |
- _`misc.class`: |
| 1704 |
|
| 1705 |
- Add a ``:parent:`` option for setting the parent's class |
| 1706 |
(http://article.gmane.org/gmane.text.docutils.devel/3165). |
| 1707 |
|
| 1708 |
- _`misc.include`: |
| 1709 |
|
| 1710 |
- Option to label lines? |
| 1711 |
|
| 1712 |
- How about an environment variable, say RSTINCLUDEPATH or |
| 1713 |
RSTPATH, for standard includes (as in ``.. include:: <name>``)? |
| 1714 |
This could be combined with a setting/option to allow |
| 1715 |
user-defined include directories. |
| 1716 |
|
| 1717 |
- Add support for inclusion by URL? :: |
| 1718 |
|
| 1719 |
.. include:: |
| 1720 |
:url: https://www.example.org/inclusion.txt |
| 1721 |
|
| 1722 |
- Strip blank lines from begin and end of a literal included file or |
| 1723 |
file section. This would correspond to the way a literal block is |
| 1724 |
handled. |
| 1725 |
|
| 1726 |
As nodes.literal_block expects (and we have) the text as a string |
| 1727 |
(rather than a list of lines), using a regexp seems the way. |
| 1728 |
|
| 1729 |
- _`misc.raw`: add a "destination" option to the "raw" directive? :: |
| 1730 |
|
| 1731 |
.. raw:: html |
| 1732 |
:destination: head |
| 1733 |
|
| 1734 |
<link ...> |
| 1735 |
|
| 1736 |
It needs thought & discussion though, to come up with a consistent |
| 1737 |
set of destination labels and consistent behavior. |
| 1738 |
|
| 1739 |
And placing HTML code inside the <head> element of an HTML |
| 1740 |
document is rather the job of a templating system. |
| 1741 |
|
| 1742 |
- _`body.sidebar`: Allow internal section structure? Adornment |
| 1743 |
styles would be independent of the main document. |
| 1744 |
|
| 1745 |
That is really complicated, however, and the document model |
| 1746 |
greatly benefits from its simplicity. |
| 1747 |
|
| 1748 |
* Implement directives. Each of the list items below begins with an |
| 1749 |
identifier of the form, "module_name.directive_function_name". The |
| 1750 |
directive name itself could be the same as the |
| 1751 |
directive_function_name, or it could differ. |
| 1752 |
|
| 1753 |
- _`html.imagemap` |
| 1754 |
|
| 1755 |
It has the disadvantage that it's only easily implementable for |
| 1756 |
HTML, so it's specific to one output format. |
| 1757 |
|
| 1758 |
(For non-HTML writers, the imagemap would have to be replaced with |
| 1759 |
the image only.) |
| 1760 |
|
| 1761 |
- _`parts.endnotes` (or "footnotes"): See `Footnote & Citation Gathering`_. |
| 1762 |
|
| 1763 |
- _`parts.citations`: See `Footnote & Citation Gathering`_. |
| 1764 |
|
| 1765 |
- _`misc.language`: Specify (= change) the language of a document at |
| 1766 |
parse time? |
| 1767 |
|
| 1768 |
* The misc.settings_ directive suggested below offers a more generic |
| 1769 |
approach. |
| 1770 |
|
| 1771 |
* The language of document parts can be indicated by the "special class |
| 1772 |
value" ``"language-"`` + `BCP 47`_ language code. Class arguments to |
| 1773 |
the title are attached to the document's base node - hence titled |
| 1774 |
documents can be given a different language at parse time. However, |
| 1775 |
"language by class attribute" does not change parsing (localized |
| 1776 |
directives etc.), only supporting writers. |
| 1777 |
|
| 1778 |
.. _BCP 47: https://www.rfc-editor.org/rfc/bcp/bcp47.txt |
| 1779 |
|
| 1780 |
|
| 1781 |
- _`misc.settings`: Set any(?) Docutils runtime setting from within |
| 1782 |
a document? Needs much thought and discussion. |
| 1783 |
|
| 1784 |
Security concerns need to be taken into account (it shouldn't be |
| 1785 |
possible to enable ``file_insertion_enabled`` from within a |
| 1786 |
document), and settings that only would have taken effect before |
| 1787 |
the directive (like ``tab-width``) shouldn't be accessible either. |
| 1788 |
|
| 1789 |
See this sub-thread: |
| 1790 |
<http://thread.gmane.org/gmane.text.docutils.user/3620/focus=3649> |
| 1791 |
|
| 1792 |
- _`misc.gather`: Gather (move, or copy) all instances of a specific |
| 1793 |
element. A generalization of the `Footnote & Citation Gathering`_ |
| 1794 |
ideas. |
| 1795 |
|
| 1796 |
- Add a custom "directive" directive, equivalent to "role"? For |
| 1797 |
example:: |
| 1798 |
|
| 1799 |
.. directive:: incr |
| 1800 |
|
| 1801 |
.. class:: incremental |
| 1802 |
|
| 1803 |
.. incr:: |
| 1804 |
|
| 1805 |
"``.. incr::``" above is equivalent to "``.. class:: incremental``". |
| 1806 |
|
| 1807 |
Another example:: |
| 1808 |
|
| 1809 |
.. directive:: printed-links |
| 1810 |
|
| 1811 |
.. topic:: Links |
| 1812 |
:class: print-block |
| 1813 |
|
| 1814 |
.. target-notes:: |
| 1815 |
:class: print-inline |
| 1816 |
|
| 1817 |
This acts like macros. The directive contents will have to be |
| 1818 |
evaluated when referenced, not when defined. |
| 1819 |
|
| 1820 |
* Needs a better name? "Macro", "substitution"? |
| 1821 |
* What to do with directive arguments & options when the |
| 1822 |
macro/directive is referenced? |
| 1823 |
|
| 1824 |
- Make the meaning of block quotes overridable? Only a 1-shot |
| 1825 |
though; doesn't solve the general problem. |
| 1826 |
|
| 1827 |
- _`conditional directives`: |
| 1828 |
|
| 1829 |
.. note:: See also the implementation in Sphinx_. |
| 1830 |
|
| 1831 |
Docutils already has the ability to say "use this content for |
| 1832 |
Writer X" via the "raw" directive. It also does have the ability |
| 1833 |
to say "use this content for any Writer other than X" via the |
| 1834 |
"strip-elements with class" config value. However, using "raw" |
| 1835 |
input just to select a special writer is inconvenient in many |
| 1836 |
cases. |
| 1837 |
It wouldn't be difficult to get more straightforward support, though. |
| 1838 |
|
| 1839 |
My first idea would be to add a set of conditional directives. |
| 1840 |
Let's call them "writer-is" and "writer-is-not" for discussion |
| 1841 |
purposes (don't worry about implementation details). We might |
| 1842 |
have:: |
| 1843 |
|
| 1844 |
.. writer-is:: text-only |
| 1845 |
|
| 1846 |
:: |
| 1847 |
|
| 1848 |
+----------+ |
| 1849 |
| SNMP | |
| 1850 |
+----------+ |
| 1851 |
| UDP | |
| 1852 |
+----------+ |
| 1853 |
| IP | |
| 1854 |
+----------+ |
| 1855 |
| Ethernet | |
| 1856 |
+----------+ |
| 1857 |
|
| 1858 |
.. writer-is:: pdf |
| 1859 |
|
| 1860 |
.. figure:: protocol_stack.eps |
| 1861 |
|
| 1862 |
.. writer-is-not:: text-only pdf |
| 1863 |
|
| 1864 |
.. figure:: protocol_stack.png |
| 1865 |
|
| 1866 |
This could be an interface to the Filter transform |
| 1867 |
(docutils.transforms.components.Filter). |
| 1868 |
|
| 1869 |
The ideas in the `adaptable file extensions`_ section above may |
| 1870 |
also be applicable here. |
| 1871 |
|
| 1872 |
SVG's "switch" statement may provide inspiration. |
| 1873 |
|
| 1874 |
Here's an example of a directive that could produce multiple |
| 1875 |
outputs (*both* raw troff pass-through *and* a GIF, for example) |
| 1876 |
and allow the Writer to select. :: |
| 1877 |
|
| 1878 |
.. eqn:: |
| 1879 |
|
| 1880 |
.EQ |
| 1881 |
delim %% |
| 1882 |
.EN |
| 1883 |
%sum from i=o to inf c sup i~=~lim from {m -> inf} |
| 1884 |
sum from i=0 to m sup i% |
| 1885 |
.EQ |
| 1886 |
delim off |
| 1887 |
.EN |
| 1888 |
|
| 1889 |
- _`body.example`: Examples; suggested by Simon Hefti. Semantics as |
| 1890 |
per Docbook's "example"; admonition-style, numbered, reference, |
| 1891 |
with a caption/title. |
| 1892 |
|
| 1893 |
- _`body.index`: Index targets. |
| 1894 |
|
| 1895 |
See `Index Entries & Indexes |
| 1896 |
<./rst/alternatives.html#index-entries-indexes>`__. |
| 1897 |
|
| 1898 |
- _`body.literal`: Literal block, possibly "formal" (see `object |
| 1899 |
numbering and object references`_ above). Possible options: |
| 1900 |
|
| 1901 |
- "highlight" a range of lines |
| 1902 |
|
| 1903 |
- include only a specified range of lines |
| 1904 |
|
| 1905 |
- "number" or "line-numbers"? (since 0.9 available with "code" directive) |
| 1906 |
|
| 1907 |
- "styled" could indicate that the directive should check for |
| 1908 |
style comments at the end of lines to indicate styling or |
| 1909 |
markup. |
| 1910 |
|
| 1911 |
Specific derivatives (i.e., a "python-interactive" directive) |
| 1912 |
could interpret style based on cues, like the ">>> " prompt and |
| 1913 |
"input()"/"raw_input()" calls. |
| 1914 |
|
| 1915 |
See docutils-users 2003-03-03. |
| 1916 |
|
| 1917 |
- _`body.listing`: Code listing with title (to be numbered |
| 1918 |
eventually), equivalent of "figure" and "table" directives. |
| 1919 |
|
| 1920 |
- _`pysource.usage`: Extract a usage message from the program, |
| 1921 |
either by running it at the command line with a ``--help`` option |
| 1922 |
or through an exposed API. [Suggestion for Optik.] |
| 1923 |
|
| 1924 |
- _`body.float`: Generic float that can be used for figures, tables, |
| 1925 |
code listings, flowcharts, ... |
| 1926 |
|
| 1927 |
There is a Sphinx extension by Ignacio Fernández Galván <[email protected]> |
| 1928 |
|
| 1929 |
I implemented something for generic floats in sphinx, and submitted a |
| 1930 |
pull request that is still waiting:: |
| 1931 |
|
| 1932 |
.. float:: |
| 1933 |
:type: figure |
| 1934 |
:caption: My caption |
| 1935 |
|
| 1936 |
https://github.com/sphinx-doc/sphinx/pull/1858 |
| 1937 |
|
| 1938 |
|
| 1939 |
Interpreted Text |
| 1940 |
---------------- |
| 1941 |
|
| 1942 |
Interpreted text is entirely a reStructuredText markup construct, a |
| 1943 |
way to get around built-in limitations of the medium. Some roles are |
| 1944 |
intended to introduce new doctree elements, such as "title-reference". |
| 1945 |
Others are merely convenience features, like "RFC". |
| 1946 |
|
| 1947 |
All supported interpreted text roles must already be known to the |
| 1948 |
Parser when they are encountered in a document. Whether pre-defined |
| 1949 |
in core/client code, or in the document, doesn't matter; the roles |
| 1950 |
just need to have already been declared. Adding a new role may |
| 1951 |
involve adding a new element to the DTD and may require extensive |
| 1952 |
support, therefore such additions should be well thought-out. There |
| 1953 |
should be a limited number of roles. |
| 1954 |
|
| 1955 |
The only place where no limit is placed on variation is at the start, |
| 1956 |
at the Reader/Parser interface. Transforms are inserted by the Reader |
| 1957 |
into the Transformer's queue, where non-standard elements are |
| 1958 |
converted. Once past the Transformer, no variation from the standard |
| 1959 |
Docutils doctree is possible. |
| 1960 |
|
| 1961 |
An example is the Python Source Reader, which will use interpreted |
| 1962 |
text extensively. The default role will be "Python identifier", which |
| 1963 |
will be further interpreted by namespace context into <class>, |
| 1964 |
<method>, <module>, <attribute>, etc. elements (see pysource.dtd), |
| 1965 |
which will be transformed into standard hyperlink references, which |
| 1966 |
will be processed by the various Writers. No Writer will need to have |
| 1967 |
any knowledge of the Python-Reader origin of these elements. |
| 1968 |
|
| 1969 |
* Add explicit interpreted text roles for the rest of the implicit |
| 1970 |
inline markup constructs: named-reference, anonymous-reference, |
| 1971 |
footnote-reference, citation-reference, substitution-reference, |
| 1972 |
target, uri-reference (& synonyms). |
| 1973 |
|
| 1974 |
* Add directives for each role as well? This would allow indirect |
| 1975 |
nested markup:: |
| 1976 |
|
| 1977 |
This text contains |nested inline markup|. |
| 1978 |
|
| 1979 |
.. |nested inline markup| emphasis:: |
| 1980 |
|
| 1981 |
nested ``inline`` markup |
| 1982 |
|
| 1983 |
* Implement roles: |
| 1984 |
|
| 1985 |
- "_`raw-wrapped`" (or "_`raw-wrap`"): Base role to wrap raw text |
| 1986 |
around role contents. |
| 1987 |
|
| 1988 |
For example, the following reStructuredText source ... :: |
| 1989 |
|
| 1990 |
.. role:: red(raw-formatting) |
| 1991 |
:prefix: |
| 1992 |
:html: <font color="red"> |
| 1993 |
:latex: {\color{red} |
| 1994 |
:suffix: |
| 1995 |
:html: </font> |
| 1996 |
:latex: } |
| 1997 |
|
| 1998 |
colored :red:`text` |
| 1999 |
|
| 2000 |
... will yield the following document fragment:: |
| 2001 |
|
| 2002 |
<paragraph> |
| 2003 |
colored |
| 2004 |
<inline classes="red"> |
| 2005 |
<raw format="html"> |
| 2006 |
<font color="red"> |
| 2007 |
<raw format="latex"> |
| 2008 |
{\color{red} |
| 2009 |
<inline classes="red"> |
| 2010 |
text |
| 2011 |
<raw format="html"> |
| 2012 |
</font> |
| 2013 |
<raw format="latex"> |
| 2014 |
} |
| 2015 |
|
| 2016 |
Possibly without the intermediate "inline" node. |
| 2017 |
|
| 2018 |
- _`"acronym" and "abbreviation"`: Associate the full text with a |
| 2019 |
short form. Jason Diamond's description: |
| 2020 |
|
| 2021 |
I want to translate ```reST`:acronym:`` into ``<acronym |
| 2022 |
title='reStructuredText'>reST</acronym>``. The value of the |
| 2023 |
title attribute has to be defined out-of-band since you can't |
| 2024 |
parameterize interpreted text. Right now I have them in a |
| 2025 |
separate file but I'm experimenting with creating a directive |
| 2026 |
that will use some form of reST syntax to let you define them. |
| 2027 |
|
| 2028 |
Should Docutils complain about undefined acronyms or |
| 2029 |
abbreviations? |
| 2030 |
|
| 2031 |
What to do if there are multiple definitions? How to |
| 2032 |
differentiate between CSS (Content Scrambling System) and CSS |
| 2033 |
(Cascading Style Sheets) in a single document? David Priest |
| 2034 |
responds, |
| 2035 |
|
| 2036 |
The short answer is: you don't. Anyone who did such a thing |
| 2037 |
would be writing very poor documentation indeed. (Though I |
| 2038 |
note that `somewhere else in the docs`__, there's mention of |
| 2039 |
allowing replacement text to be associated with the |
| 2040 |
abbreviation. That takes care of the duplicate |
| 2041 |
acronyms/abbreviations problem, though a writer would be |
| 2042 |
foolish to ever need it.) |
| 2043 |
|
| 2044 |
__ `inline parameter syntax`_ |
| 2045 |
|
| 2046 |
How to define the full text? Possibilities: |
| 2047 |
|
| 2048 |
1. With a directive and a definition list? :: |
| 2049 |
|
| 2050 |
.. acronyms:: |
| 2051 |
|
| 2052 |
reST |
| 2053 |
reStructuredText |
| 2054 |
DPS |
| 2055 |
Docstring Processing System |
| 2056 |
|
| 2057 |
Would this list remain in the document as a glossary, or would |
| 2058 |
it simply build an internal lookup table? A "glossary" |
| 2059 |
directive could be used to make the intention clear. |
| 2060 |
Acronyms/abbreviations and glossaries could work together. |
| 2061 |
|
| 2062 |
Then again, a glossary could be formed by gathering individual |
| 2063 |
definitions from around the document. |
| 2064 |
|
| 2065 |
2. Some kind of `inline parameter syntax`_? :: |
| 2066 |
|
| 2067 |
`reST <reStructuredText>`:acronym: is `WYSIWYG <what you |
| 2068 |
see is what you get>`:acronym: plaintext markup. |
| 2069 |
|
| 2070 |
.. _inline parameter syntax: |
| 2071 |
rst/alternatives.html#parameterized-interpreted-text |
| 2072 |
|
| 2073 |
3. A combination of 1 & 2? |
| 2074 |
|
| 2075 |
The multiple definitions issue could be handled by establishing |
| 2076 |
rules of priority. For example, directive-based lookup tables |
| 2077 |
have highest priority, followed by the first inline definition. |
| 2078 |
Multiple definitions in directive-based lookup tables would |
| 2079 |
trigger warnings, similar to the rules of `implicit hyperlink |
| 2080 |
targets`__. |
| 2081 |
|
| 2082 |
__ ../ref/rst/restructuredtext.html#implicit-hyperlink-targets |
| 2083 |
|
| 2084 |
4. Using substitutions? :: |
| 2085 |
|
| 2086 |
.. |reST| acronym:: reST |
| 2087 |
:text: reStructuredText |
| 2088 |
|
| 2089 |
What do we do for other formats than HTML which do not support |
| 2090 |
tool tips? Put the full text in parentheses? |
| 2091 |
|
| 2092 |
- "figure", "table", "listing", "chapter", "page", etc: See `object |
| 2093 |
numbering and object references`_ above. |
| 2094 |
|
| 2095 |
- "glossary-term": This would establish a link to a glossary. It |
| 2096 |
would require an associated "glossary-entry" directive, whose |
| 2097 |
contents could be a definition list:: |
| 2098 |
|
| 2099 |
.. glossary-entry:: |
| 2100 |
|
| 2101 |
term1 |
| 2102 |
definition1 |
| 2103 |
term2 |
| 2104 |
definition2 |
| 2105 |
|
| 2106 |
This would allow entries to be defined anywhere in the document, |
| 2107 |
and collected (via a "glossary" directive perhaps) at one point. |
| 2108 |
|
| 2109 |
|
| 2110 |
Doctree pruning |
| 2111 |
--------------- |
| 2112 |
|
| 2113 |
[DG 2017-01-02: These are not definitive to-dos, just one developer's |
| 2114 |
opinion. Added 2009-10-13 by Günter Milde, in r6178.] |
| 2115 |
[Updated by GM 2017-02-04] |
| 2116 |
|
| 2117 |
The number of doctree nodes can be reduced by "normalizing" some related |
| 2118 |
nodes. This makes the document model and the writers somewhat simpler. |
| 2119 |
|
| 2120 |
* The "doctest" element can be replaced by literal blocks with a class |
| 2121 |
attribute (similar to the "code" directive output). |
| 2122 |
The syntax shall be left in reST. |
| 2123 |
|
| 2124 |
[DG 2017-01-02:] +0. |
| 2125 |
|
| 2126 |
Discussion |
| 2127 |
The syntax could be left in reST (for a set period of time?). |
| 2128 |
|
| 2129 |
[DG 2017-01-02:] The syntax must be left in reST, practically |
| 2130 |
forever. Removing it would introduce a huge backwards |
| 2131 |
incompatibility. Any syntax removal must be preceded by a thorough |
| 2132 |
review and planning, including a deprecation warning process. My |
| 2133 |
opinion: it's not worth it. |
| 2134 |
|
| 2135 |
* "Normalize" special admonitions (note, hint, warning, ...) during parsing |
| 2136 |
(similar to _`transforms.writer_aux.Admonitions`). There is no need to |
| 2137 |
keep them as distinct elements in the doctree specification. |
| 2138 |
|
| 2139 |
[DG 2017-01-02:] -1: <note>{body}</> is much more concise and |
| 2140 |
expressive than <admonition><title>Note</>{body}</>, and the title |
| 2141 |
translation can be put off until much later in the process. |
| 2142 |
|
| 2143 |
[GM 2017-02-04]: |
| 2144 |
|
| 2145 |
-0 for <admonition class=note><title>Note</>... instead of <note>: |
| 2146 |
a document is rarely printed/used as doctree or XML. |
| 2147 |
|
| 2148 |
+1 reduce the complexity of the doctree |
| 2149 |
(there is no 1:1 rST syntax element <-> doctree node mapping anyway). |
| 2150 |
|
| 2151 |
+2 every writer needs 9 visit_*/depart_* method pairs to handle the 9 |
| 2152 |
subtypes of an admonition, i.e. we could but also remove 36 redundant |
| 2153 |
methods (HTML, LaTeX, Manpage, ODF). |
| 2154 |
|
| 2155 |
-1 the most unfortunately named of these directives will survive. [#]_ |
| 2156 |
|
| 2157 |
.. [#] with "biblical touch" and hard to translate: |
| 2158 |
|
| 2159 |
:admonition: | Ermahnung; Verweis; Warnung; Rüge |
| 2160 |
| (exhortation; censure; warning; reprimand, rebuke) |
| 2161 |
|
| 2162 |
|
| 2163 |
Keep the special admonition directives in reStructuredText syntax. |
| 2164 |
|
| 2165 |
[DG 2017-01-02:] We must definitely keep the syntax. Removing it |
| 2166 |
would introduce a huge backwards incompatibility. |
| 2167 |
|
| 2168 |
|
| 2169 |
Unimplemented Transforms |
| 2170 |
======================== |
| 2171 |
|
| 2172 |
* _`Footnote & Citation Gathering` |
| 2173 |
|
| 2174 |
Collect and move footnotes & citations to the end of a document or the |
| 2175 |
place of a "footnotes" or "citations" directive |
| 2176 |
(see `<./ref/rst/directives.html>_`) |
| 2177 |
|
| 2178 |
Footnotes: |
| 2179 |
Collect all footnotes that are referenced in the document before the |
| 2180 |
directive (and after an eventually preceding ``.. footnotes::`` |
| 2181 |
directive) and insert at this place. |
| 2182 |
|
| 2183 |
Allows "endnotes" at a configurable place. |
| 2184 |
|
| 2185 |
Citations: |
| 2186 |
Collect citations that are referenced ... |
| 2187 |
|
| 2188 |
Citations can be: |
| 2189 |
|
| 2190 |
a) defined in the document as citation elements |
| 2191 |
|
| 2192 |
b) auto-generated from entries in a bibliographic database. |
| 2193 |
|
| 2194 |
+ based on bibstuff_? |
| 2195 |
+ also have a look at |
| 2196 |
|
| 2197 |
* CrossTeX_, a backwards-compatible, improved bibtex |
| 2198 |
re-implementation in Python (including HTML export). |
| 2199 |
(development stalled since 2 years) |
| 2200 |
|
| 2201 |
* Pybtex_,a drop-in replacement for BibTeX written in Python. |
| 2202 |
|
| 2203 |
* BibTeX styles & (experimental) pythonic style API. |
| 2204 |
* Database in BibTeX, BibTeXML and YAML formats. |
| 2205 |
* full Unicode support. |
| 2206 |
* Write to TeX, HTML and plain text. |
| 2207 |
|
| 2208 |
* `Zotero plain <http://e6h.org/%7Eegh/hg/zotero-plain/>`__ |
| 2209 |
supports Zotero databases and CSL_ styles with Docutils with an |
| 2210 |
``xcite`` role. |
| 2211 |
|
| 2212 |
* `sphinxcontrib-bibtex`_ Sphinx extension with "bibliography" |
| 2213 |
directive and "cite" role supporting BibTeX databases. |
| 2214 |
|
| 2215 |
* `Modified rst2html |
| 2216 |
<http://www.loria.fr/~rougier/coding/article/rst2html.py>`__ by |
| 2217 |
Nicolas Rougier. |
| 2218 |
|
| 2219 |
|
| 2220 |
* Automatically insert a "References" heading? |
| 2221 |
|
| 2222 |
.. _CrossTeX: http://www.cs.cornell.edu/people/egs/crosstex/ |
| 2223 |
.. _Pybtex: http://pybtex.sourceforge.net/ |
| 2224 |
.. _CSL: http://www.citationstyles.org/ |
| 2225 |
.. _sphinxcontrib-bibtex: http://sphinxcontrib-bibtex.readthedocs.org/ |
| 2226 |
|
| 2227 |
* _`Reference Merging` |
| 2228 |
|
| 2229 |
When merging two or more subdocuments (such as docstrings), |
| 2230 |
conflicting references may need to be resolved. There may be: |
| 2231 |
|
| 2232 |
* duplicate reference and/or substitution names that need to be made |
| 2233 |
unique; and/or |
| 2234 |
* duplicate footnote numbers that need to be renumbered. |
| 2235 |
|
| 2236 |
Should this be done before or after reference-resolving transforms |
| 2237 |
are applied? What about references from within one subdocument to |
| 2238 |
inside another? |
| 2239 |
|
| 2240 |
* _`Document Splitting` |
| 2241 |
|
| 2242 |
If the processed document is written to multiple files (possibly in |
| 2243 |
a directory tree), it will need to be split up. Internal references |
| 2244 |
will have to be adjusted. |
| 2245 |
|
| 2246 |
(HTML only? Initially, yes. Eventually, anything should be |
| 2247 |
splittable.) |
| 2248 |
|
| 2249 |
Ideas: |
| 2250 |
|
| 2251 |
- Insert a "destination" attribute into the root element of each |
| 2252 |
split-out document, containing the path/filename. The Output |
| 2253 |
object or Writer will recognize this attribute and split out the |
| 2254 |
files accordingly. Must allow for common headers & footers, |
| 2255 |
prev/next, breadcrumbs, etc. |
| 2256 |
|
| 2257 |
- Transform a single-root document into a document containing |
| 2258 |
multiple subdocuments, recursively. The content model of the |
| 2259 |
"document" element would have to change to:: |
| 2260 |
|
| 2261 |
<!ELEMENT document |
| 2262 |
( (title, subtitle?)?, |
| 2263 |
decoration?, |
| 2264 |
(docinfo, transition?)?, |
| 2265 |
%structure.model;, |
| 2266 |
document* )> |
| 2267 |
|
| 2268 |
(I.e., add the last line -- 0 or more document elements.) |
| 2269 |
|
| 2270 |
Let's look at the case of hierarchical (directories and files) |
| 2271 |
HTML output. Each document element containing further document |
| 2272 |
elements would correspond to a directory (with an index.html file |
| 2273 |
for the content preceding the subdocuments). Each document |
| 2274 |
element containing no subdocuments (i.e., structure model elements |
| 2275 |
only) corresponds to a concrete file with no directory. |
| 2276 |
|
| 2277 |
The natural transform would be to map sections to subdocuments, |
| 2278 |
but possibly only a given number of levels deep. |
| 2279 |
|
| 2280 |
* _`Navigation` |
| 2281 |
|
| 2282 |
If a document is split up, each segment will need navigation links: |
| 2283 |
parent, children (small TOC), previous (preorder), next (preorder). |
| 2284 |
Part of `Document Splitting`_? |
| 2285 |
|
| 2286 |
* _`List of System Messages` |
| 2287 |
|
| 2288 |
The ``system_message`` elements are inserted into the document tree, |
| 2289 |
adjacent to the problems themselves where possible. Some (those |
| 2290 |
generated post-parse) are kept until later, in |
| 2291 |
``document.messages``, and added as a special final section, |
| 2292 |
"Docutils System Messages". |
| 2293 |
|
| 2294 |
Docutils could be made to generate hyperlinks to all known |
| 2295 |
system_messages and add them to the document, perhaps to the end of |
| 2296 |
the "Docutils System Messages" section. |
| 2297 |
|
| 2298 |
Fred L. Drake, Jr. wrote: |
| 2299 |
|
| 2300 |
I'd like to propose that both parse- and transformation-time |
| 2301 |
messages are included in the "Docutils System Messages" section. |
| 2302 |
If there are no objections, I can make the change. |
| 2303 |
|
| 2304 |
The advantage of the current way of doing things is that parse-time |
| 2305 |
system messages don't require a transform; they're already in the |
| 2306 |
document. This is valuable for testing (unit tests, |
| 2307 |
tools/quicktest.py). So if we do decide to make a change, I think |
| 2308 |
the insertion of parse-time system messages ought to remain as-is |
| 2309 |
and the Messages transform ought to move all parse-time system |
| 2310 |
messages (remove from their originally inserted positions, insert in |
| 2311 |
System Messages section). |
| 2312 |
|
| 2313 |
* _`Index Generation` |
| 2314 |
|
| 2315 |
|
| 2316 |
HTML Writer |
| 2317 |
=========== |
| 2318 |
|
| 2319 |
* Make the _`list compacting` logic more generic: For example, allow |
| 2320 |
for literal blocks or line blocks inside of compact list items. |
| 2321 |
|
| 2322 |
This is not implementable as long as list compacting is done by |
| 2323 |
omitting ``<p>`` tags. List compacting would need to be done by |
| 2324 |
adjusting CSS margins instead. |
| 2325 |
|
| 2326 |
:2015-04-02: The new html writer no longer strips <p> tags but adds the |
| 2327 |
class value ``simple`` to the list. |
| 2328 |
Formatting is done by CSS --- configurable by a custom style |
| 2329 |
sheet. |
| 2330 |
|
| 2331 |
Auto-compactization can be overridden by the ``open`` vs. |
| 2332 |
``compact`` class arguments. |
| 2333 |
|
| 2334 |
* Idea for field-list rendering: hanging indent:: |
| 2335 |
|
| 2336 |
Field name (bold): First paragraph of field body begins |
| 2337 |
with the field name inline. |
| 2338 |
|
| 2339 |
If the first item of a field body is not a paragraph, |
| 2340 |
it would begin on the following line. |
| 2341 |
|
| 2342 |
:2015-04-02: The new html writer writes field-lists as definition lists |
| 2343 |
with class ``field-list``. |
| 2344 |
Formatting is done by CSS --- configurable by a custom style |
| 2345 |
sheet. The default style sheet has some examples, including a |
| 2346 |
run-in field-list style. |
| 2347 |
|
| 2348 |
* Add more support for <link> elements, especially for navigation |
| 2349 |
bars. |
| 2350 |
|
| 2351 |
The framework does not have a notion of document relationships, so |
| 2352 |
probably raw.destination_ should be used. |
| 2353 |
|
| 2354 |
We'll have framework support for document relationships when support |
| 2355 |
for `multiple output files`_ is added. The HTML writer could |
| 2356 |
automatically generate <link> elements then. |
| 2357 |
|
| 2358 |
.. _raw.destination: misc.raw_ |
| 2359 |
|
| 2360 |
* Base list compaction on the spacing of source list? Would require |
| 2361 |
parser support. (Idea: fantasai, 16 Dec 2002, doc-sig.) |
| 2362 |
|
| 2363 |
* Add a tool tip ("title" attribute?) to footnote back-links |
| 2364 |
identifying them as such. Text in Docutils language module. |
| 2365 |
|
| 2366 |
|
| 2367 |
PEP/HTML Writer |
| 2368 |
=============== |
| 2369 |
|
| 2370 |
* Remove the generic style information (duplicated from html4css1.css) |
| 2371 |
from pep.css to avoid redundancy. |
| 2372 |
|
| 2373 |
Set ``stylesheet-path`` to "html4css.css,pep.css" and the |
| 2374 |
``stylesheet-dirs`` accordingly instead. (See the xhtml11 writer for an |
| 2375 |
example.) |
| 2376 |
|
| 2377 |
|
| 2378 |
S5/HTML Writer |
| 2379 |
============== |
| 2380 |
|
| 2381 |
* Add a way to begin an untitled slide. |
| 2382 |
|
| 2383 |
* Add a way to begin a new slide, continuation, using the same title |
| 2384 |
as the previous slide? (Unnecessary?) You need that if you have a |
| 2385 |
lot of items in one section which don't fit on one slide. |
| 2386 |
|
| 2387 |
Maybe either this item or the previous one can be realized using |
| 2388 |
transitions. |
| 2389 |
|
| 2390 |
* Have a timeout on incremental items, so the colour goes away after 1 |
| 2391 |
second. |
| 2392 |
|
| 2393 |
* Add an empty, black last slide (optionally). Currently the handling |
| 2394 |
of the last slide is not very nice, it re-cycles through the |
| 2395 |
incremental items on the last slide if you hit space-bar after the |
| 2396 |
last item. |
| 2397 |
|
| 2398 |
* Add a command-line option to disable advance-on-click. |
| 2399 |
|
| 2400 |
* Add a speaker's master document, which would contain a small version |
| 2401 |
of the slide text with speaker's notes interspersed. The master |
| 2402 |
document could use ``target="whatever"`` to direct links to a |
| 2403 |
separate window on a second monitor (e.g., a projector). |
| 2404 |
|
| 2405 |
.. Note:: This item and the following items are partially |
| 2406 |
accomplished by the S5 1.2 code (currently in alpha), which has |
| 2407 |
not yet been integrated into Docutils. |
| 2408 |
|
| 2409 |
* Speaker's notes -- how to intersperse? Could use reST comments |
| 2410 |
(".."), but make them visible in the speaker's master document. If |
| 2411 |
structure is necessary, we could use a "comment" directive (to avoid |
| 2412 |
nonsensical DTD changes, the "comment" directive could produce an |
| 2413 |
untitled topic element). |
| 2414 |
|
| 2415 |
The speaker's notes could (should?) be separate from S5's handout |
| 2416 |
content. |
| 2417 |
|
| 2418 |
* The speaker's master document could use frames for easy navigation: |
| 2419 |
TOC on the left, content on the right. |
| 2420 |
|
| 2421 |
- It would be nice if clicking in the TOC frame simultaneously |
| 2422 |
linked to both the speaker's notes frame and to the slide window, |
| 2423 |
synchronizing both. Needs JavaScript? |
| 2424 |
|
| 2425 |
- TOC would have to be tightly formatted -- minimal indentation. |
| 2426 |
|
| 2427 |
- TOC auto-generated, as in the PEP Reader. (What if there already |
| 2428 |
is a "contents" directive in the document?) |
| 2429 |
|
| 2430 |
- There could be another frame on the left (top-left or bottom-left) |
| 2431 |
containing a single "Next" link, always pointing to the next slide |
| 2432 |
(synchronized, of course). Also "Previous" link? FF/Rew go to |
| 2433 |
the beginning of the next/current parent section? First/Last |
| 2434 |
also? Tape-player-style buttons like ``|<< << < > >> >>|``? |
| 2435 |
|
| 2436 |
Epub/HTML Writer |
| 2437 |
================ |
| 2438 |
|
| 2439 |
Add epub as an output format. |
| 2440 |
|
| 2441 |
epub is an open file format for ebooks based on HTML, specified by the |
| 2442 |
`International Digital Publishing Forum`_. Thus, documents in epub |
| 2443 |
format are suited to be read with `electronic reading devices`_. |
| 2444 |
|
| 2445 |
Pack the output of a HTML writer and supporting files (e.g. images) |
| 2446 |
into one single epub document. |
| 2447 |
|
| 2448 |
There are `links to two 3rd party ePub writers`__ in the Docutils link list. |
| 2449 |
Test and consider moving the better one into the docutils core. |
| 2450 |
|
| 2451 |
__ ../user/links.html#ePub |
| 2452 |
.. _International Digital Publishing Forum: http://www.idpf.org/ |
| 2453 |
.. _electronic reading devices: |
| 2454 |
https://en.wikipedia.org/wiki/List_of_e-book_readers |
| 2455 |
|
| 2456 |
|
| 2457 |
LaTeX writer |
| 2458 |
============ |
| 2459 |
|
| 2460 |
Also see the Problems__ section in the `latex writer documentation`_. |
| 2461 |
|
| 2462 |
__ ../user/latex.html#problems |
| 2463 |
|
| 2464 |
.. _latex writer documentation: ../user/latex.html |
| 2465 |
|
| 2466 |
.. _latex-variants: |
| 2467 |
../../../sandbox/latex-variants/README.html |
| 2468 |
|
| 2469 |
Bug fixes |
| 2470 |
--------- |
| 2471 |
|
| 2472 |
* Too deeply nested lists fail: generate a warning and provide |
| 2473 |
a workaround. |
| 2474 |
|
| 2475 |
2017-02-09 this is fixed for enumeration in 0.13.1 |
| 2476 |
|
| 2477 |
for others, cf. sandbox/latex-variants/tests/rst-levels.txt |
| 2478 |
|
| 2479 |
* File names of included graphics (see also `grffile` package). |
| 2480 |
|
| 2481 |
* Paragraph following field-list or table in compound is indented. |
| 2482 |
|
| 2483 |
This is a problem with the current DUfieldlist definition and with the |
| 2484 |
use of "longtable" for tables. See `other LaTeX constructs and packages |
| 2485 |
instead of re-implementations`_ for alternatives. |
| 2486 |
|
| 2487 |
|
| 2488 |
Generate clean and configurable LaTeX source |
| 2489 |
---------------------------------------------- |
| 2490 |
|
| 2491 |
Which packages do we want to use? |
| 2492 |
|
| 2493 |
+ base and "recommended" packages |
| 2494 |
|
| 2495 |
(packages that should be in a "reasonably sized and reasonably modern |
| 2496 |
LaTeX installation like the `texlive-latex-recommended` Debian package, |
| 2497 |
say): |
| 2498 |
|
| 2499 |
+ No "fancy" or "exotic" requirements. |
| 2500 |
|
| 2501 |
+ pointers to advanced packages and their use in the `latex writer |
| 2502 |
documentation`_. |
| 2503 |
|
| 2504 |
Configurable placement of figure and table floats |
| 2505 |
````````````````````````````````````````````````` |
| 2506 |
|
| 2507 |
* Special class argument to individually place figures? |
| 2508 |
|
| 2509 |
Example:: |
| 2510 |
|
| 2511 |
.. figure:: foo.pdf |
| 2512 |
:class: place-here-if-possible place-top place-bottom |
| 2513 |
|
| 2514 |
would be written as ``\figure[htb]{...}`` with |
| 2515 |
the optional args: |
| 2516 |
|
| 2517 |
:H: place-here |
| 2518 |
:h: place-here-if-possible |
| 2519 |
:t: place-top |
| 2520 |
:b: place-bottom |
| 2521 |
:p: place-on-extra-page |
| 2522 |
|
| 2523 |
Alternative: class value = "place-" + optional arg, e.g. ``:class: |
| 2524 |
place-htb``. |
| 2525 |
|
| 2526 |
Footnotes |
| 2527 |
````````` |
| 2528 |
|
| 2529 |
+ True footnotes with LaTeX auto-numbering (as option ``--latex-footnotes``) |
| 2530 |
(also for target-footnotes): |
| 2531 |
Write ``\footnote{<footnote content>}`` at the place of the |
| 2532 |
``<footnote_reference>`` node. |
| 2533 |
|
| 2534 |
+ Open questions: |
| 2535 |
|
| 2536 |
- Load hyperref_ with option "hyperfootnotes" and/or |
| 2537 |
package footnotebackref_ or leave this to the user? |
| 2538 |
|
| 2539 |
- Consider cases where LaTeX does not support footnotes |
| 2540 |
(inside tables__, headings__, caption, ...). |
| 2541 |
Use ftnxtra_, tabularx_, tabulary_, longtable_? |
| 2542 |
|
| 2543 |
__ http://www.tex.ac.uk/cgi-bin/texfaq2html?label=footintab |
| 2544 |
__ http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ftnsect |
| 2545 |
|
| 2546 |
- Consider `multiple footnote refs to common footnote text`__. |
| 2547 |
|
| 2548 |
KOMA-script classes and the KOMA scrextend_ package provide |
| 2549 |
``\footref`` that can be used for additional references to a |
| 2550 |
``\label``-ed footnote. Since 2021-05-01, ``\footref`` is provided |
| 2551 |
by the LaTeX core, too. |
| 2552 |
|
| 2553 |
__ http://www.tex.ac.uk/cgi-bin/texfaq2html?label=multfoot |
| 2554 |
|
| 2555 |
- Consider numbered vs. symbolic footnotes. |
| 2556 |
|
| 2557 |
+ document customization (links to how-to and packages) |
| 2558 |
|
| 2559 |
.. Footnote packages at CTAN (www.ctan.org/pkg/<packagename>): |
| 2560 |
|
| 2561 |
:footnote: provides a "savenotes" environment which collects all |
| 2562 |
footnotes and emits them at ``end{savenotes}`` |
| 2563 |
(texlive-latex-recommended) |
| 2564 |
|
| 2565 |
:ftnxtra_: fixes the issue of footnote inside \caption{}, |
| 2566 |
tabular environment and \section{} like commands. |
| 2567 |
|
| 2568 |
:footnotebackref_: bidirectional links to/from footnote mark to |
| 2569 |
footnote text. |
| 2570 |
|
| 2571 |
.. Footnote Discussion: |
| 2572 |
|
| 2573 |
`German tutorial |
| 2574 |
<http://www2.informatik.hu-berlin.de/~ahamann/studies/footnotes.pdf>`__ |
| 2575 |
|
| 2576 |
`wikibooks: footnote workarounds |
| 2577 |
<https://en.wikibooks.org/wiki/LaTeX/Footnotes_and_Margin_Notes#Common_problems_and_workarounds>`__ |
| 2578 |
|
| 2579 |
.. _footnotebackref: https://www.ctan.org/pkg/footnotebackref |
| 2580 |
.. _ftnxtra: https://www.ctan.org/pkg/ftnxtra |
| 2581 |
.. _hyperref: https://www.ctan.org/pkg/hyperref |
| 2582 |
.. _longtable: https://www.ctan.org/pkg/longtable |
| 2583 |
.. _scrextend: https://www.ctan.org/pkg/longtable |
| 2584 |
.. _tabularx: https://www.ctan.org/pkg/tabularx |
| 2585 |
|
| 2586 |
|
| 2587 |
Other LaTeX constructs and packages instead of re-implementations |
| 2588 |
````````````````````````````````````````````````````````````````` |
| 2589 |
|
| 2590 |
* Check the generated source with package `nag`. |
| 2591 |
|
| 2592 |
* enumitem_ (texlive-latex-extra) for field-lists? |
| 2593 |
|
| 2594 |
.. _enumitem: https://www.ctan.org/pkg/enumitem |
| 2595 |
|
| 2596 |
Default layout |
| 2597 |
-------------- |
| 2598 |
|
| 2599 |
* Use italic instead of slanted for titlereference? |
| 2600 |
|
| 2601 |
* Start a new paragraph after lists (as currently) |
| 2602 |
or continue (no blank line in source, no parindent in output)? |
| 2603 |
|
| 2604 |
Overriding: |
| 2605 |
|
| 2606 |
* continue if the `compound paragraph`_ directive is used (as currently), |
| 2607 |
or |
| 2608 |
* force a new paragraph with an empty comment. |
| 2609 |
|
| 2610 |
* Sidebar handling (environment with `framed`, `marginnote`, `wrapfig`, |
| 2611 |
...)? |
| 2612 |
|
| 2613 |
* Use optionlist for docinfo? |
| 2614 |
|
| 2615 |
* Keep literal-blocks together on a page, avoid pagebreaks. |
| 2616 |
|
| 2617 |
Failed experiments up to now: samepage, minipage, pagebreak 1 to 4 before |
| 2618 |
the block. |
| 2619 |
|
| 2620 |
Should be possible with ``--literal-block-env==lstlistings`` and some |
| 2621 |
configuration... |
| 2622 |
|
| 2623 |
* More space between title and subtitle? :: |
| 2624 |
|
| 2625 |
- \\ % subtitle% |
| 2626 |
+ \\[0.5em] % subtitle% |
| 2627 |
|
| 2628 |
.. _compound paragraph: |
| 2629 |
../ref/rst/directives.html#compound-paragraph |
| 2630 |
|
| 2631 |
Tables |
| 2632 |
`````` |
| 2633 |
|
| 2634 |
* Improve/simplify logic to set the column width in the output. |
| 2635 |
|
| 2636 |
+ Assumed reST line length for table width setting configurable, or |
| 2637 |
+ use `ltxtable` (a combination of `tabularx` (auto-width) and |
| 2638 |
`longtable` (page breaks)), or |
| 2639 |
+ use tabularx column type ``X`` and let LaTeX decide width, or |
| 2640 |
+ use tabulary_? |
| 2641 |
|
| 2642 |
.. _tabulary: https://www.ctan.org/pkg/tabulary |
| 2643 |
|
| 2644 |
* From comp.text.tex (13. 4. 2011): |
| 2645 |
|
| 2646 |
When using fixed width columns, you should ensure that the total |
| 2647 |
width does not exceed \linewidth: if the first column is p{6cm} |
| 2648 |
the second one should be p{\dimexpr\linewidth-6cm-4\tabcolsep} |
| 2649 |
because the glue \tabcolsep is added twice at every column edge. |
| 2650 |
You may also consider to set \tabcolsep to a different value... |
| 2651 |
|
| 2652 |
* csv-tables do not have a colwidth. |
| 2653 |
|
| 2654 |
* Add more classes or options, e.g. for |
| 2655 |
|
| 2656 |
+ horizontal alignment and rules. |
| 2657 |
+ long table vs. tabular (see next item). |
| 2658 |
|
| 2659 |
* Use tabular instead of longtable for tables in legends or generally |
| 2660 |
inside a float? |
| 2661 |
|
| 2662 |
Alternatively, default to tabular and use longtable only if specified |
| 2663 |
by config setting or class argument (analogue to booktable)? |
| 2664 |
|
| 2665 |
* Table heads and footer for longtable (firstpage lastpage ..)? |
| 2666 |
|
| 2667 |
* In tools.txt the option tables right column, there should be some more |
| 2668 |
spacing between the description and the next paragraph "Default:". |
| 2669 |
|
| 2670 |
* Paragraph separation in tables is hairy. |
| 2671 |
see http://www.tex.ac.uk/cgi-bin/texfaq2html?label=struttab |
| 2672 |
|
| 2673 |
- The strut solution did not work. |
| 2674 |
- setting extrarowheight added ad top of row not between paragraphs in |
| 2675 |
a cell. ALTHOUGH i set it to 2pt because, text is too close to the topline. |
| 2676 |
- baselineskip/stretch does not help. |
| 2677 |
|
| 2678 |
* Should there be two hlines after table head and on table end? |
| 2679 |
|
| 2680 |
* Place titled tables in a float ('table' environment)? |
| 2681 |
|
| 2682 |
The 'table', 'csv-table', and 'list-table' directives support an (optional) |
| 2683 |
table title. In analogy to the 'figure' directive this should map to a |
| 2684 |
table float. |
| 2685 |
|
| 2686 |
Image and figure directives |
| 2687 |
``````````````````````````` |
| 2688 |
|
| 2689 |
* compare the test case in: |
| 2690 |
|
| 2691 |
+ `<../../test/functional/input/data/standard.txt>`__ |
| 2692 |
+ `<../../test/functional/expected/standalone_rst_html4css1.html>`__ |
| 2693 |
+ `<../../test/functional/expected/standalone_rst_latex.tex>`__ |
| 2694 |
|
| 2695 |
* The default CSS styling for HTML output (plain.css, default.css) lets |
| 2696 |
text following a right- or left-aligned image float to the side of the |
| 2697 |
image/figure. |
| 2698 |
|
| 2699 |
+ Use this default also for LaTeX? |
| 2700 |
|
| 2701 |
+ Wrap text around figures/images with class argument "wrap" |
| 2702 |
(like the odt writer)? |
| 2703 |
|
| 2704 |
Use `wrapfig` (or other recommended) package. |
| 2705 |
|
| 2706 |
* support more graphic formats (especially SVG, the only standard |
| 2707 |
vector format for HTML) |
| 2708 |
|
| 2709 |
|
| 2710 |
Missing features |
| 2711 |
---------------- |
| 2712 |
|
| 2713 |
* support "figwidth" argument for figures. |
| 2714 |
|
| 2715 |
As the 'figwidth' argument is still ignored and the "natural width" of |
| 2716 |
a figure in LaTeX is 100 % of the text width, setting the 'align' |
| 2717 |
argument has currently no effect on the LaTeX output. |
| 2718 |
|
| 2719 |
* Multiple author entries in docinfo (same thing as in html). |
| 2720 |
|
| 2721 |
* Consider supporting the "compact" option and class argument (from |
| 2722 |
rst2html) as some lists look better compact and others need the space. |
| 2723 |
|
| 2724 |
* Better citation support |
| 2725 |
(see `Footnote & Citation Gathering`_). |
| 2726 |
|
| 2727 |
* If ``use-latex-citations`` is used, a bibliography is inserted right at the |
| 2728 |
end of the document. |
| 2729 |
|
| 2730 |
Put in place of the to-be-implemented "citations" directive |
| 2731 |
(see `Footnote & Citation Gathering`_). |
| 2732 |
|
| 2733 |
|
| 2734 |
Unicode to LaTeX |
| 2735 |
```````````````` |
| 2736 |
|
| 2737 |
The `LyX <http://www.lyx.org>`_ document processor has a comprehensive |
| 2738 |
Unicode to LaTeX conversion feature with a file called ``unicodesymbols`` |
| 2739 |
that lists LaTeX counterparts for a wide range of Unicode characters. |
| 2740 |
|
| 2741 |
* Use this in the LaTeXTranslator? |
| 2742 |
Think of copyright issues! |
| 2743 |
|
| 2744 |
* The "ucs" package has many translations in ...doc/latex/ucs/config/ |
| 2745 |
|
| 2746 |
* The bibstuff_ tool ships a `latex_codec` Python module! |
| 2747 |
|
| 2748 |
.. _bibstuff: http://code.google.com/p/bibstuff/ |
| 2749 |
|
| 2750 |
|
| 2751 |
XeTeX writer |
| 2752 |
```````````` |
| 2753 |
|
| 2754 |
* Glyphs missing in the font are left out in the PDF without warning |
| 2755 |
(e.g. ⇔ left-right double arrow in the functional test output). |
| 2756 |
|
| 2757 |
* Disable word-wrap (hyphenation) in literal text locally with |
| 2758 |
``providecommand{\nohyphenation}{\addfontfeatures{HyphenChar=None}}``? |
| 2759 |
|
| 2760 |
|
| 2761 |
problematic URLs |
| 2762 |
```````````````` |
| 2763 |
|
| 2764 |
* ^^ LaTeX's special syntax for characters results in "strange" replacements |
| 2765 |
(both with \href and \url). |
| 2766 |
|
| 2767 |
`file with ^^ <../strange^^name>`__: |
| 2768 |
`<../strange^^name>`__ |
| 2769 |
|
| 2770 |
* Unbalanced braces, { or }, will fail (both with \href and \url):: |
| 2771 |
|
| 2772 |
`file with { <../strange{name>`__ |
| 2773 |
`<../strange{name>`__ |
| 2774 |
|
| 2775 |
Currently, a warning is written to the error output stream. |
| 2776 |
|
| 2777 |
For correct printing, we can |
| 2778 |
|
| 2779 |
* use the \href command with "normal" escaped name argument, or |
| 2780 |
* define a url-command in the preamble :: |
| 2781 |
|
| 2782 |
\urldef{\fragileURLi}\nolinkurl{myself%[email protected]} |
| 2783 |
|
| 2784 |
but need to find a way to insert it as href argument. |
| 2785 |
|
| 2786 |
The following fails:: |
| 2787 |
|
| 2788 |
\href{https://www.w3.org/XML/Schema^^dev}{\fragileURLi} |
| 2789 |
|
| 2790 |
Use %-replacement like http://nowhere/url_with%28parens%29 ? |
| 2791 |
|
| 2792 |
-> does not work for file paths (with pdflatex and xpdf). |
| 2793 |
|
| 2794 |
|
| 2795 |
add-stylesheet option |
| 2796 |
````````````````````` |
| 2797 |
|
| 2798 |
From http://article.gmane.org/gmane.text.docutils.devel/3429/ |
| 2799 |
|
| 2800 |
The problem is that since we have a default value, we have to |
| 2801 |
differentiate between adding another stylesheet and replacing the |
| 2802 |
default. I suggest that the existing --stylesheet & --stylesheet-path |
| 2803 |
options keep their semantics to replace the existing settings. We |
| 2804 |
could introduce new --add-stylesheet & --add-stylesheet-path options, |
| 2805 |
which accumulate; further --stylesheet/--stylesheet-path options would |
| 2806 |
clear these lists. The stylesheet or stylesheet_path setting (only |
| 2807 |
one may be set), plus the added_stylesheets and added_stylesheet_paths |
| 2808 |
settings, describe the combined styles. |
| 2809 |
|
| 2810 |
For example, this run will have only one custom stylesheet: |
| 2811 |
|
| 2812 |
rstpep2html.py --stylesheet-path custom.css ... |
| 2813 |
|
| 2814 |
This run will use the default stylesheet, and the custom one: |
| 2815 |
|
| 2816 |
rstpep2html.py --add-stylesheet-path custom.css ... |
| 2817 |
|
| 2818 |
This run will use the default stylesheet, a custom local stylesheet, |
| 2819 |
and an external stylesheet: |
| 2820 |
|
| 2821 |
rstpep2html.py --add-stylesheet-path custom.css \ |
| 2822 |
--add-stylesheet https://www.example.org/external.css ... |
| 2823 |
|
| 2824 |
This run will use only the second custom stylesheet: |
| 2825 |
|
| 2826 |
rstpep2html.py --add-stylesheet-path custom.css \ |
| 2827 |
--stylesheet-path second.css ... |
| 2828 |
|
| 2829 |
|
| 2830 |
|
| 2831 |
|
| 2832 |
Front-End Tools |
| 2833 |
=============== |
| 2834 |
|
| 2835 |
* Parameterize help text & defaults somehow? Perhaps a callback? Or |
| 2836 |
initialize ``settings_spec`` in ``__init__`` or ``init_options``? |
| 2837 |
|
| 2838 |
* Disable common options that don't apply? |
| 2839 |
(This should now be easier with ``frontend.filter_settings_spec``.) |
| 2840 |
|
| 2841 |
* Add ``--section-numbering`` command line option. The "sectnum" |
| 2842 |
directive should override the ``--no-section-numbering`` command |
| 2843 |
line option then. |
| 2844 |
|
| 2845 |
* Implement the following suggestions from clig.dev? |
| 2846 |
|
| 2847 |
Display output on success, but keep it brief. |
| 2848 |
provide a --quiet option to suppress all non-essential output. |
| 2849 |
|
| 2850 |
Consider chaining several args as input and use --output |
| 2851 |
(or redirection) for output. |
| 2852 |
|
| 2853 |
-- https://clig.dev/#help |
| 2854 |
|
| 2855 |
.. _partial parsing: |
| 2856 |
https://docs.python.org/3/library/argparse.html#partial-parsing |
| 2857 |
|
| 2858 |
.. _configuration: ../user/config.html |
| 2859 |
.. _transforms: ../api/transforms.html |
| 2860 |
|
| 2861 |
|
| 2862 |
|
| 2863 |
.. |
| 2864 |
Local Variables: |
| 2865 |
mode: indented-text |
| 2866 |
indent-tabs-mode: nil |
| 2867 |
sentence-end-double-space: t |
| 2868 |
fill-column: 70 |
| 2869 |
End: |