Skip to content

Commit

Permalink
Add a very basic regression test for Sphinx domain cross-references
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtm committed Dec 6, 2024
1 parent 3e1944a commit 5e66845
Show file tree
Hide file tree
Showing 7 changed files with 1,226 additions and 0 deletions.
Binary file added tests_regression/sphinx/pyref.pdf
Binary file not shown.
1,086 changes: 1,086 additions & 0 deletions tests_regression/sphinx/pyref.stylelog

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions tests_regression/sphinx/test-pyref/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config

# -- Path setup --------------------------------------------------------------

# 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.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'References'
copyright = '1982, Author'
author = 'Author'

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''


# -- 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.autodoc',
'sphinx.ext.napoleon',
]

# Add any paths that contain templates here, relative to this directory.
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'

# The master toctree document.
master_doc = 'index'

# 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 = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

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

numfig = True

# -- Options for rinohtype PDF output ----------------------------------------

rinoh_documents = [{
'doc': master_doc, # top-level file (index.rst)
'target': 'pyref', # output (target.pdf)
'title': project, # document title
'author': author, # document author
'template': 'template.rtt' # document template
}]
21 changes: 21 additions & 0 deletions tests_regression/sphinx/test-pyref/dimension.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. _dimension:

Dimension
=========

.. py:currentmodule:: rinoh.dimension
References
----------


- :py:attr:`rinoh.dimension.PERCENT`, :py:attr:`PERCENT`
- :py:meth:`rinoh.dimension.Dimension.grow`, :py:meth:`Dimension.grow`


Automodule
----------

.. automodule:: rinoh.dimension
:members:
9 changes: 9 additions & 0 deletions tests_regression/sphinx/test-pyref/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
References
==========

.. toctree::
:maxdepth: 2
:caption: Contents:
:numbered:

dimension
16 changes: 16 additions & 0 deletions tests_regression/sphinx/test-pyref/stylesheet.rts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[STYLESHEET]
name = Sphinx ref
base = sphinx_base14


[title page date : Paragraph('title page date')]
hide = true

[chapter]
page_break = any

[content chapter]
page_break = any

[table of contents section]
page_break = left
11 changes: 11 additions & 0 deletions tests_regression/sphinx/test-pyref/template.rtt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[TEMPLATE_CONFIGURATION]
name=ref
template=book
stylesheet=stylesheet.rts

[contents]
page_number_prefix = '{SECTION_NUMBER(1)}-'

[back_matter]
page_number_prefix = 'I-'
page_number_format = number

0 comments on commit 5e66845

Please sign in to comment.