Skip to content

Commit 3218ccd

Browse files
flowergrassdpgeorge
authored andcommitted
docs: Modify Makefile and indexes to generate cPy-differences pages.
1 parent b7fa63c commit 3218ccd

File tree

11 files changed

+30
-4
lines changed

11 files changed

+30
-4
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ __pycache__/
3838
######################
3939
GNUmakefile
4040
user.props
41+
42+
# Generated rst files
43+
######################
44+
genrst/

docs/Makefile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
88
BUILDDIR = build/$(MICROPY_PORT)
9+
CPYDIFFDIR = ../tools
10+
CPYDIFF = gen-cpydiff.py
11+
GENRSTDIR = genrst
912
# Run "make FORCE= ..." to avoid rebuilding from scratch (and risk
1013
# producing incorrect docs).
1114
FORCE = -E
@@ -48,11 +51,18 @@ help:
4851
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
4952
@echo " linkcheck to check all external links for integrity"
5053
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
54+
@echo " cpydiff to generate the MicroPython differences from CPython"
5155

5256
clean:
5357
rm -rf $(BUILDDIR)/*
58+
rm -f $(GENRSTDIR)/*
5459

55-
html:
60+
cpydiff:
61+
@echo "Generating MicroPython Differences."
62+
rm -f $(GENRSTDIR)/*
63+
cd $(CPYDIFFDIR) && python $(CPYDIFF)
64+
65+
html: cpydiff
5666
$(SPHINXBUILD) $(FORCE) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
5767
@echo
5868
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
@@ -106,20 +116,20 @@ epub:
106116
@echo
107117
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
108118

109-
latex:
119+
latex: cpydiff
110120
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
111121
@echo
112122
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
113123
@echo "Run \`make' in that directory to run these through (pdf)latex" \
114124
"(use \`make latexpdf' here to do that automatically)."
115125

116-
latexpdf:
126+
latexpdf: cpydiff
117127
$(SPHINXBUILD) $(FORCE) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
118128
@echo "Running LaTeX files through pdflatex..."
119129
$(MAKE) -C $(BUILDDIR)/latex all-pdf
120130
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
121131

122-
latexpdfja:
132+
latexpdfja: cpydiff
123133
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
124134
@echo "Running LaTeX files through platex and dvipdfmx..."
125135
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja

docs/esp8266_contents.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ MicroPython documentation contents
88
esp8266/tutorial/index.rst
99
library/index.rst
1010
reference/index.rst
11+
genrst/index.rst
1112
license.rst

docs/esp8266_index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ MicroPython documentation and references
55

66
esp8266/quickref.rst
77
library/index.rst
8+
genrst/index.rst
89
license.rst
910
esp8266_contents.rst
1011

docs/pyboard_contents.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ MicroPython documentation contents
99
library/index.rst
1010
reference/index.rst
1111
pyboard/hardware/index.rst
12+
genrst/index.rst
1213
license.rst
1314

docs/pyboard_index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ MicroPython documentation and references
88
pyboard/tutorial/index.rst
99
library/index.rst
1010
pyboard/hardware/index.rst
11+
genrst/index.rst
1112
license.rst
1213
pyboard_contents.rst
1314

docs/topindex.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ <h1>MicroPython documentation</h1>
4747
<span class="linkdescr">MicroPython libraries, including the <a href="{{ pathto("library/machine") }}">machine module</a></span>
4848
{% endif %}
4949
</p>
50+
<p class="biglink">
51+
<a class="biglink" href="{{ pathto("genrst/index") }}">Micropython Differences</a><br/>
52+
<span class="linkdescr">MicroPython operations which differ from CPython</span>
53+
</p>
5054
</td>
5155
<td width="40%" style="padding-left:2em;">
5256
<p class="biglink">

docs/unix_contents.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ MicroPython documentation contents
55

66
library/index.rst
77
reference/index.rst
8+
genrst/index.rst
89
license.rst

docs/unix_index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ MicroPython documentation and references
44
.. toctree::
55

66
library/index.rst
7+
genrst/index.rst
78
license.rst
89
unix_contents.rst
910

docs/wipy_contents.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ MicroPython documentation contents
88
wipy/tutorial/index.rst
99
library/index.rst
1010
reference/index.rst
11+
genrst/index.rst
1112
license.rst

0 commit comments

Comments
 (0)