Skip to content

Commit 9d7972e

Browse files
committed
skpkg: docs
1 parent 4b7b89c commit 9d7972e

File tree

3 files changed

+43
-7
lines changed

3 files changed

+43
-7
lines changed

doc/source/conf.py

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# diffpy.structure documentation build configuration file, created by
4+
# diffpy.structure documentation build configuration file, created by # noqa: E501
55
# sphinx-quickstart on Thu Jan 30 15:49:41 2014.
66
#
77
# This file is execfile()d with the current directory set to its
@@ -18,15 +18,21 @@
1818
from importlib.metadata import version
1919
from pathlib import Path
2020

21+
# Attempt to import the version dynamically from GitHub tag.
22+
try:
23+
fullversion = version("diffpy.structure")
24+
except Exception:
25+
fullversion = "No version found. The correct version will appear in the released version." # noqa: E501
26+
2127
# If extensions (or modules to document with autodoc) are in another directory,
2228
# add these directories to sys.path here. If the directory is relative to the
23-
# documentation root, use Path().resolve() to make it absolute, like shown here.
29+
# documentation root, use Path().resolve() to make it absolute, like shown here. # noqa: E501
2430
# sys.path.insert(0, str(Path(".").resolve()))
2531
sys.path.insert(0, str(Path("../..").resolve()))
2632
sys.path.insert(0, str(Path("../../src").resolve()))
2733

2834
# abbreviations
29-
ab_authors = "Billinge Group members and community contributors"
35+
ab_authors = "Chris Farrow, Pavol Juhas, Simon Billinge, Billinge Group members"
3036

3137
# -- General configuration ------------------------------------------------
3238

@@ -43,6 +49,7 @@
4349
"sphinx.ext.viewcode",
4450
"sphinx.ext.intersphinx",
4551
"sphinx_rtd_theme",
52+
"sphinx_copybutton",
4653
"m2r",
4754
]
4855

@@ -68,7 +75,6 @@
6875
# |version| and |release|, also used in various other places throughout the
6976
# built documents.
7077

71-
fullversion = version(project)
7278
# The short X.Y version.
7379
version = "".join(fullversion.split(".post")[:1])
7480
# The full version, including alpha/beta/rc tags.
@@ -88,6 +94,11 @@
8894
# substitute YEAR in the copyright string
8995
copyright = copyright.replace("%Y", year)
9096

97+
# For sphinx_copybutton extension.
98+
# Do not copy "$" for shell commands in code-blocks.
99+
copybutton_prompt_text = r"^\$ "
100+
copybutton_prompt_is_regexp = True
101+
91102
# List of patterns, relative to source directory, that match files and
92103
# directories to ignore when looking for source files.
93104
exclude_patterns = ["build"]
@@ -123,6 +134,14 @@
123134
#
124135
html_theme = "sphinx_rtd_theme"
125136

137+
html_context = {
138+
"display_github": True,
139+
"github_user": "diffpy",
140+
"github_repo": "diffpy.structure",
141+
"github_version": "main",
142+
"conf_py_path": "/doc/source/",
143+
}
144+
126145
# Theme options are theme-specific and customize the look and feel of a theme
127146
# further. For a list of options available for each theme, see the
128147
# documentation.
@@ -221,7 +240,13 @@
221240
# (source start file, target name, title,
222241
# author, documentclass [howto, manual, or own class]).
223242
latex_documents = [
224-
("index", "diffpy.structure.tex", "diffpy.structure Documentation", ab_authors, "manual"),
243+
(
244+
"index",
245+
"diffpy.structure.tex",
246+
"diffpy.structure Documentation",
247+
ab_authors,
248+
"manual",
249+
),
225250
]
226251

227252
# The name of an image file (relative to this directory) to place at the top of
@@ -249,7 +274,15 @@
249274

250275
# One entry per manual page. List of tuples
251276
# (source start file, name, description, authors, manual section).
252-
man_pages = [("index", "diffpy.structure", "diffpy.structure Documentation", ab_authors, 1)]
277+
man_pages = [
278+
(
279+
"index",
280+
"diffpy.structure",
281+
"diffpy.structure Documentation",
282+
ab_authors,
283+
1,
284+
)
285+
]
253286

254287
# If true, show URL addresses after external links.
255288
# man_show_urls = False

doc/source/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Pavol Juhás, Christopher L. Farrow, Xiaohao Yang, Simon J.L. Billinge.
2929
For a detailed list of contributors see
3030
https://github.com/diffpy/diffpy.structure/graphs/contributors.
3131

32+
===============
3233
Acknowledgments
3334
===============
3435

@@ -38,9 +39,11 @@ Less common settings of space groups were generating using the
3839
Computational Crystallography Toolbox,
3940
http://cctbx.sourceforge.net.
4041

42+
``diffpy.structure`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.
4143

4244
.. index:: citation, reference
4345

46+
=========
4447
Reference
4548
=========
4649

doc/source/license.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Copyright (c) 2014, Australian Synchrotron Research Program Inc., ("ASRP")
2222

2323
Copyright (c) 2014-2019, Brookhaven Science Associates, Brookhaven National Laboratory
2424

25-
Copyright (c) 2024, The Trustees of Columbia University in the City of New York.
25+
Copyright (c) 2024-2025, The Trustees of Columbia University in the City of New York.
2626
All rights reserved.
2727

2828
The "DiffPy-CMI" is distributed subject to the following license conditions:

0 commit comments

Comments
 (0)