File tree 2 files changed +34
-12
lines changed
2 files changed +34
-12
lines changed Original file line number Diff line number Diff line change
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+ # Project page: https://readthedocs.org/projects/python-docs-theme-previews/
4
+
5
+ version : 2
6
+
7
+ build :
8
+ os : ubuntu-22.04
9
+ tools :
10
+ python : " 3"
11
+
12
+ commands :
13
+ - git clone --depth=1 https://github.com/python/cpython
14
+ - make html CPYTHON_PATH=cpython
15
+ - mv cpython/Doc/build _readthedocs
Original file line number Diff line number Diff line change 1
- CPYTHON_PATH = ../cpython
1
+ # You can set these variables from the command line.
2
+ CPYTHON_PATH = ../cpython
3
+ PYTHON = python3
2
4
PACKAGE_ABS_PATH = $(shell pwd) /$(shell find dist/python-docs-theme-* .tar.gz)
3
5
4
6
5
- .PHONY : html
6
- html : venv
7
- cd $(CPYTHON_PATH ) /Doc && \
8
- make html
9
-
7
+ .PHONY : help
8
+ help :
9
+ @echo " Please use \` make <target>' where <target> is one of"
10
+ @echo " venv to create a venv with necessary tools at $( CPYTHON_PATH) /Doc/venv"
11
+ @echo " html to make standalone CPython HTML files"
12
+ @echo " htmlview to open the index page built by the html target in your browser"
10
13
11
14
.PHONY : venv
12
15
venv :
13
- python3 -m build
16
+ $(PYTHON ) -m pip install build
17
+ $(PYTHON ) -m build
14
18
cd $(CPYTHON_PATH ) /Doc \
15
19
&& make venv \
16
20
&& ./venv/bin/pip install $(PACKAGE_ABS_PATH )
17
21
18
- .PHONY : help
19
- help :
20
- @echo " html: default rule; run the \` venv\` rule, and also rebuild the CPython docs"
21
- @echo " venv: build the package, and install it into the virtual environment"
22
- @echo " at $( CPYTHON_PATH) /Doc/venv"
22
+ .PHONY : html
23
+ html : venv
24
+ cd $(CPYTHON_PATH ) /Doc && \
25
+ make html
26
+
27
+ .PHONY : htmlview
28
+ htmlview : html
29
+ $(PYTHON ) -c " import os, webbrowser; webbrowser.open('file://' + os.path.realpath('$( CPYTHON_PATH) /Doc/build/html/index.html'))"
You can’t perform that action at this time.
0 commit comments