From da1162708abd0e41f26464bf6148b199533e42b4 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 1 Dec 2020 22:19:36 -0600 Subject: [PATCH 1/2] Flake8 doc/conf --- doc/conf.py | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index ff6a4fe..926a6f5 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -16,46 +16,49 @@ # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. -#sys.path.append(os.path.abspath('some/directory')) +#sys.path.append(os.path.abspath("some/directory")) # General configuration # --------------------- # Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +# coming with Sphinx (named "sphinx.ext.*") or your custom ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.viewcode', - 'sphinx.ext.intersphinx', + "sphinx.ext.autodoc", + "sphinx.ext.viewcode", + "sphinx.ext.intersphinx", ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] -source_suffix = '.rst' +source_suffix = ".rst" # The encoding of source files. -#source_encoding = 'utf-8-sig' +#source_encoding = "utf-8-sig" # The master toctree document. -master_doc = 'index' +master_doc = "index" # General substitutions. project = "MeshPy" copyright = u"2008, Andreas Klöckner" + # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. # # The short X.Y version. def get_version(): conf = {} - exec(compile(open("../meshpy/__init__.py").read(), "../meshpy/__init__.py", 'exec'), conf) + exec(compile(open("../meshpy/__init__.py").read(), "../meshpy/__init__.py", + "exec"), conf) return conf["version"] + version = get_version() # The full version, including alpha/beta/rc tags. @@ -65,7 +68,7 @@ release = version # 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' +today_fmt = "%B %d, %Y" # List of documents that shouldn't be included in the build. #unused_docs = [] @@ -86,7 +89,7 @@ today_fmt = '%B %d, %Y' #show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # Options for HTML output @@ -102,18 +105,12 @@ html_theme_options = { } html_sidebars = { - '**': [ - 'about.html', - 'navigation.html', - 'relations.html', - 'searchbox.html', - ] -} + } # The style sheet to use for HTML and HTML Help pages. A file of that name # must exist either in Sphinx' static/ path, or in one of the custom paths # given in html_static_path. -#html_style = 'default.css' +#html_style = "default.css" # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -128,7 +125,7 @@ html_sidebars = { # 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, +# 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' @@ -158,22 +155,23 @@ html_last_updated_fmt = '%b %d, %Y' #html_file_suffix = '' # Output file base name for HTML help builder. -htmlhelp_basename = 'MeshPydoc' +htmlhelp_basename = "MeshPydoc" # Options for LaTeX output # ------------------------ -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' +# The paper size ("letter" or "a4"). +#latex_paper_size = "letter" -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' +# The font size ("10pt", "11pt" or "12pt"). +#latex_font_size = "10pt" # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, document class [howto/manual]). latex_documents = [ - ('index', 'MeshPy.tex', 'MeshPy Documentation', 'Andreas Klöckner', 'manual'), + ("index", "MeshPy.tex", "MeshPy Documentation", "Andreas Klöckner", + "manual"), ] # The name of an image file (relative to this directory) to place at the top of -- GitLab From a6a334ed0f6540e21727dcdeb8144f2f584e205c Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 1 Dec 2020 22:21:08 -0600 Subject: [PATCH 2/2] Switch to furo doc theme --- doc/conf.py | 7 ++----- doc/index.rst | 4 +++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 926a6f5..430f427 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -27,6 +27,7 @@ extensions = [ "sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.intersphinx", + "sphinx_copybutton", ] # Add any paths that contain templates here, relative to this directory. @@ -95,13 +96,9 @@ pygments_style = "sphinx" # Options for HTML output # ----------------------- -html_theme = "alabaster" +html_theme = "furo" html_theme_options = { - "extra_nav_links": { - "🚀 Github": "https://github.com/inducer/meshpy", - "💾 Download Releases": "https://pypi.python.org/pypi/meshpy", - } } html_sidebars = { diff --git a/doc/index.rst b/doc/index.rst index df227fb..dededae 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -6,7 +6,7 @@ Meshes of this type are chiefly used in finite-element simulation codes, but also have many other applications ranging from computer graphics to robotics. In order to generate these 2D and 3D meshes, MeshPy provides Python interfaces -to a few well-regarded mesh generators: +to a few well-regarded mesh generators: * `Triangle `_ by J. Shewchuk. * `TetGen `_ by Hang Si. @@ -81,6 +81,8 @@ Contents gmsh geometry faq + 🚀 Github + 💾 Download Releases MeshPy has its own `web page `_, where you can find updated software, news, a forum, and documentation. -- GitLab