-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a single-page reST->HTML generator #113
Labels
laterz
Will get resolved eventually, but not now.
Projects
Comments
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:
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
, ...)?The text was updated successfully, but these errors were encountered: