sphinx_gmt.gmtplot
A directive for including a GMT plot in a Sphinx document.
Options
The gmtplot
directive supports the following options:
- show-codebool
Whether to display the source code. The default can be changed using the
gmtplot_show_code
variable inconf.py
.- language{‘python’, ‘bash’}
Specify the language of the source code. The default can be changed using the highlight_language variable in conf.py.
- captionstr
Caption of the rendered figure.
Additionally, this directive supports options of the figure
and literalinclude
directives.
Configuration options
The following options can be set in conf.py
and will apply globally:
- gmtplot_show_codebool
Default value for the
show-code
option.- gmtplot_basedirstr
Base directory, to which
gmtplot
file 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.
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. |