Skip to content

Commit

Permalink
feat: switching to much simpler approach
Browse files Browse the repository at this point in the history
  • Loading branch information
gvwilson committed Aug 18, 2024
1 parent 65a4963 commit 3460906
Show file tree
Hide file tree
Showing 107 changed files with 977 additions and 7,792 deletions.
26 changes: 2 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
**/docs/*.aux
**/docs/*.bbl
**/docs/*.bcf
**/docs/*.bib
**/docs/*.blg
**/docs/*.cls
**/docs/*.idx
**/docs/*.ilg
**/docs/*.ind
**/docs/*.log
**/docs/*.out
**/docs/*.pdf
**/docs/*.run.xml
**/docs/*.tex
**/docs/*.toc
**/docs/*/*.pdf
**/src/*/*.pdf
*.bkp
*.dtmp
*.egg-info
*~
.DS_Store
.\#*
.coverage
.ipynb_checkpoints
.jekyll-cache
.metaflow
.pytest_cache
.ruff_cache
\#*
.venv
__pycache__
tmp
dist
15 changes: 0 additions & 15 deletions .vscode/launch.json

This file was deleted.

6 changes: 2 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,5 @@ members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][contributor_covenant]
version 1.4.

[contributor_covenant]: https://www.contributor-covenant.org/
This Code of Conduct is adapted from
the [Contributor Covenant](https://www.contributor-covenant.org/) version 1.4.
155 changes: 16 additions & 139 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,147 +1,24 @@
# Contributing

Contributions are very welcome.
Please file issues or submit pull requests in [our GitHub repository][repo].
All contributors will be acknowledged.
Please file issues or submit pull requests in our [GitHub repository][repo].
All contributors will be acknowledged,
but must abide by our [Code of Conduct](./CODE_OF_CONDUCT.md).

## Setup
## Site Structure

- Use `pip install -r requirements.txt`
to install the packages required by the helper tools and Python examples.
You may wish to create a new virtual environment before doing so.
All code has been tested with Python 3.12.1.
- `README.md`: overview
- `LICENSE.md`: content license
- `CODE_OF_CONDUCT.md`: code of conduct
- `CONTRIBUTING.md`: this contributors' guide
- `pyproject.toml`: Python package description
- `Makefile`: repeatable commands
- `mccole/`: Python source

- Run `make` without arguments to see available commands
Of these,
`make build` to rebuild everything in `./docs`
and `make serve` to run a local preview server
are the most immediately useful.
## Build and Release

| Command | Action |
| ------------ | ------ |
| `commands` | show available commands |
| `build` | rebuild site without running server |
| `serve` | build site and run server |
| `profile` | profile compilation |
| `bib` | rebuild HTML version of bibliography |
| `lint` | check project |
| `style` | check Python code style |
| `reformat` | reformat unstylish Python code |
| `pack` | create a release |
| `unpack` | make required files after unzipping mccole.zip |
| `clean` | clean up stray files |
- `pip install build twine`
- `python -m build`
- `twine upload --verbose -u __token__ -p pypi-your-access-token dist/*`

## Layout

- This template uses [Ark][ark] to compile Markdown with embedded shortcode directives
into a static HTML site under `docs/`.

- The McCole theme lives in `lib/mccole`:
- `bin/`: utility scripts
- `colophon.yml`: links used in the colophon
- `extensions/`: shortcodes and other extensions to Ark used by the theme
- `mccole.mk`: targets and commands common to all projects that use this theme
- `requirements.txt`: packages common to all projects that use this theme
- `resources/`: CSS files and other resources used by this theme
- `templates/`: HTML templates used by this theme (the main one being `node.ibis`).

- The site's configuration lives in `config.py`.
The lists `chapters` and `appendices` define slugs for the sections, in order.

- Content lives in `.md` files in subdirectories under `src`
Each section must be in its own subdirectory except for `src/index.md`,
which is the site's home page.

- Please write external links using `[box][notation]`
and define links in `info/tutorial.yml`
rather than putting links inline.
Doing this will help ensure consistency across pages.

- Use `[%x slug %]` to create a cross-reference to a chapter or appendix,
where the slug is the name of a subdirectory under `src`.

- Use `[%g key "text" %]` to link to glossary entries.
The text is inserted and highlighted;
the key must identify an entry in `info/glossary.yml`,
which is in [Glosario][glosario] format.

- Use `[%b key1 key2 %]` to cite bibliography entries.
The keys must appear in `info/bibliography.bib`,
which is stored in BibTeX format
and compiled to create `tmp/bibliography.html`.

- Use `[%figure slug="some_slug" img="some_file.ext" caption="the caption" alt="alt text" %]`
to create a figure and `[%f some_slug %]` to refer to it.

- Use `[%table slug="some_slug" tbl="some_file.tbl" caption="the caption" %]`
to create a table and `[%g some_slug %]` to refer to it.

- Use `[%inc filename %]` to include a text file containing code or sample output
in a Markdown file.
If the inclusion contains `mark=label`
then only code between comments marked `[label]` and `[/label]` will be included.

- SVG diagrams can be edited using [draw.io][draw_io].
Please use 14-point Helvetica for text,
solid 1-point black lines,
and unfilled objects.

## FAQ

What is this for?
: I wrote [a short SQL tutorial][sql] in 2024,
and am currently working on one about [systems programming][sys]
and another about [research software design][rsdx].
I was initially going to use the template I built for
the [JavaScript][sdxjs] and [Python][sdxpy] versions of *Software Design by Example*,
but realized I could slim it down,
speed it up,
and make it prettier.
Some people knit
some play video games,
I like to type…

Why Ark?
: [Jekyll][jekyll] is the default for [GitHub Pages][ghp],
but very few data scientists use Ruby
so previewing changes locally would require them to install and use
yet another language framework.
In addition,
GitHub Pages doesn't allow arbitrary extensions for security reasons,
so the only way to implement things like bibliography citations and glossary references
is to use its (rather verbose) inclusions and (rather clumsy) scripting features.

Why Make?
: It runs everywhere,
no other build tool is a clear successor,
and,
like Jekyll,
it's uncomfortable enough to use that people won't be tempted to fiddle with it
when they could be writing content.

Why hand-drawn figures rather than [Graphviz][graphviz] or [Mermaid][mermaid]?
: Because it's faster to Just Effing Draw than it is
to try to tweak layout parameters for text-to-diagram systems.
If you really want to make developers' lives better,
build a diff-and-merge tool for SVG:
programmers shouldn't have to use punchard-compatible data formats in the 21st Century
just to get the benefits of version control.

Why McCole?
: Because it was my father's middle name.
He was my high school English teacher for five years (it was a small town),
and I learned most of what I know about writing from him.

[ark]: https://www.dmulholl.com/docs/ark/main/
[draw_io]: https://www.drawio.com/
[ghp]: https://pages.github.com/
[glosario]: https://glosario.carpentries.org/
[graphviz]: https://graphviz.org/
[jekyll]: https://jekyllrb.com/
[mermaid]: https://mermaid.js.org/
[repo]: https://github.com/gvwilson/mccole/
[rsdx]: https://gvwilson.github.io/rsdx/
[sdxjs]: https://third-bit.com/sdxjs/
[sdxpy]: https://third-bit.com/sdxpy/
[sql]: https://gvwilson.github.io/sql-tutorial/
[sys]: https://gvwilson.github.io/sql-tutorial/
[repo]: https://github.com/gvwilson/mccole
147 changes: 22 additions & 125 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,125 +1,22 @@
# License

All of the written material is made available under the Creative
Commons - Attribution - NonCommercial 4.0 International license (CC-BY-NC-4.0),
while the software is made available under the Hippocratic License.

## Writing

*This is a human-readable summary of (and not a substitute for) the license.
For the full legal text of this license, please see
<https://creativecommons.org/licenses/by-nc/4.0/legalcode>.*

All of this site is made available under the terms of the Creative Commons
Attribution - NonCommercial 4.0 license. You are free to:

- **Share** — copy and redistribute the material in any medium or format

- **Adapt** — remix, transform, and build upon the material

- The licensor cannot revoke these freedoms as long as you follow the license
terms.

Under the following terms:

- **Attribution** — You must give appropriate credit, provide a link to the
license, and indicate if changes were made. You may do so in any reasonable
manner, but not in any way that suggests the licensor endorses you or your
use.

- **NonCommercial** — You may not use the material for commercial purposes.

- **No additional restrictions** — You may not apply legal terms or technological
measures that legally restrict others from doing anything the license
permits.

**Notices:**

You do not have to comply with the license for elements of the material in the
public domain or where your use is permitted by an applicable exception or
limitation.

No warranties are given. The license may not give you all of the permissions
necessary for your intended use. For example, other rights such as publicity,
privacy, or moral rights may limit how you use the material.

## Software

Licensor hereby grants permission by this license ("License"), free of charge,
to any person or entity (the "Licensee") obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and
to permit persons to whom the Software is furnished to do so, subject to the
following conditions:

- The above copyright notice and this License or a subsequent version published
on the [Hippocratic License Website][hippocratic_license] shall be
included in all copies or substantial portions of the Software. Licensee has
the option of following the terms and conditions either of the above
numbered version of this License or of any subsequent version published on
the Hippocratic License Website.

- Compliance with Human Rights Laws and Human Rights Principles:

1. Human Rights Laws. The Software shall not be used by any person or
entity for any systems, activities, or other uses that violate any
applicable laws, regulations, or rules that protect human, civil, labor,
privacy, political, environmental, security, economic, due process, or
similar rights (the "Human Rights Laws"). Where the Human Rights Laws of
more than one jurisdiction are applicable to the use of the Software,
the Human Rights Laws that are most protective of the individuals or
groups harmed shall apply.

2. Human Rights Principles. Licensee is advised to consult the articles of
the [United Nations Universal Declaration of Human Rights][udhr] and the
[United Nations Global Compact][ungc] that define recognized principles
of international human rights (the "Human Rights Principles"). It is
Licensor's express intent that all use of the Software be consistent
with Human Rights Principles. If Licensor receives notification or
otherwise learns of an alleged violation of any Human Rights Principles
relating to Licensee's use of the Software, Licensor may in its
discretion and without obligation (i) (a) notify Licensee of such
allegation and (b) allow Licensee 90 days from notification under (i)(a)
to investigate and respond to Licensor regarding the allegation and (ii)
(a) after the earlier of 90 days from notification under (i)(a), or
Licensee's response under (i)(b), notify Licensee of License termination
and (b) allow Licensee an additional 90 days from notification under
(ii)(a) to cease use of the Software.

3. Indemnity. Licensee shall hold harmless and indemnify Licensor against
all losses, damages, liabilities, deficiencies, claims, actions,
judgments, settlements, interest, awards, penalties, fines, costs, or
expenses of whatever kind, including Licensor's reasonable attorneys'
fees, arising out of or relating to Licensee's non-compliance with this
License or use of the Software in violation of Human Rights Laws or
Human Rights Principles.

- Enforceability: If any portion or provision of this License is determined to
be invalid, illegal, or unenforceable by a court of competent jurisdiction,
then such invalidity, illegality, or unenforceability shall not affect any
other term or provision of this License or invalidate or render
unenforceable such term or provision in any other jurisdiction. Upon a
determination that any term or provision is invalid, illegal, or
unenforceable, to the extent permitted by applicable law, the court may
modify this License to affect the original intent of the parties as closely
as possible. The section headings are for convenience only and are not
intended to affect the construction or interpretation of this License. Any
rule of construction to the effect that ambiguities are to be resolved
against the drafting party shall not apply in interpreting this
License. The language in this License shall be interpreted as to its fair
meaning and not strictly for or against any party.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*The Hippocratic License is an [Ethical Source license][ethical_source].*

[ethical_source]: https://ethicalsource.dev
[hippocratic_license]: https://firstdonoharm.dev/
[udhr]: https://www.un.org/en/universal-declaration-human-rights/
[ungc]: https://www.unglobalcompact.org/what-is-gc/mission/principles
# MIT License

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include mccole/templates/*.html
include mccole/static/*.css
include mccole/static/*.js
1 change: 0 additions & 1 deletion Makefile

This file was deleted.

Loading

0 comments on commit 3460906

Please sign in to comment.