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.
This commit is contained in:
Dakota Blair 2020-09-26 21:40:33 -04:00
parent a0d8ca002d
commit d7d6d1d572
2 changed files with 41 additions and 2 deletions

35
README.md Normal file
View File

@ -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
```

View File

@ -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())