# -*- coding: utf-8 -*-
#
# GMT documentation build configuration file, created by
# sphinx-quickstart on Fri May 04 18:10:30 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.pngmath', 'sphinx.ext.ifconfig']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
gmt_team = u'P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe'
gmt_team_tex = u'P. Wessel, W. H. F. Smith,\\\\R. Scharroo, J. Luis, and F. Wobbe'
project = u'GMT'
copyright = u' '.join(['@GMT_VERSION_YEAR@,', gmt_team])

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '@GMT_PACKAGE_VERSION@'
# The full version, including alpha/beta/rc tags.
release = '@GMT_PACKAGE_VERSION_WITH_SVN_REVISION@'
if tags.has('tex'):
  release = release.replace("_", "\\_")

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
language = 'en'
locale_dirs = ["locale/"]

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []


# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#html_theme = 'default'
html_theme = 'rtd'
html_theme_path = ["_themes"]

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#html_theme_options = {"collapsiblesidebar": "true"}

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
#html_title = None

# A shorter title for the navigation bar.  Default is the same as html_title.
#html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None

# The name of an image file (within the static path) to use as favicon of the
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
html_sidebars = {
  '**': ['localtoc.html', 'relations.html', 'sourcelink.html'],
}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}

# If false, no module index is generated.
#html_domain_indices = True

# If false, no index is generated.
#html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False

# If true, links to the reST sources are added to the pages.
html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'GMT_Docs'


