Skip to content

Commit

Permalink
Use common js and css code (#779)
Browse files Browse the repository at this point in the history
This PR switches docs to use the custom common js & css code merged here: rapidsai/docs#286

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - AJ Schmidt (https://github.com/ajschmidt8)

URL: #779
  • Loading branch information
galipremsagar authored Aug 4, 2022
1 parent 3def727 commit f974c7b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 49 deletions.
9 changes: 0 additions & 9 deletions docs/source/_static/params.css

This file was deleted.

90 changes: 50 additions & 40 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
# 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('sphinxext'))
sys.path.insert(0, os.path.abspath('../../python/raft'))
sys.path.insert(0, os.path.abspath('../../python/pylibraft'))
sys.path.insert(0, os.path.abspath("sphinxext"))
sys.path.insert(0, os.path.abspath("../../python/raft"))
sys.path.insert(0, os.path.abspath("../../python/pylibraft"))

from github_link import make_linkcode_resolve # noqa
from github_link import make_linkcode_resolve # noqa


# -- General configuration ------------------------------------------------
Expand All @@ -40,12 +40,12 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'numpydoc',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.linkcode',
"numpydoc",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.linkcode",
"IPython.sphinxext.ipython_console_highlighting",
"IPython.sphinxext.ipython_directive",
"breathe",
Expand All @@ -60,7 +60,7 @@
ipython_mplbackend = "str"

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

# generate autosummary even if no references
# autosummary_generate = True
Expand All @@ -72,36 +72,36 @@
source_suffix = {".rst": "restructuredtext", ".md": "markdown"}

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'raft'
copyright = '2022, nvidia'
author = 'nvidia'
project = "raft"
copyright = "2022, nvidia"
author = "nvidia"

# 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 = '22.08'
version = "22.08"
# The full version, including alpha/beta/rc tags.
release = '22.08.00'
release = "22.08.00"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

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

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

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -112,17 +112,18 @@
# a list of builtin themes.
#

html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

if not on_rtd:
# only import and set the theme if we're building docs locally
# otherwise, readthedocs.org uses their theme by default,
# so no need to specify it
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
Expand All @@ -134,30 +135,27 @@
# 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']
html_static_path = ["_static"]

html_js_files = ["example_mod.js"]

# -- Options for HTMLHelp output ------------------------------------------

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

# -- 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': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -167,29 +165,36 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'raft.tex', 'RAFT Documentation', 'nvidia', 'manual'),
(master_doc, "raft.tex", "RAFT Documentation", "nvidia", "manual"),
]

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

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, 'raft', 'RAFT Documentation', [author], 1)]
man_pages = [(master_doc, "raft", "RAFT Documentation", [author], 1)]

# -- 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 = [
(master_doc, 'raft', 'RAFT Documentation', author, 'raft',
'One line description of project.', 'Miscellaneous'),
(
master_doc,
"raft",
"RAFT Documentation",
author,
"raft",
"One line description of project.",
"Miscellaneous",
),
]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ('https://docs.python.org/', None),
"scipy": ('https://docs.scipy.org/doc/scipy/reference', None)
"python": ("https://docs.python.org/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
}

# Config numpydoc
Expand All @@ -198,17 +203,22 @@


def setup(app):
app.add_css_file('copybutton.css')
app.add_css_file('infoboxes.css')
app.add_css_file('params.css')
app.add_css_file('references.css')
app.add_css_file("copybutton.css")
app.add_css_file("infoboxes.css")
app.add_css_file("references.css")
app.add_css_file("https://docs.rapids.ai/assets/css/custom.css")
app.add_js_file(
"https://docs.rapids.ai/assets/js/custom.js", loading_method="defer"
)


# The following is used by sphinx.ext.linkcode to provide links to github
linkcode_resolve = make_linkcode_resolve(
'raft', 'https://github.com/rapidsai/raft'
'raft/blob/{revision}/python/'
'{package}/{path}#L{lineno}')
"raft",
"https://github.com/rapidsai/raft"
"raft/blob/{revision}/python/"
"{package}/{path}#L{lineno}",
)

# Set the default role for interpreted code (anything surrounded in `single
# backticks`) to be a python object. See
Expand Down

0 comments on commit f974c7b

Please sign in to comment.