# -*- coding: utf-8 -*- # # GMT documentation build configuration file. # Refer to http://www.sphinx-doc.org/en/master/usage/configuration.html for details. # import sys, os import glob sys.path.append(os.path.abspath('_extensions')) # -- General configuration ----------------------------------------------------- needs_sphinx = '1.8' extensions = ['sphinx.ext.mathjax', 'jinja', 'youtube'] source_encoding = 'utf-8-sig' source_suffix = '.rst' master_doc = 'index' templates_path = ['_templates'] language = 'en' # Set smartquotes_action to 'qe' to disable Smart Quotes transform of -- and --- smartquotes_action = 'qe' # default language to highlight source code highlight_language = 'bash' pygments_style = 'sphinx' # -- Project configuration ------------------------------------------------ project = 'GMT' copyright = "@GMT_VERSION_YEAR@, The GMT Team." # The version shown at the top of the sidebar version = '@GMT_PACKAGE_VERSION_MAJOR@.@GMT_PACKAGE_VERSION_MINOR@' # The full version shown in the page title release = '@GMT_PACKAGE_VERSION@' # Make the "Edit on GitHub" button link to the correct branch # Default to master branch if Azure Pipelines environmental variable BUILD_SOURCEBRANCHNAME is not defined github_version = os.getenv("BUILD_SOURCEBRANCHNAME", 'master') # -- Options for HTML output --------------------------------------------------- html_theme = 'rtd' html_theme_path = ["themes"] html_theme_options = { 'sticky_navigation': False, 'includehidden': False, } html_context = { "menu_links": [ ( ' GMT Homepage', "https://www.generic-mapping-tools.org/", ), ( ' GMT Community Forum', "https://forum.generic-mapping-tools.org/", ), ( ' License', "https://github.com/GenericMappingTools/gmt/blob/master/LICENSE.TXT", ), ( ' Source Code', "https://github.com/GenericMappingTools/gmt", ), ], # Show the "Edit on Github" link # https://docs.readthedocs.io/en/latest/guides/vcs.html "display_github": True, "github_user": "GenericMappingTools", "github_repo": "gmt", "github_version": github_version, "theme_vcs_pageview_mode": "edit", "conf_py_path": "/doc/rst/source/" } # favicon of the docs html_favicon = "_static/favicon.png" html_static_path = ['_static'] html_last_updated_fmt = '%b %d, %Y' # If true, links to the reST sources are added to the pages. html_show_sourcelink = True # List of custom CSS files (needs sphinx>=1.8) html_css_files = ["style.css"] # Redefine supported_image_types for the HTML builder from sphinx.builders.html import StandaloneHTMLBuilder StandaloneHTMLBuilder.supported_image_types = [ 'image/gif', 'image/jpeg', 'image/png', 'image/svg+xml' ] # context for the jinja extension ## Count number of examples (.rst) in the source/gallery directory no_of_examples = len(glob.glob("source/gallery/ex*.rst")) jinja_contexts = { 'jinja_ctx': { 'no_of_examples': no_of_examples, } } # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('gmt', 'gmt', 'The Generic Mapping Tools data processing and display software package', '', 1), ('gmt-config', 'gmt-config', 'Get information about the gmt installation', '', 1), ('gmt_shell_functions.sh', 'gmt_shell_functions.sh', 'Practical functions to be used in GMT bourne shell scripts', '', 1), ('gmtswitch', 'gmtswitch', 'Switching between different GMT versions', '', 1), ('isogmt', 'isogmt', 'Run GMT command or script in isolation mode', '', 1), ]