-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create .readthedocs.yaml #94
Changes from 21 commits
7c5fe3f
7192b53
c2bb3f4
1baaff1
f1a85e4
b981ac4
8479e2a
6f5b146
48133ad
cde9ff0
5a6f3ff
caac39d
bbae030
d2cf38d
7b4dce4
213111d
db512fb
a84593c
3857eef
b31bb0a
379eedb
f2b1969
bc27708
2a7cd39
b3875e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.12" | ||
# You can also specify other tool versions: | ||
# nodejs: "19" | ||
# rust: "1.64" | ||
# golang: "1.19" | ||
apt_packages: | ||
- ghostscript | ||
- graphviz | ||
- texlive-full | ||
jobs: | ||
post_build: | ||
- cd docs && doxygen ./doxygen/Doxyfile.in | ||
Comment on lines
+21
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just what we were looking for :) |
||
# checks for broken links sometimes it gives false negatives | ||
# - python -m sphinx -b linkcheck -D linkcheck_timeout=1 docs/ $READTHEDOCS_OUTPUT/linkcheck | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
# formats: | ||
# - epub | ||
|
||
# Optional but recommended, declare the Python requirements required | ||
# to build your documentation | ||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
python: | ||
install: | ||
- requirements: docs/requirements.txt |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,20 +16,20 @@ | |
import os | ||
import shlex | ||
|
||
# Call doxygen in ReadtheDocs | ||
# read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' | ||
# if read_the_docs_build: | ||
|
||
|
||
# Modify Doxyfile for ReadTheDocs compatibility | ||
with open('./doxygen/Doxyfile.in', 'r') as f: | ||
fdata = f.read() | ||
fdata = fdata.replace('@PROJECT_SOURCE_DIR@', '.') | ||
with open('./doxygen/Doxyfile.in', 'w') as f: | ||
f.write(fdata) | ||
|
||
# Call doxygen | ||
from subprocess import call | ||
call(['doxygen', "./doxygen/Doxyfile.in"]) | ||
with open('./doxygen/Doxyfile.in', 'a') as f: | ||
f.write("\nOUTPUT_DIRECTORY=../_readthedocs/html/doxygen") | ||
Comment on lines
+30
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be super helpful to document where this directory is locally and where it is copied to later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This directory does not exist locally and will only exist on the read the docs server where the builds happen. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think adding a comment like this would be helpful. It beats me why it is |
||
|
||
# Call doxygen | ||
# from subprocess import call | ||
# call(['doxygen', "./doxygen/Doxyfile.in"]) | ||
|
||
|
||
# Get current directory | ||
|
@@ -69,7 +69,7 @@ | |
# The suffix(es) of source filenames. | ||
# You can specify multiple suffix as a list of string: | ||
# source_suffix = ['.rst', '.md'] | ||
source_suffix = ['.rst', '.html'] | ||
source_suffix = ['.rst'] | ||
|
||
# The encoding of source files. | ||
#source_encoding = 'utf-8-sig' | ||
|
@@ -82,21 +82,8 @@ | |
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = [] | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
|
||
root_doc = 'index' | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'alabaster' | ||
html_static_path = ['_static'] | ||
|
||
|
||
# -- Option for numbering figures/tables/etc.----------------------------------- | ||
# Note: numfig requires Sphinx (1.3+) | ||
numfig = True | ||
|
@@ -194,7 +181,9 @@ | |
# 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 = [os.path.join(conf_directory, 'sphinx/_static')] | ||
html_static_path = [os.path.join(conf_directory, 'sphinx/_build/_static')] | ||
|
||
Comment on lines
+190
to
+191
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, it would be helpful to understand why this specific path is chosen. Thinking of me trying to figure out why docs are not showing up at the remote location a few months from now :). |
||
#html_static_path = ['docs/sphinx/_build/_static/theme_overrides.css'] | ||
|
||
# Add any extra paths that contain custom files (such as robots.txt or | ||
# .htaccess) here, relative to this directory. These files are copied | ||
|
@@ -263,7 +252,7 @@ | |
# override wide tables in RTD theme | ||
# (Thanks to https://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html) | ||
# These folders are copied to the documentation's HTML output | ||
html_static_path = ['sphinx/_static/theme_overrides.css'] | ||
# html_static_path = ['sphinx/_static'] | ||
|
||
# These paths are either relative to html_static_path | ||
# or fully qualified paths (eg. https://...) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ PROJECT_ICON = | |
# entered, it will be relative to the location where doxygen was started. If | ||
# left blank the current directory will be used. | ||
|
||
OUTPUT_DIRECTORY = sphinx/_build/doxygen | ||
# OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/html/doxygen | ||
|
||
Comment on lines
-81
to
82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we using Doxygen default output dir? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is replaced by the command in conf.py but I will document this. |
||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 | ||
# sub-directories (in 2 levels) under the output directory of each output format | ||
|
@@ -2716,7 +2716,7 @@ DOT_PATH = | |
# command). | ||
# This tag requires that the tag HAVE_DOT is set to YES. | ||
|
||
DOTFILE_DIRS = @PROJECT_SOURCE_DIR@/docs | ||
DOTFILE_DIRS = | ||
|
||
# You can include diagrams made with dia in doxygen documentation. Doxygen will | ||
# then run dia to produce the diagram and insert it in the documentation. The | ||
|
@@ -2845,4 +2845,4 @@ GENERATE_TREEVIEW = YES # required! | |
DISABLE_INDEX = NO | ||
FULL_SIDEBAR = NO | ||
HTML_EXTRA_STYLESHEET = doxygen/doxygen-awesome.css | ||
HTML_COLORSTYLE = LIGHT # required with Doxygen >= 1.9.5 | ||
HTML_COLORSTYLE = LIGHT # required with Doxygen >= 1.9.5 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ Documentation | |
|
||
User guides and source code documentation are always linked on this site. | ||
`ReSolve Github Project <https://github.com/ORNL/ReSolve>`_. | ||
`Source documentation <doxygen/html/index.html>`_ | ||
`Source documentation <html/index.html>`_ | ||
Comment on lines
70
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this page is a super quick redirect, maybe we could just make the sidebar entry link straight to Doxygen docs? IMO we could also change name to just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest we leave links to both, general ReSolve documentation (top level docs) and the direct link to source documentation (Doxygen generated). The former is for users who just want to interface to ReSolve and the latter is for contributors who need to know about ReSolve's internals. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cameronrutherford looks like sphinx toctree can only include rst based documents in the toctree and there isn't very obvious support for including html files in the toctree which is what the doxygen page are. |
||
|
||
.. list-table:: | ||
:align: center | ||
|
@@ -84,7 +84,7 @@ Contributing | |
------------ | ||
|
||
For all contributions to ReSolve please follow the `developer | ||
guidelines <CONTRIBUTING.md>`__ | ||
guidelines <sphinx/coding_guide/index.html>`__ | ||
|
||
Test and Deploy | ||
--------------- | ||
|
@@ -183,8 +183,8 @@ License | |
Copyright © 2023, UT-Battelle, LLC, and Battelle Memorial Institute. | ||
|
||
ReSolve is a free software distributed under a BSD-style license. See | ||
the `LICENSE <LICENSE>`__ and `NOTICE <NOTICE>`__ files for details. All | ||
new contributions to ReSolve must be made under the smae licensing | ||
the `LICENSE <sphinx/license.rst>`__ and `NOTICE <sphinx/notice.rst>`__ files for details. All | ||
new contributions to ReSolve must be made under the same licensing | ||
pelesh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
terms. | ||
|
||
|
||
|
@@ -194,5 +194,6 @@ terms. | |
:caption: Developer Resources | ||
|
||
sphinx/coding_guide/index | ||
sphinx/licenses | ||
doxygen/index | ||
sphinx/licenses | ||
sphinx/notice |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
docutils | ||
sphinx==6.2.1 | ||
sphinx-rtd-theme==1.2.2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Notice | ||
******* | ||
|
||
.. mdinclude:: ../../NOTICE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://resolve.readthedocs.io/en/latest/sphinx/notice.html - you can't simply use an extension without installing it ;) See #92 and look a little closer into what python deps I install There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So why don't we simply write these files (license and notice) in rst format and include them without the conversion tool? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if you need texlive if we aren't rendering into a PDF.
I don't know what ghostscript is either...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ghostscript is a tool that processes postscript files and is often used with tex engines. I think it may be needed if we want to produce docs for printing. If it is not causing any unnecessary overhead, I would leave it as is for now.