- Connects to https://miller.readthedocs.io so people can get their docmods onto the web instead of the self-hosted https://johnkerl.org/miller/doc. Thanks to @pabloab for the great advice!
- More standard look and feel -- lots of people use readthedocs for other things so this should feel familiar.
- We get a Search feature for free.
- Mkdocs vs Sphinx: these are similar tools, but I find that I more easily get better desktop+mobile formatting using Mkdocs.
- You need
pip install mkdocs
(orpip3 install mkdocs
) as well aspip install mkdocs-material
. - The docs include lots of live code examples which will be invoked using
mlr
which must be somewhere in your$PATH
. - Clone https://github.com/johnkerl/miller and cd into
docs/
within your clone. - Overview of flow:
docs/src
has*.md.in
files containing markdown as well as directives for auto-generating code samples.- A
genmds
script readsdocs/src/*.md.in
and writesdocs/src/*.md
. - The
mkdocs build
tools readsdocs/src/*.md
and writes HTML files indocs/site
. - Running
make
within thedocs
directory handles both of those steps. - TL;DR just
make docs
from the Miller base directory
- Quick-editing loop:
- In one terminal, cd to the
docs
directory and leavemkdocs serve
running. - In another terminal, cd to the
docs/src
subdirectory and edit*.md.in
. - Run
genmds
to re-create all the*.md
files, orgenmds foo.md.in
to just re-create thefoo.md.in
file you just edited, or (simplest) justmake
within thedocs/src
subdirectory. - In your browser, visit http://127.0.0.1:8000
- This doesn't write HTML in
docs/site
; HTML is served up directly in the browser -- this is nice for previewing interactive edits.
- In one terminal, cd to the
- For-publish editing loop:
- cd to the
src
subdirectory ofdocs
and edit*.md.in
. make -C ..
- This does write HTML in
docs/site
. - In your browser, visit
file:///your/path/to/miller/docs/site/index.html
- Link-checking:
sudo pip3 install git+https://github.com/linkchecker/linkchecker.git
cd site
andlinkchecker .
- cd to the
- Submitting:
- Do the for-publish editing steps -- in particular,
docs/src/*.md.in
anddocs/src/*.md
are both checked in to source control.- TL;DR edit
docs/src/foo.md.in
and runmake docs
- If you don't want to do
pip install mkdocs
then feel free to put up a PR which edits afoo.md.in
as well as itsfoo.md
.
- TL;DR edit
git add
your modified files (*.md.in
as well as*.md),
git commit,
git push`, and submit a PR at https://github.com/johnkerl/miller.
- Do the for-publish editing steps -- in particular,
- Miller documents use the Oxford comma: not red, yellow and green, but rather red, yellow, and green.
- CSS:
- I used the Mkdocs "material" theme which I like a lot. I customized
docs/src/extra.css
for Miller coloring/branding.
- I used the Mkdocs "material" theme which I like a lot. I customized
- Live code:
- I didn't find a way to include non-Python live-code examples within Mkdocs so I adapted the pre-Mkdocs Miller-doc strategy which is to have a generator script read a template file (here,
foo.md.in
), run the marked lines, and generate the output file (foo.md
). This isgenmds
. - Edit the
*.md.in
files, not*.md
directly. - Within the
*.md.in
files are lines likeGENMD_RUN_COMMAND
. These will be run, and their output included, bygenmds
which calls thegenmds
script for you.
- I didn't find a way to include non-Python live-code examples within Mkdocs so I adapted the pre-Mkdocs Miller-doc strategy which is to have a generator script read a template file (here,
- readthedocs:
- Published to https://miller.readthedocs.io/en/latest on each commit to
main
in this repo - https://readthedocs.org/projects/miller/
- https://readthedocs.org/api/v2/webhook/miller/134065/
- https://readthedocs.org/projects/miller/builds/
- https://readthedocs.org/