sphinx_gmt.gmtplot
A directive for including a GMT plot in a Sphinx document.
Options
The gmtplot directive supports the following options:
- show-code
Whether to show the source code. The default can be changed by the
gmtplot_show_codevariable inconf.py.- language
Specify the language of the source code: either “bash” or “python”.
- caption
Caption of the rendered figure.
Additionally, this directive also supports options of the standard figure
and literalinclude directives.
Configuration options
The following options can be set in conf.py and will apply globally:
- gmtplot_show_code
Default value for the
show-codeoption. Default isTrue.- gmtplot_basedir
Base directory, to which
gmtplotfile names are relative to. If None or empty, file names are relative to the directory where the file containing the directive is. However, if it is absolute (starting with/), it is relative to the top source directory. Default isNone.- gmtplot_figure_align
The figure alignment. Default is
"center".- gmtplot_gmt_config
A dict of GMT settings that are applied to all GMT scripts. Default is
{"GMT_GRAPHICS_FORMAT": "ps"}.
Classes
|
The gmtplot directive implementation. |
Functions
|
Temporarily set environment variables inside the context manager and fully restore previous environment afterwards. |
|
Execute a multi-line block of bash code and copy the generated image files to specified output directory. |
|
Execute a multi-line block of Python code and copy the generated image files to specified output directory. |
|
Determine suffix from language. |
|
Guess language from suffix of the script. |
|
Run a GMT code and save the images in output_dir with file names derived from output_base. |
|
Add the gmtplot directive to the sphinx app. |