Open mosra opened 5 years ago
I decided to try abusing this project to get this done for a README again, and here's what I found:
Some details from my setup:
conf.py
:
PROJECT_TITLE = "zpy"
PROJECT_SUBTITLE = "Zsh helpers for Python venvs, with pip-tools"
MAIN_PROJECT_URL = 'https://github.com/andydecleyre/zpy'
OUTPUT = '../../docs'
INPUT_PAGES = ['../../build/index.rst']
LINKS_NAVBAR1 = [
("Light", 'https://zpy.rtfd.io', []),
("Source", 'https://github.com/andydecleyre/zpy', []),
("Issues", 'https://github.com/andydecleyre/zpy/issues', []),
("pip-tools", 'https://github.com/jazzband/pip-tools', []),
]
SEARCH_DISABLED = True
FAVICON = '../favicon-32x32.png'
build script:
#!/bin/sh -e
gitroot="$(git -C "$(dirname "$0")" rev-parse --show-toplevel)"
[ $VIRTUAL_ENV ] \
|| printf '%s\n' \
'You may want to activate a venv first in order to install and use the build tools.' \
'Trying anyway . . .'
pip install -qr "${gitroot}/doc/m.css/requirements.txt"
git -C "${gitroot}" submodule update --init --recursive
"${gitroot}/mk/doc/readme.sh"
cp "${gitroot}/README.rst" "${gitroot}/build/index.rst"
rm -rf "${gitroot}/docs"
"${gitroot}/doc/m.css/m.css/documentation/python.py" "${gitroot}/doc/m.css/conf.py"
rm \
"${gitroot}/build/index.rst" \
"${gitroot}/docs/classes.html" \
"${gitroot}/docs/modules.html" \
"${gitroot}/docs/pages.html"
The results ~are currently rendered @ https://andydecleyre.github.io/zpy/ and~ should be reliably available at this commit
Suggested by /u/AndydeCleyre on Reddit, besides that I bet I'm far from being the only one who sometimes needs to render a quick'n'dirty reST page into HTML and put it somewhere:
and right now, there's no easy way to achieve this with m.css -- one has to either install Pelican and set up the whole site, or abuse the Python doc generator (which doesn't need Pelican on its own, but still requires you to have a config file). Ideally it would be as simple as
picking up a header/footer-less full-page template, bundling the CSS inside that page and producing a self-contained page. Goal of this is providing just a single-page rendering, for multiple pages, crosslinking, tagging, categories, ... please just use Pelican or the Python doc generator. Further possibilities:
--theme dark
,--theme light
, or specifying a path to a (self-contained) CSS--theme my-theme.css
)--external-css
?)rst2mcss.conf.py
next toin.rst
?-c "M_HTMLSANITY_HYPHENATION=True;M_HTMLSANITY_SMART_QUOTES=True"
?-c minimal
,-c full
, ...)?