-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
922f81e
commit 854636d
Showing
10 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ _trial_temp/ | |
apidocs/ | ||
*.egg-info | ||
.eggs | ||
.hypothesis | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
pydoctor/test/testpackages/epytext_syntax_error/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
""" | ||
Title | ||
~~~~~ | ||
Hello | ||
~~~~~ | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
API ref | ||
======= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = 'test-sphinx-ext' | ||
copyright = '2023, Contributors' | ||
author = 'Contributors' | ||
release = '0.0.1' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = [] | ||
templates_path = [] | ||
exclude_patterns = [] | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'alabaster' | ||
html_static_path = [] | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Test configuration for pydoctor.sphinx_ext.build_apidocs | ||
|
||
from pathlib import Path | ||
extensions.append("pydoctor.sphinx_ext.build_apidocs") | ||
|
||
_testpackages = Path(__file__).parent.parent.parent.joinpath('testpackages') | ||
|
||
pydoctor_args = [ | ||
'--project-name=test-sphinx-ext-api', | ||
f'--project-version={release}', | ||
'--docformat=epytext', | ||
'--intersphinx=https://docs.python.org/3/objects.inv', | ||
'--html-output={outdir}/api', | ||
f'{_testpackages / "report_trigger"}', | ||
f'{_testpackages / "epytext_syntax_error"}', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.. test-sphinx-ext documentation master file, created by | ||
sphinx-quickstart on Thu Oct 26 13:13:53 2023. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to test-sphinx-ext's documentation! | ||
=========================================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
api/index | ||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
Empty file.
19 changes: 19 additions & 0 deletions
19
pydoctor/test/testsphinxextension/tests/test_build_apidocs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
import pathlib | ||
from typing import List | ||
import xml.etree.ElementTree as ET | ||
import json | ||
|
||
from pydoctor import __version__ | ||
|
||
BASE_DIR = pathlib.Path(os.environ.get('TOX_INI_DIR', os.getcwd())) / 'build' / 'test-sphinx-ext' | ||
|
||
def test_rtd_pydoctor_call(): | ||
""" | ||
With the pydoctor Sphinx extension, the pydoctor API HTML files are | ||
generated. | ||
""" | ||
# The pydoctor index is generated and overwrites the Sphinx files. | ||
with open(BASE_DIR / 'api' / 'index.html', 'r') as stream: | ||
page = stream.read() | ||
assert 'moduleIndex.html' in page, page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters