Visitar URL original
Fix bug in docassert while importing an object (#17) · sdpython/sphinx-runpython@e04798d · GitHub
Skip to content

Commit e04798d

Browse files
authored
Fix bug in docassert while importing an object (#17)
* fix bug in docassert * Update docassert * remove pyquickhelper * refactoring * better * fix unit test * disable one test * fix documentation * fix urls
1 parent b853b32 commit e04798d

32 files changed

Lines changed: 1969 additions & 742 deletions

‎.github/workflows/check-urls.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
print_all: false
1818
timeout: 2
1919
retry_count# : 2
20-
# exclude_urls: https://dumps.wikimedia.org/other/pageviews/%Y/%Y-%m/pageviews-%Y%m%d-%H0000.gz,https://dumps.wikimedia.org/frwiki/latest/latest-all-titles-in-ns0.gz
20+
exclude_urls: http://www.some_url.com
2121
exclude_patterns: https://dumps.wikimedia.org/
2222
# force_pass : true
2323

‎.github/workflows/documentation.yml‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,29 @@ jobs:
6464
cp LICENSE* ./_doc
6565
cp CHANGELOGS* ./_doc
6666
67-
- name: Documentation
67+
- name: Documentation HTML
6868
run: python -m sphinx ./_doc ./dist/html -n -w doc.txt
6969

70-
- name: Summary
70+
- name: Summary HTML
71+
run: cat doc.txt
72+
73+
- name: Check for errors and warnings
74+
run: |
75+
if [[ $(grep ERROR doc.txt) ]]; then
76+
echo "Documentation produces errors."
77+
grep ERROR doc.txt
78+
exit 1
79+
fi
80+
if [[ $(grep WARNING doc.txt) ]]; then
81+
echo "Documentation produces warnings."
82+
grep WARNING doc.txt
83+
exit 1
84+
fi
85+
86+
- name: Documentation RST
87+
run: python -m sphinx -b rst ./_doc ./dist/rst -n -w doc.txt
88+
89+
- name: Summary RST
7190
run: cat doc.txt
7291

7392
- name: Check for errors and warnings
@@ -85,4 +104,4 @@ jobs:
85104
86105
- uses: actions/upload-artifact@v3
87106
with:
88-
path: ./dist/html/**
107+
path: ./dist/**

‎.gitignore‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ temp_*
1313
_doc/CHANGELOGS*
1414
_doc/LICENSE
1515
_doc/api/oo.png
16-
_doc/examples/_cache/*
1716
_doc/auto_examples/*
17+
_doc/examples/_cache/*
18+
_doc/examples/*.html
1819
_doc/examples/plot_*.png
1920
_doc/_static/require.js
2021
_doc/_static/viz.js
2122
_unittests/ut__main/*.png
2223
_unittests/ut__main/data/*.rst
2324
_unittests/ut__main/data/*.py
24-
_doc/examples/*.html
2525
_unittests/ut__main/_cache/*
2626
_unittests/ut__main/*.html
27+
_unittests/ut_runpython/*.png
28+
_unittests/ut_runpython/*.html

‎CHANGELOGS.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Change Logs
44
0.2.0
55
+++++
66

7+
* :pr:`17`: add RST writer to output the documentation into pure RST format
78
* :pr:`16`: add command line nb2py to convert notebook to python files
89
* :pr:`11`: add function make_linkcode_resolve
910
* :pr:`6`: add sphinx extension gdot

‎README.rst‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The library is released on
3535
`pypi/sphinx-runpython <https://pypi.org/project/sphinx-runpython/>`_
3636
and its documentation is published at
3737
`sphinx-runpython
38-
<https://sdpython.github.io/doc/sphinx-runpython/>`_.
38+
<https://sdpython.github.io/doc/sphinx-runpython/dev/>`_.
3939

4040
epkg
4141
++++
@@ -80,11 +80,12 @@ Executes code in the documentation and adds it to documentation.
8080
List of directives
8181
++++++++++++++++++
8282

83-
* `blocref <https://sdpython.github.io/doc/sphinx-runpython/api/blocdefs.html>`_
84-
* `collapse <https://sdpython.github.io/doc/sphinx-runpython/api/collapse.html>`_
85-
* `docassert <https://sdpython.github.io/doc/sphinx-runpython/api/docassert.html>`_
86-
* `epkg <https://sdpython.github.io/doc/sphinx-runpython/api/epkg.html>`_
87-
* `exref <https://sdpython.github.io/doc/sphinx-runpython/api/blocdefs.html>`_
88-
* `gdot <https://sdpython.github.io/doc/sphinx-runpython/api/gdot.html>`_
89-
* `mathdef <https://sdpython.github.io/doc/sphinx-runpython/api/blocdefs.html>`_
90-
* `runpython <https://sdpython.github.io/doc/sphinx-runpython/api/runpython.html>`_
83+
* `blocref <https://sdpython.github.io/doc/sphinx-runpython/dev/api/blocdefs.html>`_
84+
* `collapse <https://sdpython.github.io/doc/sphinx-runpython/dev/api/collapse.html>`_
85+
* `docassert <https://sdpython.github.io/doc/sphinx-runpython/dev/api/docassert.html>`_
86+
* `epkg <https://sdpython.github.io/doc/sphinx-runpython/dev/api/epkg.html>`_
87+
* `exref <https://sdpython.github.io/doc/sphinx-runpython/dev/api/blocdefs.html>`_
88+
* `gdot <https://sdpython.github.io/doc/sphinx-runpython/dev/api/gdot.html>`_
89+
* `mathdef <https://sdpython.github.io/doc/sphinx-runpython/dev/api/blocdefs.html>`_
90+
* `runpython <https://sdpython.github.io/doc/sphinx-runpython/dev/api/runpython.html>`_
91+
* `sphinx_rst_builder <https://sdpython.github.io/doc/sphinx-runpython/dev/api/rst_builder.html>`_

‎_doc/api/helpers.rst‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎_doc/api/index.rst‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ Extensions
1717
gdot
1818
runpython
1919
tools
20+
rst_builder
2021

2122
Helpers
2223
=======
2324

2425
.. toctree::
2526
:maxdepth: 1
2627

27-
helpers
28+
process_rst
2829
import_object_helper

‎_doc/api/process_rst.rst‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
=======
2+
helpers
3+
=======
4+
5+
.. autofunction:: sphinx_runpython.process_rst.rst2html

‎_doc/api/rst_builder.rst‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
==================
2+
sphinx_rst_builder
3+
==================
4+
5+
This directive outputs the documentation in :epkg:`RST` format
6+
with all the sphinx directives converted into pure RST format.
7+
8+
Usage
9+
=====
10+
11+
In *conf.py*:
12+
13+
::
14+
15+
extensions = [ ...
16+
'sphinx_runpython.sphinx_rst_builder',
17+
]
18+
19+
Classes
20+
=======
21+
22+
RstBuilder
23+
++++++++++
24+
25+
.. autoclass:: sphinx_runpython.sphinx_rst_builder.RstBuilder
26+
:members:
27+
28+
RstTranslator
29+
+++++++++++++
30+
31+
.. autoclass:: sphinx_runpython.sphinx_rst_builder.RstTranslator
32+
:members:
33+
34+
RstWriter
35+
+++++++++
36+
37+
.. autoclass:: sphinx_runpython.sphinx_rst_builder.RstWriter
38+
:members:

‎_doc/conf.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"sphinx_runpython.gdot",
2525
"sphinx_runpython.epkg",
2626
"sphinx_runpython.runpython",
27+
"sphinx_runpython.sphinx_rst_builder",
2728
]
2829

2930
templates_path = ["_templates"]

0 commit comments

Comments
 (0)