gradientgrove
Local Python scripts for reusable Markdown, LaTeX, and publishing workflows.
Command-line help
Both scripts use argparse, so pass -h or --help to see the current usage and options:
gradientgrove-publish --help
gradientgrove-latex-to-markdown --help
After installation, setuptools exposes the console scripts shown above. When running from a source checkout instead of an installed package, use the equivalent module form and prefix commands with PYTHONPATH=src:
PYTHONPATH=src python -m gradientgrove.publish --help
PYTHONPATH=src python -m gradientgrove.markdown_ast --help
Markdown Syntax
- Standard Mkdocs/python-markdown syntax
- Several additional fences, with behavior dependent on output format
- Contents of
framebecome slides in revealjs/beamer output. Contents ofpauseare revealed when advancing. - A page break is inserted before and after the contents of
page - A
newpageenvironment with no contents inserts a pagebreak.
- Contents of
- You cannot put (sub)*section divisions inside a
frame
| environment | article (html/pdf) | slides (revealjs/beamer) |
|---|---|---|
frame, pause |
ignored | yes |
newpage, page, vspace, vfill |
yes | ignored |
exercise, answer |
yes | yes |
theorem, definition |
yes | yes |
---
title : "My Document"
author: "Firstname Lastname"
---
# Background
!!! note
Standard MkDocs/Python Markdown admonitions work
??? info
Collapsable admonitions work too
# Slideshows
!!! frame "Frame Title"
Frame contents go here
!!! pause
Displayed when advanced
!!! exercise
You can put exercises between frames
??? answer
And you can put answers too.
Answers are **excluded** from handout mode
!!! frame
You can put the next frame here
!!! page
!!! exercise
You can also make a worksheet with spaces
!!! vfill
!!! exercise
Another exercise
!!! vfill
# Mathematics environments
!!! definition
Definitions work
!!! theorem
Theorems too
Currently supported environments are hardcoded into the template, particularly for latex output.
Eventually there should be a more dynamic solution.
Publishing Markdown documents
gradientgrove.markdown_publish converts Markdown files into HTML, Reveal.js slides, LaTeX articles, LaTeX handouts, and Beamer slides.
Basic usage:
gradientgrove-publish [path] [options]
The optional path can be:
- omitted: treat the current directory as a MkDocs project, merge Markdown pages from
mkdocs.ymlnavigation, write all generated outputs in.publish_cache, and package them into one.publish_cache/mkdocs.zipfile; - a Markdown file: convert that single file, write all generated outputs in
.publish_cachebeside it, and package them into one ZIP file there; - a directory: recursively convert every
*.mdfile below that directory, write all generated outputs in that directory's.publish_cache, and package them into one ZIP file there.
If no output option is supplied, the script generates the base HTML document by default.
Available output options:
-
HTML output
--baseNumbered base HTML document.--handoutNumbered HTML handout withanswerenvironments omitted.--revealjsNumbered Reveal.js slide deck.--htmlAll HTML outputs: base, handout, and Reveal.js.
-
LaTeX and PDF have similar options to output latex source and to compile it using with
lualatex:--tex,--tex_handout,--beamer. -
--allgenerates all output formats, including HTML, LaTeX article, LaTeX handout, and Beamer outputs. -
--version VERSION,-v VERSIONAdd the version string to generated output filenames and ZIP names. -
--no-mkdocs-page-zipIn no-argument MkDocs mode, only include the merged MkDocs output in.publish_cache/mkdocs.zip. -
-h,--helpShow command help and exit.
Examples:
# Merge a MkDocs project from the current directory, generate every output format,
# and package generated HTML, TeX, and PDF files in .publish_cache/mkdocs.zip.
gradientgrove-publish --all
# Build and package only the merged MkDocs output.
gradientgrove-publish --no-mkdocs-page-zip
# Generate the default base HTML for a single Markdown file in .publish_cache.
gradientgrove-publish examples/testfile.md
# Generate all HTML variants for one file.
gradientgrove-publish examples/testfile.md --html
# Generate a versioned Beamer deck and TeX handout.
gradientgrove-publish examples/testfile.md --beamer --tex_handout --version week1
Generated HTML, TeX, and PDF outputs are written in .publish_cache and packaged together into one ZIP file. LaTeX outputs require lualatex on PATH if you want the compilation step to produce PDFs.
Converting LaTeX to Markdown
gradientgrove-latex-to-markdown converts a LaTeX file to Markdown using the package's LaTeX parser.
Basic usage:
gradientgrove-latex-to-markdown input.tex [output.md]
If output.md is omitted, the command writes beside the input file with a .md suffix. By default, Beamer \mode<...>{...} blocks are normalized before parsing; pass --no-dump-modes to skip that preprocessing step.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gradientgrove-0.1.5.tar.gz.
File metadata
- Download URL: gradientgrove-0.1.5.tar.gz
- Upload date:
- Size: 45.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d57005141605abce805b08c3e671bc64a2c7746110d2425680fe1e0d04ee61a9
|
|
| MD5 |
3e8abd2582dd1a324b29edc998ca0bd6
|
|
| BLAKE2b-256 |
92fc02ec29eb340ccc961d6bc6455b30ca6f22ea38fd476d698797111246a5d2
|
Provenance
The following attestation bundles were made for gradientgrove-0.1.5.tar.gz:
Publisher:
publish-to-pypi.yml on stephen-flood/gradientgrove
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gradientgrove-0.1.5.tar.gz -
Subject digest:
d57005141605abce805b08c3e671bc64a2c7746110d2425680fe1e0d04ee61a9 - Sigstore transparency entry: 2422952151
- Sigstore integration time:
-
Permalink:
stephen-flood/gradientgrove@ddbaaeeb4a4e9dc3c8e16f059001d7bb90715850 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stephen-flood
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@ddbaaeeb4a4e9dc3c8e16f059001d7bb90715850 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file gradientgrove-0.1.5-py3-none-any.whl.
File metadata
- Download URL: gradientgrove-0.1.5-py3-none-any.whl
- Upload date:
- Size: 46.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3f841b12fea409787e5bace3647210fcf8e76ec8bde4a3b3bbd4294d3bbfde5
|
|
| MD5 |
be3958889b692cd046c628d7e681d525
|
|
| BLAKE2b-256 |
ffba3021fbf73d28d22eaa331bbc72c05d56423a879256c6e4e9fc6c52eb7057
|
Provenance
The following attestation bundles were made for gradientgrove-0.1.5-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on stephen-flood/gradientgrove
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gradientgrove-0.1.5-py3-none-any.whl -
Subject digest:
c3f841b12fea409787e5bace3647210fcf8e76ec8bde4a3b3bbd4294d3bbfde5 - Sigstore transparency entry: 2422952272
- Sigstore integration time:
-
Permalink:
stephen-flood/gradientgrove@ddbaaeeb4a4e9dc3c8e16f059001d7bb90715850 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stephen-flood
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@ddbaaeeb4a4e9dc3c8e16f059001d7bb90715850 -
Trigger Event:
workflow_dispatch
-
Statement type: