A technical manual and reference implementation slice for structured, machine-readable knowledge systems.
This repository has two related layers:
- A technical manual describing the target Open Knowledge Systems architecture.
- A narrow reference implementation for schema-aware Markdown ETL.
The implementation is intentionally narrower than the target platform described in the book. The runnable code currently covers content parsing, front matter extraction, heading-based chunking, normalized JSON output, and a graph-friendly projection for Neo4j-oriented workflows.
The project uses:
- Markdown for content
- Python for data processing
- Neo4j for knowledge graphs
- MkDocs for publishing
- Jupyter Notebooks for demonstrations
The manual and code together focus on:
- Create schema-driven modular content
- Store and retrieve content programmatically
- Model knowledge in Neo4j
- Validate your system's consistency
- Publish as HTML, EPUB, and PDF
.
├── content/ # Manuscript chapters in Markdown
├── content/notebooks/ # Notebook pages published with MkDocs
├── books/ # Generated EPUB and PDF artifacts
├── graphs/ # Neo4j schema and example Cypher
├── scripts/ # Build automation
├── src/oks/ # Reference implementation package
├── tests/ # Unit and content sanity tests
├── mkdocs.yml # Site configuration
├── pyproject.toml # Package metadata and test config
├── requirements.txt # Docs/build dependencies
├── LICENSE # MIT License
└── README.md # Project overview
git clone https://github.com/finalstatepress/open-knowledge-systems.git
cd open-knowledge-systemspython3 -m venv ENV
source ENV/bin/activateENV/bin/python -m pip install -r requirements.txt
ENV/bin/python -m pip install -e .ENV/bin/python -m mkdocs serveOpen http://127.0.0.1:8000 to review the manuscript locally.
ENV/bin/python -m mkdocs build --strictOutput: /site/
ENV/bin/python -m pytestNormalize the Markdown corpus into chunk records:
ENV/bin/python -m oks.etl content --output build/chunks.jsonGenerate both chunk and graph-oriented projections:
ENV/bin/python -m oks.etl content \
--output build/chunks.json \
--graph-output build/graph.jsonscripts/build.shOutputs:
/site/for the HTML site/books/open-knowledge-systems.epubfor the ebook/books/open-knowledge-systems.pdffor the PDF built from the Markdown chapters with Pandoc
Use pandoc to convert the Markdown source into EPUB.
macOS:
brew install pandocUbuntu:
sudo apt install pandocpandoc content/*.md -o books/open-knowledge-systems.epub --metadata title="Open Knowledge Systems"To include additional metadata:
pandoc content/*.md -o books/open-knowledge-systems.epub \
--metadata title="Open Knowledge Systems" \
--metadata author="Final State Press" \
--epub-cover-image=assets/cover.pngPDF output depends on your system's LaTeX or HTML rendering setup. Two options:
pandoc content/*.md -o books/open-knowledge-systems.pdf \
--metadata title="Open Knowledge Systems" \
--metadata author="Final State Press" \
--toc --pdf-engine=xelatexIf LaTeX is not installed:
macOS:
brew install --cask mactex-no-guiUbuntu:
sudo apt install texlive texlive-xetex texlive-fonts-recommendedENV/bin/python -m pip install weasyprint
# macOS native libraries
brew install glib pango libffi
# build the HTML site first, then convert it
ENV/bin/python -m mkdocs build --strict
scripts/weasyprint.sh site/index.html books/open-knowledge-systems.pdfscripts/weasyprint.sh configures Homebrew library lookup on macOS and a writable font cache directory.
- Add new chapters in
content/NN_topic.mdand updatemkdocs.ymlnavigation. - Use
scripts/build.shfor repeatable builds. - Treat
/books/as generated release output; keep onlybooks/.gitkeepunder version control. - Keep prose claims aligned with the implementation boundary.
- Run
black,flake8, orpytestbefore releasing. - Use GitHub Issues and PRs for contributions.
Recommended flow:
- Activate the environment and run
scripts/build.sh. - Confirm the release artifacts exist at
books/open-knowledge-systems.epubandbooks/open-knowledge-systems.pdf. - Run
ENV/bin/python -m pytestif you have not already done so in this release cycle. - Commit and push the source changes you want in the release.
- Create and push a tag, for example:
git tag -a v0.1.0 -m "Open Knowledge Systems v0.1.0"
git push origin v0.1.0- In GitHub, open
Releasesfor the repository and create a new release from that tag. - Upload
books/open-knowledge-systems.epubandbooks/open-knowledge-systems.pdfas release assets.
If you use the GitHub CLI, you can create the release from the terminal after building:
gh release create v0.1.0 \
books/open-knowledge-systems.epub \
books/open-knowledge-systems.pdf \
--title "Open Knowledge Systems v0.1.0" \
--notes "Release notes go here."We welcome issues, suggestions, and pull requests!
- Fork the repo
- Create a branch
- Make your changes and run the relevant checks
- Open a PR
Please follow semantic commit messages and write tests for new functionality.
This project is licensed under the MIT License. See LICENSE for full terms.
© 2026 Final State Press.