Skip to content

Commit 1c820ac

Browse files
authored
bpo-36329: Replace 'make serve' with 'make htmlview' (python#826)
* bpo-36329: Replace 'make serve' with 'make htmlview' * Document htmlview in help * Direct users of serve towards htmlview instead * Add quotes around target names for clarity
1 parent 95c08f2 commit 1c820ac

File tree

3 files changed

+23
-46
lines changed

3 files changed

+23
-46
lines changed

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ PAPEROPT_letter = -D latex_paper_size=letter
1414
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1515

1616
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp \
17-
devhelp epub latex latexpdf text man changes linkcheck doctest check \
18-
serve
17+
devhelp epub latex latexpdf text man changes linkcheck doctest htmlview check
1918

2019
help:
2120
@echo "Please use \`make <target>' where <target> is one of"
2221
@echo " html to make standalone HTML files"
22+
@echo " htmlview to open the index page built by the html target in your browser"
2323
@echo " dirhtml to make HTML files named index.html in directories"
2424
@echo " singlehtml to make a single large HTML file"
2525
@echo " pickle to make pickle files"
@@ -36,7 +36,6 @@ help:
3636
@echo " linkcheck to check all external links for integrity"
3737
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
3838
@echo " check to run a check for frequent markup errors"
39-
@echo " serve to serve devguide on the localhost (8000)"
4039

4140
clean:
4241
-rm -rf $(BUILDDIR)/*
@@ -139,8 +138,12 @@ doctest: venv
139138
@echo "Testing of doctests in the sources finished, look at the " \
140139
"results in $(BUILDDIR)/doctest/output.txt."
141140

141+
htmlview: html
142+
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('_build/html/index.html'))"
143+
142144
check:
143145
$(PYTHON) tools/rstlint.py -i tools -i venv
144146

145-
serve: html
146-
tools/serve.py _build/html
147+
serve:
148+
@echo "The 'serve' target was removed, use 'htmlview' instead" \
149+
"(see https://github.com/python/cpython/issues/80510)"

make.bat

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ if NOT "%PAPER%" == "" (
1717
)
1818

1919
if "%1" == "check" goto check
20-
if "%1" == "serve" goto serve
2120

2221
if "%1" == "" goto help
2322
if "%1" == "help" (
2423
:help
2524
echo.Please use `make ^<target^>` where ^<target^> is one of
2625
echo. html to make standalone HTML files
26+
echo. htmlview to open the index page built by the html target in your browser
2727
echo. dirhtml to make HTML files named index.html in directories
2828
echo. singlehtml to make a single large HTML file
2929
echo. pickle to make pickle files
@@ -39,7 +39,6 @@ if "%1" == "help" (
3939
echo. linkcheck to check all external links for integrity
4040
echo. doctest to run all doctests embedded in the documentation if enabled
4141
echo. check to check for stylistic and formal issues using rstlint
42-
echo. serve to serve devguide on the localhost ^(8000^)
4342
goto end
4443
)
4544

@@ -49,7 +48,7 @@ if "%1" == "clean" (
4948
goto end
5049
)
5150

52-
rem Targets other than "clean", "check", "serve", "help", or "" need the
51+
rem Targets other than "clean", "check", "help", or "" need the
5352
rem Sphinx build command, which the user may define via SPHINXBUILD.
5453

5554
if not defined SPHINXBUILD (
@@ -72,6 +71,17 @@ if "%1" == "html" (
7271
goto end
7372
)
7473

74+
if "%1" == "htmlview" (
75+
cmd /C %this% html
76+
77+
if EXIST "%BUILDDIR%\html\index.html" (
78+
echo.Opening "%BUILDDIR%\html\index.html" in the default web browser...
79+
start "" "%BUILDDIR%\html\index.html"
80+
)
81+
82+
goto end
83+
)
84+
7585
if "%1" == "dirhtml" (
7686
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
7787
if errorlevel 1 exit /b 1
@@ -196,7 +206,8 @@ cmd /C %PYTHON% tools\rstlint.py -i tools -i venv
196206
goto end
197207

198208
:serve
199-
cmd /C %PYTHON% tools\serve.py %BUILDDIR%\html
209+
echo.The serve target was removed, use htmlview instead ^
210+
(see https://github.com/python/cpython/issues/80510)
200211
goto end
201212

202213
:end

tools/serve.py

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

0 commit comments

Comments
 (0)