Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add doc from sphinxconrib-aafig, restructure chapters
- use parts of sphinxconrib-aafig' README in sphinx.rst - put all integrations (docutils, sphinx, moin) into separate chapter and files - cleanup manual - update credits
- Loading branch information
1 parent
6ba8bf3
commit 967778c
Showing
9 changed files
with
270 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
========== | ||
Docutils | ||
========== | ||
|
||
The docutils directive is provided in `aafigure/docutils`. | ||
|
||
|
||
Docutils directive | ||
================== | ||
The ``aafigure`` directive has the following options: | ||
|
||
- ``:scale: <float>`` enlarge or shrink image | ||
|
||
- ``:line_width: <float>`` change line with (svg only currently) | ||
|
||
- ``:format: <str>`` choose backend/output format: 'svg', 'png', all | ||
bitmap formats that PIL supports can be used but only few make sense. Line | ||
drawings have a good compression and better quality when saved as PNG | ||
rather than a JPEG. The best quality will be achieved with SVG, tough not | ||
all browsers support this vector image format at this time. | ||
|
||
- ``:foreground: <str>`` foreground color in the form ``#rgb`` or ``#rrggbb`` | ||
|
||
- ``:background: <str>`` background color in the form ``#rgb`` or ``#rrggbb`` | ||
(*not* for SVG output) | ||
|
||
- ``:fill: <str>`` fill color in the form ``#rgb`` or ``#rrggbb`` | ||
|
||
- ``:name: <str>`` use this as filename instead of the automatic generated | ||
name | ||
|
||
- ``:aspect: <float>`` change aspect ratio. Effectively it is the width of the | ||
image that is multiplied by this factor. The default setting ``1`` is useful | ||
when shapes must have the same look when drawn horizontally or vertically. | ||
However, ``:aspect: 0.5`` looks more like the original ASCII and even smaller | ||
factors may be useful for timing diagrams and such. But there is a risk that | ||
text is cropped or is draw over an object beside it. | ||
|
||
The stretching is done before drawing arrows or circles, so that they are | ||
still good looking. | ||
|
||
- ``:proportional: <flag>`` use a proportional font instead of a mono-spaced | ||
one. | ||
|
||
Docutils plug-in | ||
================ | ||
The docutils-aafigure_ extension depends on the aafigure package also requires | ||
``setuptools`` (often packaged as ``python-setuptools``) and Docutils_ itself | ||
(0.5 or newer) must be installed. | ||
|
||
After that, the ``aafigure`` directive will be available. | ||
|
||
.. _docutils-aafigure: http://pypi.python.org/pypi/aafigure | ||
.. _Docutils: http://docutils.sf.net | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ aafigure Documentation | |
manual | ||
shortintro | ||
examples | ||
integrations | ||
appendix | ||
|
||
Indices and tables | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
============== | ||
Integrations | ||
============== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
sphinxext | ||
docutils | ||
moinmoin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
================== | ||
MoinMoin plug-in | ||
================== | ||
MoinMoin_ is a popular Wiki engine. The plug-in allows to use aafigure drawings | ||
within wiki pages. | ||
|
||
Copy the file ``aafig.py`` from ``examples/moinmoin`` to | ||
``wiki/data/plugin/parser`` of the wiki. The aafigure module itself needs to | ||
be installed for the Python version that is used to run MoinMoin_ (see above for | ||
instructions). | ||
|
||
Tested with MoinMoin 1.8. | ||
|
||
See also: http://moinmo.in/ParserMarket/AaFigure | ||
|
||
.. _MoinMoin: http://moinmo.in | ||
|
||
Usage | ||
===== | ||
ASCII Art figures can be inserted into a MoinMoin_ WikiText page the following | ||
way:: | ||
|
||
{{{#!aafig scale=1.5 foreground=#ff1010 | ||
DD o---> | ||
}}} | ||
|
||
The parser name is ``aafig`` and options are appended, separated with spaces. | ||
Options that require a value take that after a ``=`` without any whitespace | ||
between option and value. Supported options are: | ||
|
||
- ``scale=<float>`` | ||
- ``aspect=<float>`` | ||
- ``textual`` | ||
- ``textual_strict`` | ||
- ``proportional`` | ||
- ``linewidth=<float>`` | ||
- ``foreground=#rrggbb`` | ||
- ``fill=#rrggbb`` | ||
|
||
There is no ``background`` as the SVG backend ignores that. And it is not possible | ||
to pass generic options. | ||
|
||
The images are generated and stored in MoinMoin's internal cache. So there is | ||
no mess with attached files on the page. Each change on an image generates a | ||
new cache entry so the cache may grow over time. However the files can be | ||
deleted with no problem as they can be rebuilt when the page is viewed again | ||
(the old files are not automatically deleted as they are still used when older | ||
revision of a page is displayed). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.