From d7d6d1d5724e78dc008336e21a808bd75ebc9e07 Mon Sep 17 00:00:00 2001 From: Dakota Blair Date: Sat, 26 Sep 2020 21:40:33 -0400 Subject: [PATCH] Added README and fixed publish script. The publish script used platform specific options, and this commit removes them. This commit introduces a README with installation instructions. --- README.md | 35 +++++++++++++++++++++++++++++++++++ publish.py | 8 ++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..0afcb9b --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# Dakota's tilde.club + +This is the repository for building Dakota's tilde.club page. As of now, the +only build artifact is `index.html`. + +## Dependencies + +- `python3` + - Python packages listed in `requirements.txt` + +### Optional Dependencies + +- [tidy](https://github.com/htacg/tidy-html5/blob/next/README/BUILD.md) + +## Installation + +1. Clone the repository and `cd` into the cloned directory. +2. Make a virtualenv (optional, but highly suggested) and activate it: + +```bash +python -m venv .venv +source .venv/bin/activate +``` + +3. Install the `python` package dependencies using `pip`: + +```bash +python -m pip install -r requirements.txt +``` + +4. Run the publish script: + +```bash +./publish.py +``` diff --git a/publish.py b/publish.py index f96b14d..b1d1875 100755 --- a/publish.py +++ b/publish.py @@ -1,13 +1,17 @@ #!/usr/bin/env python import io -from subprocess import run +from subprocess import run, DEVNULL import markdown from jinja2 import Template def main(): - tidy_exists = run(["which", "-s", "tidy"]).returncode == 0 + tidy_exists = run( + ["which", "tidy"], + stdout=DEVNULL, + stderr=DEVNULL + ).returncode == 0 with open("readings.md") as readings, open("index.tmpl.html") as tmpl: readings_html = markdown.markdown(readings.read()) template = Template(tmpl.read())