This project documents RCTab, an open source application for tabulating ranked choice voting elections.
This project uses Material for MkDocs to manage and build RCTab's documentation.
Before you can run and use MkDoc's features in this project, you need to have the following software installed:
- Python (version 3.11 or higher)
- Poetry (version 1.8 or higher)
vim
andvimdiff
(required to run an optional script)
You can download and install Python from the official Python website.
To install Poetry, you can follow the instructions from the official Poetry documentation.
To clone the repo:
git clone https://github.com/BrightSpots/rctab-docs.git
First, navigate to the directory where the repository has been cloned (e.g. cd ./rctab-docs
).
Then, run these commands:
poetry install # installs the dependencies
cp .githooks/* .git/hooks/ # installs the git hooks
Poetry automatically creates a virtual environment for your project.
To preview and serve MkDocs locally:
poetry run mkdocs serve
To build MkDocs as a static site:
poetry run mkdocs build
Run:
./scripts/compare_parts.sh
Action | vimdiff command |
---|---|
Switch between files being compared | ctrl +w +w while in vim's INSERT mode |
Wrap lines in a window pane | setlocal wrap linebreak while in vim's COMMAND mode |
Copy a the selected window pane's file to the MacOS clipboard | w !pbcopy while in vim's COMMNAND mode |
Run:
./scripts/insert_lines.sh
Recommend testing this out on some small test files to understand how it works before running it on larger files. Alternatively, you can use a version management tool like git
.