#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # LAMMPS documentation build configuration file, created by # sphinx-quickstart on Sat Sep 6 14:20:08 2014. # # 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 import os has_enchant = False try: import enchant has_enchant = True except: pass LAMMPS_DOC_DIR = '@LAMMPS_DOC_DIR@' LAMMPS_SOURCE_DIR = '@LAMMPS_SOURCE_DIR@' LAMMPS_PYTHON_DIR = '@LAMMPS_PYTHON_DIR@' LAMMPS_DOXYGEN_XML_DIR = '@DOXYGEN_XML_DIR@' # 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('.')) sys.path.append(os.path.join(LAMMPS_DOC_DIR, 'src', '_ext')) # -- 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.mathjax', 'sphinx.ext.imgmath', 'sphinx.ext.autodoc', 'sphinxfortran.fortran_domain', 'sphinx_tabs.tabs', 'table_from_list', 'tab_or_note', 'breathe', ] # 2017-12-07: commented out, since this package is broken with Sphinx 16.x # yet we can no longer use Sphinx 15.x, since that breaks with # newer version of the multiprocessor module. # 'sphinxcontrib.images', images_config = { 'default_image_width' : '25%', 'default_group' : 'default' } # 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 = 'Manual' # General information about the project. project = 'LAMMPS' copyright = '2003-2021 Sandia Corporation' def get_lammps_version(): import os script_dir = os.path.dirname(os.path.realpath(__file__)) with open(os.path.join(LAMMPS_SOURCE_DIR, 'version.h'), 'r') as f: line = f.readline() start_pos = line.find('"')+1 end_pos = line.find('"', start_pos) return line[start_pos:end_pos] def get_git_info(): import subprocess,time git_n_date = '' try: gitinfo = subprocess.run(['git','describe'],stdout=subprocess.PIPE,stderr=subprocess.PIPE) if gitinfo.returncode == 0: git_n_date = gitinfo.stdout.decode().replace('_',' ') except: pass return git_n_date def get_git_commit(): import subprocess,time try: commit = subprocess.run(['git','rev-parse','HEAD'],stdout=subprocess.PIPE,stderr=subprocess.PIPE) if commit.returncode == 0: return commit.stdout.decode() except: pass return '' # 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 = get_lammps_version() # The full version, including alpha/beta/rc tags. release = get_git_info() git_commit = get_git_commit() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # 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 = ['_build'] # 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 = 'default' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # -- 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 = 'lammps_theme' # 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 = { 'logo_only' : True, 'navigation_depth': 3, 'collapse_navigation': True } # Add any paths that contain custom themes here, relative to this directory. html_theme_path = ['_themes'] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". html_title = "LAMMPS documentation" # 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 = '_static/lammps-logo.png' # 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 = '_static/lammps.ico' # 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'] # These paths are either relative to html_static_path # or fully qualified paths (eg. https://...) html_css_files = [ 'css/lammps.css', ] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # 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 = {} # 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 = False # 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 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 = 'LAMMPSdoc' html_permalinks = True html_baseurl = os.environ.get('LAMMPS_WEBSITE_BASEURL', '') if 'epub' in sys.argv: html_math_renderer = 'imgmath' else: html_math_renderer = 'mathjax' # use relative path for mathjax, so it is looked for in the # html tree and the manual becomes readable when offline mathjax_path = 'mathjax/es5/tex-mml-chtml.js' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. 'preamble': r''' \setcounter{tocdepth}{2} ''' } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('Manual', 'LAMMPS.tex', 'LAMMPS Documentation', 'The LAMMPS Developers', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False latex_toplevel_sectioning = 'part' # 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 = [ ('Manual', 'lammps', 'LAMMPS Documentation', ['Steve Plimpton'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('Manual', 'LAMMPS', 'LAMMPS Documentation', 'LAMMPS', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False # -- Options for ePUB output ---------------------------------------------- epub_title = 'LAMMPS Documentation - ' + get_lammps_version() epub_cover = ('_static/lammps-logo.png', '') epub_description = """ This is the Manual for the LAMMPS software package. LAMMPS stands for Large-scale Atomic/Molecular Massively Parallel Simulator and is a classical molecular dynamics simulation code designed to run efficiently on parallel computers. It was developed at Sandia National Laboratories, a US Department of Energy facility, with funding from the DOE. It is an open-source code, distributed freely under the terms of the GNU Public License (GPL). The primary author of the code is Steve Plimpton, who can be emailed at sjplimp@sandia.gov. The LAMMPS WWW Site at www.lammps.org has more information about the code and its uses. """ epub_author = 'The LAMMPS Developers' # configure spelling extension if present import importlib.util spelling_spec = importlib.util.find_spec("sphinxcontrib.spelling") if spelling_spec and has_enchant: extensions.append('sphinxcontrib.spelling') spelling_lang='en_US' spelling_word_list_filename='false_positives.txt' conf_script_dir = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.join(conf_script_dir, '.')) import LAMMPSLexer from sphinx.highlighting import lexers lexers['LAMMPS'] = LAMMPSLexer.LAMMPSLexer(startinline=True) sys.path.append(LAMMPS_PYTHON_DIR) # avoid syntax highlighting in blocks that don't specify language highlight_language = 'none' # autodoc configuration autodoc_member_order = 'bysource' #autoclass_content = 'both' # breathe configuration breathe_projects = { 'progguide' : LAMMPS_DOXYGEN_XML_DIR } breathe_default_project = 'progguide' breathe_show_define_initializer = True breathe_domain_by_extension = { 'h' : 'cpp', 'cpp' : 'cpp', 'c' : 'c', } # allows showing multiple versions try: html_context except NameError: html_context = dict() is_website_build = os.environ.get('LAMMPS_WEBSITE_BUILD', '0') != '0' html_context['display_manual_versions'] = is_website_build html_context['current_version'] = os.environ.get('LAMMPS_WEBSITE_BUILD_VERSION', version) html_context['git_commit'] = git_commit html_context['versions'] = [ ('latest', 'https://docs.lammps.org/latest/'), (version, 'https://docs.lammps.org/') ] html_context['downloads'] = [('PDF', 'Manual.pdf')]