Visitar URL original
Adds extension quote (#23) · sdpython/sphinx-runpython@5047d7a · GitHub
Skip to content

Commit 5047d7a

Browse files
authored
Adds extension quote (#23)
* Adds extension quote * add doc * bypass quote * fix missing extension
1 parent b376e31 commit 5047d7a

10 files changed

Lines changed: 843 additions & 5 deletions

File tree

‎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:`23`: add sphinx extension quote
78
* :pr:`21`: add sphinx extension faqref, runpython uses black
89
* :pr:`17`: add RST writer to output the documentation into pure RST format
910
* :pr:`16`: add command line nb2py to convert notebook to python files

‎_doc/api/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Extensions
1515
docassert
1616
epkg
1717
gdot
18+
quote
1819
runpython
1920
tools
2021
rst_builder

‎_doc/api/quote.rst‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
=====
2+
quote
3+
=====
4+
5+
A bloc to insert a quote from a book, a film...
6+
7+
Usage
8+
=====
9+
10+
In *conf.py*:
11+
12+
::
13+
14+
extensions = [ ...
15+
'sphinx_runpython.quote',
16+
]
17+
18+
One example:
19+
20+
::
21+
22+
.. quote::
23+
:author: Esther Duflo
24+
:book: Expérience, science et lutte contre la pauvreté
25+
:year: 2013
26+
:index: economy
27+
:pages: 26
28+
29+
[Roosevelt] It is common sense to take a method and try it:
30+
if it fails, admit frankly and try another. But above all,
31+
try something.
32+
33+
Which gives:
34+
35+
.. quote::
36+
:author: Esther Duflo
37+
:book: Expérience, science et lutte contre la pauvreté
38+
:year: 2013
39+
:index: pauvreté
40+
:pages: 26
41+
42+
[Roosevelt] It is common sense to take a method and try it:
43+
if it fails, admit frankly and try another. But above all,
44+
try something.
45+
46+
Directive
47+
=========
48+
49+
.. autoclass:: sphinx_runpython.quote.sphinx_quote_extension.QuoteNode

‎_doc/conf.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"sphinx_runpython.docassert",
2727
"sphinx_runpython.gdot",
2828
"sphinx_runpython.epkg",
29+
"sphinx_runpython.quote",
2930
"sphinx_runpython.runpython",
3031
"sphinx_runpython.sphinx_rst_builder",
3132
]

‎_unittests/ut_epkg/test_epkg_extension.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ def test_epkg_module(self):
2424
" ", ""
2525
)
2626
content = content.replace('u"', '"')
27-
28-
html = rst2html(
29-
content,
30-
writer_name="rst",
31-
)
27+
html = rst2html(content, writer_name="rst")
3228

3329
t1 = "abeforea"
3430
if t1 not in html:

0 commit comments

Comments
 (0)