sphinx-doc / sphinx-autobuild

Watch a Sphinx directory and rebuild the documentation when a change is detected. Also includes a hot-reload web server.
MIT License
523 stars 75 forks source link

Additional rebuild commands via --pre-build #90

Closed pradyunsg closed 3 years ago

pradyunsg commented 3 years ago

Supercedes and closes #70 Resolves #69

pradyunsg commented 3 years ago

In case you're wondering what things look like now:

$ sphinx-autobuild -b html docs/ build/docs --pre-build 'python -c "print(10)"'
+------------------------- pre-build for initial build --------------------------
| 10
+-------------------------------- initial build ---------------------------------
| Running Sphinx v3.2.1
WARNING: html_static_path entry '_static' does not exist
| loading pickled environment... done
| building [mo]: targets for 0 po files that are out of date
| building [html]: targets for 0 source files that are out of date
| updating environment: 0 added, 0 changed, 0 removed
| looking for now-outdated files... none found
| no targets are out of date.
| build succeeded, 1 warning.
| 
| The HTML pages are in build/docs.
+--------------------------------------------------------------------------------
[I 200827 01:22:02 server:335] Serving on http://127.0.0.1:8000
[I 200827 01:22:02 handlers:62] Start watching changes
[I 200827 01:22:02 handlers:64] Start detecting changes
[I 200827 01:22:06 watcher:110] Running task: build (delay: None)
+------------------------ pre-build for changes detected ------------------------
| 10
+------------------------------- changes detected -------------------------------
| Running Sphinx v3.2.1
WARNING: html_static_path entry '_static' does not exist
| loading pickled environment... done
| building [mo]: targets for 0 po files that are out of date
| building [html]: targets for 1 source files that are out of date
| updating environment: 0 added, 1 changed, 0 removed
| reading sources... [100%] index
| 
| looking for now-outdated files... none found
| pickling environment... done
| checking consistency... done
| preparing documents... done
| writing output... [100%] index
| 
| generating indices...  genindexdone
| writing additional pages...  searchdone
| copying static files... ... done
| copying extra files... done
| dumping search index in English (code: en)... done
| dumping object inventory... done
| build succeeded, 1 warning.
| 
| The HTML pages are in build/docs.
+--------------------------------------------------------------------------------
[I 200827 01:22:10 watcher:110] Running task: build (delay: None)
+------------------------ pre-build for changes detected ------------------------
| 10
+------------------------------- changes detected -------------------------------
| Running Sphinx v3.2.1
WARNING: html_static_path entry '_static' does not exist
| loading pickled environment... done
| building [mo]: targets for 0 po files that are out of date
| building [html]: targets for 1 source files that are out of date
| updating environment: 0 added, 1 changed, 0 removed
| reading sources... [100%] index
| 
| looking for now-outdated files... none found
| pickling environment... done
| checking consistency... done
| preparing documents... done
| writing output... [100%] index
| 
| generating indices...  genindexdone
| writing additional pages...  searchdone
| copying static files... ... done
| copying extra files... done
| dumping search index in English (code: en)... done
| dumping object inventory... done
| build succeeded, 1 warning.
| 
| The HTML pages are in build/docs.
+--------------------------------------------------------------------------------
[I 200827 01:22:20 watcher:110] Running task: build (delay: None)
+------------------------ pre-build for changes detected ------------------------
| 10
+------------------------------- changes detected -------------------------------
| Running Sphinx v3.2.1
WARNING: html_static_path entry '_static' does not exist
| loading pickled environment... done
| building [mo]: targets for 0 po files that are out of date
| building [html]: targets for 1 source files that are out of date
| updating environment: 0 added, 1 changed, 0 removed
| reading sources... [100%] index
| 
| looking for now-outdated files... none found
| pickling environment... done
| checking consistency... done
| preparing documents... done
| writing output... [100%] index
| 
| generating indices...  genindexdone
| writing additional pages...  searchdone
| copying static files... ... done
| copying extra files... done
| dumping search index in English (code: en)... done
| dumping object inventory... done
| build succeeded, 1 warning.
| 
| The HTML pages are in build/docs.
+--------------------------------------------------------------------------------
^C[I 200827 01:23:13 server:358] Shutting down...