diff --git a/README.md b/README.md index 77ad8b7..63a4322 100644 --- a/README.md +++ b/README.md @@ -1,95 +1,27 @@

- +

# CMBA Constitution and Bylaws The Constitution and Bylaws for the baseball league known as the [Chicago Metropolitan Baseball Association (CMBA)](#about-the-cmba). -The compiled, published text can be found in the following formats: -- [PDF](build/cmba-bylaws.pdf) -- [HTML](build/cmba-bylaws.html) -- [ePUB](build/cmba-bylaws.epub) - The source text for this document can be found in Markdown format in [src/cmba-bylaws.md](src/cmba-bylaws.md). ## Building from source ### Requirements -Building from source requires: -- [Pandoc](https://pandoc.org) -- [GNU Make](https://www.gnu.org/software/make/) - ### Steps -1. Download the latest release or clone the repo: -``` -git clone https://github.com/anthonyscorrea/cmba-bylaws.git -``` -2. Navigate to the root directory: -``` -cd cmba-bylaws-master -``` -3. Publish into desired format: -``` -make {format} -``` -were `{format}` is one of the below: - - All [default]: `make all` or `make` - - PDF: `make pdf` - - html: `make html` - - epub: `make epub` -5. Built files will be in the `build/` directory - -## Markdown formatting - -- `#` or `h1` is used for either "Constitution" or "Bylaws". They are not numbered, necessitating an `{.unnumbered}` class. - - Note: to get the numbering to match existing convention, a [Lua filter](https://github.com/jgm/pandoc/issues/5071#issuecomment-856918980) was required, see [jgm/pandoc#5701](https://github.com/jgm/pandoc/issues/5071) -- `##` or `h2` is used for sections -- `###` or `h3` is used for subsections - -## Metadata - -Metadata is stored in the `metadata.yml` file. ## Project history The constitution and bylaws were modernized in 2021, using Google Docs. This project brings that effort into Git and Github. Previous commits show a generated plain-text history of the changes prior to this project (thanks to [gitdriver](https://github.com/larsks/gitdriver)), with the first being the version from 2016. ## Spell-checking -Spell-checking is performed on the pre-commit via [.spell-check/git-spell-check](.spell-check/git-spell-check) (courtesy of [mprpic/git-spell-check](https://github.com/mprpic/git-spell-check)) - -You can manually run spell-checking of all markdown files by running the script (requires [aspell](http://aspell.net)): - -```console -./.spell-check/spell-check -``` - -Should you want to bypass the pre-commit hook (though not recommended), you can commit with -```console -git commit --no-verify". -``` ## GitHub Pages -The html output can be hosted on GitHub Pages. Currently the site is hosted at the branch [gh-pages](https://github.com/anthonyscorrea/cmba-bylaws/tree/gh-pages). To update this page, you should: - -1. First build from the main branch and build html -```console -git clone https://github.com/anthonyscorrea/cmba-bylaws.git -make html -``` -2. Then clone the gh-pages branch and replace `index.html` with the updated page. -```console -git clone https://github.com/anthonyscorrea/cmba-bylaws.git --branch gh-pages cmba-bylaws-gh-pages -cp ../cmba-bylaws/build/cmba-bylaws.html ./cmba-bylaws-gh-pages/index.html -git push origin -``` - -## To-Do -- [X] Spell Checking -- [ ] Remove dependence on make, verify Windows support - ## About the CMBA This baseball league known as the [Chicago Metropolitan Baseball Association (CMBA)](http://cmbabaseball.com) has been formed for the purpose of providing the finest amateur baseball league in the State of Illinois and Midwest; a league where an up and coming young prospect for professional baseball may play and develop; where the talented veteran player can enjoy playing among the best competition; and bring friendship and sportsmanship to the Association. diff --git a/assets/cmba-favicon.png b/assets/cmba-favicon.png new file mode 100644 index 0000000..c2455d2 Binary files /dev/null and b/assets/cmba-favicon.png differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..586f560 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,3 @@ +# CMBA Rulebooks + +Use the navigation to view the documents. diff --git a/mkdocs/mkdocs.yml b/mkdocs/mkdocs.yml new file mode 100644 index 0000000..4bc51d0 --- /dev/null +++ b/mkdocs/mkdocs.yml @@ -0,0 +1,37 @@ +site_name: CMBA Rulebook +docs_dir: ../docs + +# Prevent accidental publishing of repo/CI/dev clutter +theme: + name: material + palette: + scheme: default + primary: blue + accent: red + features: + - navigation.instant + - navigation.tracking + - navigation.top + - toc.integrate + - search.highlight + - search.suggest +extra_css: + - mkdocs/styles/extra.css +markdown_extensions: + - toc: + permalink: true + - admonition: + # - tables +nav: + - Home: index.md + - 01-constitution.md + - 02-bylaws.md + - 03-playing-rules.md + +plugins: + - search + - offline + - enumerate-headings: + toc_depth: 2 + exclude: + - index.md \ No newline at end of file diff --git a/mkdocs/requirements.txt b/mkdocs/requirements.txt new file mode 100644 index 0000000..bd08198 --- /dev/null +++ b/mkdocs/requirements.txt @@ -0,0 +1,2 @@ +mkdocs-enumerate-headings-plugin==0.6 +mkdocs-material==9.7 \ No newline at end of file diff --git a/mkdocs/styles/extra.css b/mkdocs/styles/extra.css new file mode 100644 index 0000000..4c08ea0 --- /dev/null +++ b/mkdocs/styles/extra.css @@ -0,0 +1,10 @@ +@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&display=swap'); + +:root { + --md-text-font: "Merriweather" +} + +.md-nav__title { + font-family: "Nunito Sans"; +} \ No newline at end of file diff --git a/tools/build.sh b/tools/build.sh new file mode 100755 index 0000000..b6b7917 --- /dev/null +++ b/tools/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -euo pipefail + +MKDOCS_STRICT="${MKDOCS_STRICT:-true}" +TMPDIR="${RUNNER_TEMP:-$TMPDIR}" +OUTPUT_DIR="${OUTPUT_DIR:-${TMPDIR}/dist/}" +# OFFLINE="${OFFLINE:-false}" # This doesn't seem to do anything, set by mkdocs.yml +MKDOCS_CONFIG="${MKDOCS_CONFIG:-mkdocs/mkdocs.yml}" + +STRICT_FLAG="" +if [ "${MKDOCS_STRICT}" = "true" ]; then + STRICT_FLAG="--strict" +fi + +mkdocs build ${STRICT_FLAG} -f $MKDOCS_CONFIG -d $OUTPUT_DIR \ No newline at end of file diff --git a/tools/shift-numbering.lua b/tools/shift-numbering.lua deleted file mode 100644 index 5007535..0000000 --- a/tools/shift-numbering.lua +++ /dev/null @@ -1,20 +0,0 @@ --- Based on https://github.com/jgm/pandoc/issues/5071#issuecomment-856918980 --- For LaTeX documents, shift all headings down by one. --- Make Level 1 unnumbered, or remove it if it contains the "hidden" class. (`# Title {.hidden}`) -function Header(el) - if el.level == 1 then - --check for hidden class. (Why didn't pandoc make this a set? `{class_name = true}`) - for i, v in ipairs(el.classes) do - if v == "hidden" then - --The empty list means remove the element - return {} - end - end - -- this may mean that there are two unnumbered classes, but that doesn't matter. - el.classes[#el.classes + 1] = "unnumbered" - else - -- all headings > 1 are shifted down so that you don't end up with 0.x.y headings. - el.level = el.level - 1 - end - return el -end \ No newline at end of file