# -- Options for LaTeX output --------------------------------------------------

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
  ('GMT_Docs',  'GMT_Docs.tex',     u'GMT Documentation',     gmt_team_tex, 'manual'),
  ('GMT_API',   'GMT_API.tex',      u'GMT API Documentation', gmt_team_tex, 'manual'),
  ('man_pages', 'GMT_Manpages.tex', u'GMT Man Pages',         gmt_team_tex, 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = '@CMAKE_CURRENT_BINARY_DIR@/_source/_images/GMT_coverlogo.pdf'

# LaTeX preamble
tex_preamble = r"""
\frenchspacing % use a standard word space between sentences
\fvset{fontsize=\scriptsize} % verbatim font size
"""

# The paper size ('a4paper' or 'letterpaper') and font size.
latex_elements = {
    'papersize':'a4paper',
    'pointsize':'11pt',
    'preamble': tex_preamble}

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = []

# If false, no module index is generated.
#latex_domain_indices = True


# -- Options for manual page output --------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('blockmean', 'blockmean', 'Block average (x, y, z) data tables by L2 norm', '', 1),
('blockmedian', 'blockmedian', 'Block average (x, y, z) data tables by L1 norm', '', 1),
('blockmode', 'blockmode', 'Block average (x, y, z) data tables by mode estimation', '', 1),
('filter1d', 'filter1d', 'Do time domain filtering of 1-D data tables', '', 1),
('fitcircle', 'fitcircle', 'find mean position and pole of best-fit great [or small] circle to points on a sphere.', '', 1),
('gmt_shell_functions.sh', 'gmt_shell_functions.sh', 'Practical functions to be used in GMT bourne shell scripts', '', 1),
('gmt.conf', 'gmt.conf', 'Configuration for GMT', '', 5),
('gmt', 'gmt', 'The Generic Mapping Tools data processing and display software package', '', 1),
('gmt2kml', 'gmt2kml', 'Convert GMT data tables to KML files for Google Earth', '', 1),
('gmt5syntax', 'gmt5syntax', 'Convert old GMT script to use new \'gmt <module>\' syntax', '', 1),
('gmtcolors', 'gmtcolors', 'Explanation of color codes in GMT', '', 5),
('gmtconnect', 'gmtconnect', 'Connect individual lines whose end points match within tolerance', '', 1),
('gmtconvert', 'gmtconvert', 'Convert, Paste, and/or Extract columns from data tables', '', 1),
('gmtdefaults', 'gmtdefaults', 'List current GMT default parameters', '', 1),
('gmtget', 'gmtget', 'Get individual GMT default parameters', '', 1),
('gmtlogo', 'gmtlogo', 'Adding a GMT graphics logo overlay to an illustration', '', 1),
('gmtinfo', 'gmtinfo', 'Return information about data tables', '', 1),
('gmtmath', 'gmtmath', 'Reverse Polish Notation (RPN) calculator for data tables', '', 1),
('gmtselect', 'gmtselect', 'Select data table subsets based on multiple spatial criteria', '', 1),
('gmtset', 'gmtset', 'Change individual GMT default parameters', '', 1),
('gmtsimplify', 'gmtsimplify', 'Line reduction using the Douglas-Peucker algorithm', '', 1),
('gmtspatial', 'gmtspatial', 'Do geospatial operations on lines and polygons', '', 1),
('gmtswitch', 'gmtswitch', 'Switching between different GMT versions', '', 1),
('gmtvector', 'gmtvector', 'Basic manipulation of Cartesian vectors', '', 1),
('gmtwhich', 'gmtwhich', 'Find full path to specified files', '', 1),
('grd2cpt', 'grd2cpt', 'Make linear or histogram-equalized color palette table from grid', '', 1),
('grd2rgb', 'grd2rgb', 'Write r/g/b grid files from a grid file, a raw RGB file, or SUN rasterfile', '', 1),
('grd2xyz', 'grd2xyz', 'Convert grid file to data table', '', 1),
('grdblend', 'grdblend', 'Blend several partially over-lapping grids into one large grid', '', 1),
('grdclip', 'grdclip', 'Clip the range of grids', '', 1),
('grdcontour', 'grdcontour', 'Make contour map using a grid', '', 1),
('grdcut', 'grdcut', 'Extract subregion from a grid', '', 1),
('grdedit', 'grdedit', 'Modify header or content of a grid', '', 1),
('grdfft', 'grdfft', 'Do mathematical operations on grids in the wavenumber (or frequency) domain', '', 1),
('grdfilter', 'grdfilter', 'Filter a grid in the space (or time) domain', '', 1),
('grdgradient', 'grdgradient', 'Compute directional derivative or gradient from a grid', '', 1),
('grdhisteq', 'grdhisteq', 'Perform histogram equalization for a grid', '', 1),
('grdimage', 'grdimage', 'Project grids or images and plot them on maps', '', 1),
('grdinfo', 'grdinfo', 'Extract information from grids', '', 1),
('grdlandmask', 'grdlandmask', '"Create a ""wet-dry"" mask grid from shoreline data base"', '', 1),
('grdmask', 'grdmask', 'Create mask grid from polygons or point coverage', '', 1),
('grdmath', 'grdmath', 'Reverse Polish Notation (RPN) calculator for grids (element by element)', '', 1),
('grdpaste', 'grdpaste', 'Join two grids along their common edge', '', 1),
('grdproject', 'grdproject', 'Forward and inverse map transformation of grids', '', 1),
('grdraster', 'grdraster', 'Extract subregion from a binary raster and save as a GMT grid', '', 1),
('grdreformat', 'grdreformat', 'Convert between different grid formats', '', 1),
('grdsample', 'grdsample', 'Resample a grid onto a new lattice', '', 1),
('grdtrack', 'grdtrack', 'Sample grids at specified (x,y) locations', '', 1),
('grdtrend', 'grdtrend', 'Fit trend surface to grids and compute residuals', '', 1),
('grdvector', 'grdvector', 'Plot vector field from two component grids', '', 1),
('grdview', 'grdview', 'Create 3-D perspective image or surface mesh from a grid', '', 1),
('grdvolume', 'grdvolume', 'Calculate grid volume and area constrained by a contour', '', 1),
('greenspline', 'greenspline', 'Interpolate using Green\'s functions for splines in 1-3 dimensions', '', 1),
('isogmt', 'isogmt', 'Run GMT command or script in isolation mode', '', 1),
('kml2gmt', 'kml2gmt', 'Extract GMT table data from Google Earth KML files', '', 1),
('makecpt', 'makecpt', 'Make GMT color palette tables', '', 1),
('mapproject', 'mapproject', 'Do forward and inverse map transformations, datum conversions and geodesy', '', 1),
('nearneighbor', 'nearneighbor', '"Grid table data using a ""Nearest neighbor"" algorithm"', '', 1),
('project', 'project', 'Project table data onto lines or great circles, generate tracks, or translate coordinates', '', 1),
('ps2raster', 'ps2raster', 'Convert [E]PS file(s) to other formats using GhostScript', '', 1),
('psbasemap', 'psbasemap', 'Plot PostScript base maps', '', 1),
('psclip', 'psclip', 'Initialize or terminate polygonal clip paths', '', 1),
('pscoast', 'pscoast', 'Plot continents, shorelines, rivers, and borders on maps', '', 1),
('pscontour', 'pscontour', 'Contour table data by direct triangulation [method]', '', 1),
('pshistogram', 'pshistogram', 'Calculate and plot histograms', '', 1),
('psimage', 'psimage', 'Place images or EPS files on maps', '', 1),
('pslegend', 'pslegend', 'Plot legends on maps', '', 1),
('pslib', 'pslib', 'A PostScript based plotting library', '', 3),
('psmask', 'psmask', 'Use data tables to clip or mask map areas with no coverage', '', 1),
('psrose', 'psrose', 'Plot a polar histogram (rose, sector, windrose diagrams)', '', 1),
('psscale', 'psscale', 'Plot a gray or color scale-bar on maps', '', 1),
('pstext', 'pstext', 'Plot or typeset text on maps', '', 1),
('pswiggle', 'pswiggle', 'Plot z = f(x,y) anomalies along tracks', '', 1),
('psxy', 'psxy', 'Plot lines, polygons, and symbols on maps', '', 1),
('psxyz', 'psxyz', 'Plot lines, polygons, and symbols in 3-D', '', 1),
('sample1d', 'sample1d', 'Resample 1-D table data using splines', '', 1),
('spectrum1d', 'spectrum1d', 'Compute auto- [and cross- ] spectra from one [or two] time-series', '', 1),
('sph2grd', 'sph2grd', 'Compute grid from spherical harmonic coefficients', '', 1),
('sphdistance', 'sphdistance', 'Make grid of distances to nearest points on a sphere', '', 1),
('sphinterpolate', 'sphinterpolate', 'Spherical gridding in tension of data on a sphere', '', 1),
('sphtriangulate', 'sphtriangulate', 'Delaunay or Voronoi construction of spherical lon,lat data', '', 1),
('splitxyz', 'splitxyz', 'Split xyz[dh] data tables into individual segments', '', 1),
('surface', 'surface', 'Grid table data using adjustable tension continuous curvature splines', '', 1),
('testapi', 'testapi', 'Test API i/o methods for any data type', '', 1),
('trend1d', 'trend1d', 'Fit a [weighted] [robust] polynomial [or Fourier] model for y = f(x) to xy[w] data', '', 1),
('trend2d', 'trend2d', 'Fit a [weighted] [robust] polynomial model for z = f(x,y) to xyz[w] data', '', 1),
('triangulate', 'triangulate', 'Do optimal (Delaunay) triangulation and gridding of Cartesian table data [method]', '', 1),
('xyz2grd', 'xyz2grd', 'Convert data table to a grid file', '', 1),
('supplements/gshhg/gshhg', 'gshhg', 'Extract data tables from binary GSHHG or WDBII data files', '', 1),
('supplements/img/img2grd', 'img2grd', 'Extract subset of img file in Mercator or Geographic format', '', 1),
('supplements/meca/pscoupe', 'pscoupe', 'Plot cross-sections of focal mechanisms', '', 1),
('supplements/meca/psmeca', 'psmeca', 'Plot focal mechanisms on maps', '', 1),
('supplements/meca/pspolar', 'pspolar', 'Plot polarities on the inferior focal half-sphere on maps', '', 1),
('supplements/meca/psvelo', 'psvelo', 'Plot velocity vectors, crosses, and wedges on maps', '', 1),
('supplements/mgd77/mgd77convert', 'mgd77convert', 'Convert MGD77 data to other file formats', '', 1),
('supplements/mgd77/mgd77info', 'mgd77info', 'Extract information about MGD77 files', '', 1),
('supplements/mgd77/mgd77list', 'mgd77list', 'Extract data from MGD77 files', '', 1),
('supplements/mgd77/mgd77magref', 'mgd77magref', 'Evaluate the IGRF or CM4 magnetic field models', '', 1),
('supplements/mgd77/mgd77manage', 'mgd77manage', 'Manage the content of MGD77+ files', '', 1),
('supplements/mgd77/mgd77path', 'mgd77path', 'Return paths to MGD77 cruises and directories', '', 1),
('supplements/mgd77/mgd77sniffer', 'mgd77sniffer', 'Along-track quality control of MGD77 cruises', '', 1),
('supplements/mgd77/mgd77track', 'mgd77track', 'Plot track-line map of MGD77 cruises', '', 1),
('supplements/misc/dimfilter', 'dimfilter', 'Directional filtering of 2-D gridded files in the space (or time) domain', '', 1),
('supplements/potential/gmtgravmag3d', 'gmtgravmag3d', 'Compute the gravity/magnetic effect of a body by the method of Okabe', '', 1),
('supplements/potential/gravfft', 'gravfft', 'Compute gravitational attraction of 3-D surfaces in the wavenumber (or frequency) domain', '', 1),
('supplements/potential/grdgravmag3d', 'grdgravmag3d', 'Compute the gravity effect of a grid by the method of Okabe', '', 1),
('supplements/potential/grdredpol', 'grdredpol', 'Compute the Continuous Reduction To the Pole, AKA differential RTP.', '', 1),
('supplements/potential/grdseamount', 'grdseamount', 'Compute synthetic seamount (Gaussian or cone, circular or elliptical) bathymetry', '', 1),
('supplements/segy/pssegy', 'pssegy', 'Plot a SEGY file on a map', '', 1),
('supplements/segy/pssegyz', 'pssegyz', 'Create imagemasked postscript from SEGY file', '', 1),
('supplements/segy/segy2grd', 'segy2grd', 'Converting SEGY data to a GMT grid', '', 1),
('supplements/spotter/backtracker', 'backtracker', 'Generate forward and backward flowlines and hotspot tracks', '', 1),
('supplements/spotter/grdpmodeler', 'grdpmodeler', 'Evaluate a plate model on a geographic grid', '', 1),
('supplements/spotter/grdrotater', 'grdrotater', 'Finite rotation reconstruction of geographic grid', '', 1),
('supplements/spotter/grdspotter', 'grdspotter', 'Create CVA image from a gravity or topography grid', '', 1),
('supplements/spotter/hotspotter', 'hotspotter', 'Create CVA image from seamount locations', '', 1),
('supplements/spotter/originator', 'originator', 'Associate seamounts with nearest hotspot point sources', '', 1),
('supplements/spotter/rotconverter', 'rotconverter', 'Manipulate total reconstruction and stage rotations', '', 1),
('supplements/x2sys/x2sys_binlist', 'x2sys_binlist', 'Create bin index listing from track data files', '', 1),
('supplements/x2sys/x2sys_cross', 'x2sys_cross', 'Calculate crossovers between track data files', '', 1),
('supplements/x2sys/x2sys_datalist', 'x2sys_datalist', 'Extract content of track data files', '', 1),
('supplements/x2sys/x2sys_get', 'x2sys_get', 'Get track listing from the x2sys track index databases', '', 1),
('supplements/x2sys/x2sys_init', 'x2sys_init', 'Initialize a new x2sys track database', '', 1),
('supplements/x2sys/x2sys_list', 'x2sys_list', 'Extract subset from crossover data base', '', 1),
('supplements/x2sys/x2sys_merge', 'x2sys_merge', 'Merge an updated COEs table (smaller) into the main table (bigger)', '', 1),
('supplements/x2sys/x2sys_put', 'x2sys_put', 'Update track index database from track bin file', '', 1),
('supplements/x2sys/x2sys_report', 'x2sys_report', 'Report statistics from crossover data base', '', 1),
('supplements/x2sys/x2sys_solve', 'x2sys_solve', 'Determine least-squares systematic correction from crossovers', '', 1)
]


# -- Options for Epub output ---------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = u'GMT'
epub_author = gmt_team
epub_publisher = gmt_team
epub_copyright = copyright

# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''

# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''

# A unique identification for the text.
#epub_uid = ''

# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []

# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []

# A list of files that should not be packed into the epub file.
#epub_exclude_files = []

# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3

# Allow duplicate toc entries.
#epub_tocdup = True

