Release status: stable
|Implementation||Parser extension, Tag|
|Description||Embed ASCII art figures with aafigure|
|Latest version||1.0.1 (2010-12-13)|
Translate the Aafigure extension if it is available at translatewiki.net
|Check usage and version matrix.|
What can this extension do?
This extension adds an <aafigure> tag to MediaWiki for embedding an ASCII art image to be processed by the aafigure program.
<aafigure textual scale=0.9 background=ffccff> /-----------+ | MediaWiki +----+ \-----------+ | v o-----> Awesome! ^ /-----------+ | | aafigure +----+ \-----------+ </aafigure>
Enclose your ASCII art image in an <aafigure> tag. You may use any of the following attributes in the tag to send to the 'aafigure' program.
- Image output format, if allowed by the administrator. E.g., "png", "jpg", "svg"
- Scaling factor for image size.
- Aspect ratio for non-text.
- Use a proportional font instead of a fixed-width font.
- Disable fill horizontal detection. This means that fills must be at least two rows high.
- Foreground color as six hex digits, RRGGBB.
- Background color as six hex digits, RRGGBB.
- Fill color as six hex digits, RRGGBB.
The following options only work when the output format is SVG. The width and height arguments are recommended because the software does not properly figure out how large the resulting image is.
- Line width.
- Width of the SVG container in pixels.
- Height of the SVG container in pixels.
Download and Installation
- Install aafigure. On Ubuntu, apt-get install python-aafigure.
- Download the source archive.
- Extract it to an "Aafigure" sub-directory of your extensions directory.
- Add the following to your LocalSettings.php:
- Copy the content of the README file to a [[Help:Aafigure]] page.
The following variables can be set in you LocalSettings.php file.
- Path to aafigure executable. Default: "aafigure"
- Image file format, passed as --type to aafigure. Default: "png"
- Array of image formats that users are allowed to use via the "format" option. Default: none
SVG support is lacking in many ways. First, it does not compute the width and height automatically; if they are not given manually, the browser draws an incorrectly sized container. Second, it should use img tags on webkit rather than an object tag. Finally, it should fall back to PNG for non-SVG browsers (namely Internet Explorer).
This work is licensed under the Expat (aka "MIT") license.
- Extension:Graphviz (and others) for an alternate textual graph drawing program