|
| 1 | +Images |
| 2 | +====== |
| 3 | + |
| 4 | +This directory contains images for use in the documentation. |
| 5 | + |
| 6 | +Creating an image |
| 7 | +----------------- |
| 8 | + |
| 9 | +A variety of tools can be used to create an image. The appropriate |
| 10 | +choice depends on the nature of the image. We prefer workflows that |
| 11 | +involve diffable source files. |
| 12 | + |
| 13 | +These tools are acceptable: |
| 14 | + |
| 15 | +- Graphviz (https://graphviz.org/) |
| 16 | +- Ditaa (http://ditaa.sourceforge.net/) |
| 17 | + |
| 18 | +We use SVG as the format for integrating the image into the ultimate |
| 19 | +output formats of the documentation, that is, HTML, PDF, and others. |
| 20 | +Therefore, any tool used needs to be able to produce SVG. |
| 21 | + |
| 22 | +This directory contains makefile rules to build SVG from common input |
| 23 | +formats, using some common styling. |
| 24 | + |
| 25 | +Both the source and the SVG output file are committed in this |
| 26 | +directory. That way, we don't need all developers to have all the |
| 27 | +tools installed. While we accept that there could be some gratuitous |
| 28 | +diffs in the SVG output depending the specific tool, let's keep an eye |
| 29 | +on that and keep it to a minimum. |
| 30 | + |
| 31 | +Using an image in DocBook |
| 32 | +------------------------- |
| 33 | + |
| 34 | +Here is an example for using an image in DocBook: |
| 35 | + |
| 36 | + <figure id="gin-internals-figure"> |
| 37 | + <title>GIN Internals</title> |
| 38 | + <mediaobject> |
| 39 | + <imageobject> |
| 40 | + <imagedata fileref="images/gin.svg" format="SVG" width="100%"/> |
| 41 | + </imageobject> |
| 42 | + </mediaobject> |
| 43 | + </figure> |
| 44 | + |
| 45 | +Notes: |
| 46 | + |
| 47 | +- The real action is in the <mediaobject> element, but typically a |
| 48 | + <figure> should be wrapped around it and an <xref> to the figure |
| 49 | + should be put into the text somewhere. Don't just put an image into |
| 50 | + the documentation without a link to it and an explanation of it. |
| 51 | + |
| 52 | +- Things are set up so that we only need one <imagedata> element, even |
| 53 | + with different output formats. |
| 54 | + |
| 55 | +- The attribute format="SVG" is required. If you omit it, it will |
| 56 | + still appear to work, but the stylesheets do a better job if the |
| 57 | + image is declared as SVG explicitly. |
| 58 | + |
| 59 | +- The width should be set to something. This ensures that the image |
| 60 | + is scaled to fit the page in PDF output. (Other widths than 100% |
| 61 | + might be appropriate.) |
0 commit comments