https://github.com/withprecedent/cento
Combines markdown files into publications and related materials
https://github.com/withprecedent/cento
Last synced: 21 days ago
JSON representation
Combines markdown files into publications and related materials
- Host: GitHub
- URL: https://github.com/withprecedent/cento
- Owner: WithPrecedent
- License: other
- Created: 2024-04-09T03:51:46.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-13T23:03:05.000Z (over 1 year ago)
- Last Synced: 2025-01-16T01:16:48.581Z (over 1 year ago)
- Language: Python
- Size: 1.27 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# cento
| | |
| --- | --- |
| Version | [](https://pypi.org/project/cento/) [](https://github.com/WithPrecedent/cento/releases)
| Status | [](https://github.com/WithPrecedent/cento/actions/workflows/ci.yml?query=branch%3Amain) [](https://www.repostatus.org/#active) [](https://pypi.org/project/cento/)
| Documentation | [](https://WithPrecedent.github.io/cento)
| Tools | [](https://squidfunk.github.io/mkdocs-material/) [](https://github.com/astral-sh/Ruff) [](https://PDM.fming.dev) [](https://github.com/TezRomacH/python-package-template/blob/master/.pre-commit-config.yaml) [](https://github.com/features/actions) [](https://editorconfig.org/) [](https://www.github.com/WithPrecedent/cento) [](https://github.com/dependabot)
| Compatibility | [](https://pypi.python.org/pypi/cento/) [](https://www.linux.org/) [](https://www.apple.com/macos/) [](https://www.microsoft.com/en-us/windows?r=1)
| Stats | [](https://pypi.org/project/cento) [](https://github.com/WithPrecedent/cento/stargazers) [](https://github.com/WithPrecedent/cento/graphs/contributors) [](https://github.com/WithPrecedent/cento/graphs/contributors) [](https://github.com/WithPrecedent/cento/forks)
| | |
-----
## What is cento?
*CENTO: "A composition formed by joining scrapes from other authours."* - [Samuel
Johnson's Dictionary of the English Language](https://johnsonsdictionaryonline.com/views/search.php?term=cento)
## Why use cento?
`cento` allows a user to create a text, accompanying slides, and notes from a
simple configuration file and markdown documents.
## Getting started
### Requirements
To use `cento`, you need:
* A markdown editor (any text editor may suffice)
* Python 3.10 or later
### Installation
To install `cento`, use `pip`:
```sh
pip install cento
```
### Usage
First, you create a simple configuration file named "project" with a file
extension matching one of the supported file configuration types. This should be
stored in the same folder as your markdown files that will form the produced
texts. Metadata goes in the first section titled "Project." The "Outline"
section contains the substructure of the intended documents (text, slides,
and/or notes).
```ini
[Project]
Name: Crazy Idea
Style: book
Include: text, slides
Slides Template: chalkboard
Output Folder: output
[Outline]
I: Introduction
II: Literature Review
III: My Cool Idea
A: Interesting Premise 1
1: Underlying Facts
2: Supporting Work
B: Interesting Premise 2
IV: Conclusion
```
The names of the files should correspond to the names of subsections in the
Outline with spaces replaced with underscores. If the operating system you use
has case-sensitive file names, all files should be named with lower case
letters (and an extension of ".md"). The above configuration file is from the
`cento` tests folder. So, you can see how the markdown files are named inside
the tests folder in the "test_project_book" subfolder.
Second, write the content of your markdown files. The files may contain YAML
front-matter for specific instructions and settings related to that file. All
generally applicable instructions and settings should be in the project
configuration file.
By default, the sections of your markdown file should be named within "<" and
">":
| divider | usage |
| --- | --- |
| \ | Contents of the book or article |
| \ | Contents of slides accompanying the book or article |
| \ | Contents of notes or accompanying guidebook |
You do not have to have all of the section types. Any unmarked section will be
assumed to be part of the book or article text.
Any visualizations, images, charts, or graphs should be stored in a subfolder
titled "visuals" by default.
Third, you run `cento` from the command line. If you are in the folder where
your configuration and markdown files are located, executing `cento` is simple:
```sh
python cento
```
If you are in a different folder, you just need to list that after `cento` as
follows:
```sh
python cento {folder path}
```
## Contributing
Contributors are always welcome. Feel free to grab an
[issue](https://www.github.com/WithPrecedent/cento/issues) to work on or make a
suggested improvement. If you wish to contribute, please read the [Contribution
Guide](https://www.github.com/WithPrecedent/cento/contributing.md) and [Code of
Conduct](https://www.github.com/WithPrecedent/cento/code_of_conduct.md).
## Similar Projects
* [quarto](https://quarto.org/): an R based project for dynamically creating
academic publications from markdown files.
## Acknowledgments
I would like to thank the University of Kansas School of Law for tolerating and
supporting this law professor's coding efforts, an endeavor which is well
outside the typical scholarly activities in the discipline.
## License
Use of this repository is authorized under the [Apache Software License
2.0](https://www.github.com/WithPrecedent/cento/blog/main/LICENSE).