|
1 | | -# sphinx-subfigure |
| 1 | +# sphinx-timeline |
2 | 2 |
|
3 | 3 | [![PyPI][pypi-badge]][pypi-link] |
4 | 4 |
|
5 | | -A [sphinx](https://www.sphinx-doc.org) extension to create figures with multiple images: |
6 | | - |
7 | | -- Provides a simple format for complex image layouts. |
8 | | -- Supports HTML fully, with responsive layouts, for different screen sizes |
9 | | - - LaTeX is supported, except for images that span multiple rows. |
10 | | - - degrades gracefully for other formats. |
11 | | -- Supports figure numbering and referencing. |
12 | | -- Supports image sub-captions, via `alt` text. |
| 5 | +A [sphinx](https://www.sphinx-doc.org) extension to create timelines. |
13 | 6 |
|
14 | 7 | ## Usage |
15 | 8 |
|
16 | | -Install `sphinx-subfigure` with `pip install sphinx-subfigure`, |
17 | | -then add `sphinx_subfigure` to your `conf.py` file's `extensions` variable: |
| 9 | +Install `sphinx-timeline` with `pip install sphinx-timeline`, |
| 10 | +then add `sphinx_timeline` to your `conf.py` file's `extensions` variable: |
18 | 11 |
|
19 | 12 | ```python |
20 | | -extensions = ["sphinx_subfigure"] |
| 13 | +extensions = ["sphinx_timeline"] |
21 | 14 |
|
22 | 15 | numfig = True # optional |
23 | 16 | ``` |
24 | 17 |
|
25 | | -Now add a `subfigure` directive to your document: |
| 18 | +Now add a `timeline` directive to your document: |
26 | 19 |
|
27 | 20 | ```restructuredtext |
28 | | -.. subfigure:: AA|BC |
29 | | - :layout-sm: A|B|C |
30 | | - :subcaptions: above |
31 | | - :name: myfigure |
32 | | - :class-grid: outline |
33 | | -
|
34 | | - .. image:: imageA.png |
35 | | - :alt: Image A |
36 | | -
|
37 | | - .. image:: imageB.png |
38 | | - :alt: Image B |
39 | | -
|
40 | | - .. image:: imageC.png |
41 | | - :alt: Image C |
42 | | -
|
43 | | - Figure Caption |
| 21 | +.. timeline:: |
| 22 | + - start: 1980-02-03 |
| 23 | + name: 1st event |
| 24 | + - start: 1990-02-03 |
| 25 | + name: 2nd event |
| 26 | + - start: 2000-02-03 |
| 27 | + name: 3rd event |
| 28 | + --- |
| 29 | + **{{e.start|fdtime}}**: |
| 30 | + *{{e.name}}* |
| 31 | +
|
| 32 | + Description ... |
44 | 33 | ``` |
45 | 34 |
|
46 | | -1. Each image is automatically assigned an *area identifier* (A, B, C, etc.). |
47 | | -2. Layouts are formed by composing the areas into a grid, with rows delimited by `|`. |
48 | | -3. Each area must be used exactly once in the layout, and form a single rectangle. |
49 | | -4. "Empty" areas can be designated with `.` |
50 | | -5. Additional layouts can be defined with `:layout-sm:`, `:layout-lg:`, `:layout-xl:`, for different screen sizes (HTML only). |
51 | | - |
52 | | - |
53 | | - |
54 | | -[pypi-badge]: https://img.shields.io/pypi/v/sphinx_subfigure.svg |
55 | | -[pypi-link]: https://pypi.org/project/sphinx_subfigure |
| 35 | +[pypi-badge]: https://img.shields.io/pypi/v/sphinx_timeline.svg |
| 36 | +[pypi-link]: https://pypi.org/project/sphinx_timeline |
0 commit comments