Closed seisman closed 5 years ago
If I understand the codes correctly, this extension convert gmt-plot directive to an HTML snippet using a Jinja template.
I think it's better to convert gmt-plot directive to a rst snippet.
.. gmt-plot:: :figure: example_02.png gmt begin map ps gmt ... gmt end
should be equivalent to:
.. figure:: images/xxx.png :options: .. code-block:: gmt begin map pdf gmt ... gmt end
This is exactly how the matplotlib's plot directive does (see https://github.com/matplotlib/matplotlib/blob/f93222a555160bf967f02dae42cce39a03384774/lib/matplotlib/sphinxext/plot_directive.py#L348).
Yep, you're absolutely right. This would also make it work for PDF or EPUB output.
If I understand the codes correctly, this extension convert gmt-plot directive to an HTML snippet using a Jinja template.
I think it's better to convert gmt-plot directive to a rst snippet.
should be equivalent to:
This is exactly how the matplotlib's plot directive does (see https://github.com/matplotlib/matplotlib/blob/f93222a555160bf967f02dae42cce39a03384774/lib/matplotlib/sphinxext/plot_directive.py#L348).