Skip to main content

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 frame become slides in revealjs/beamer output. Contents of pause are revealed when advancing.
    • A page break is inserted before and after the contents of page
    • A newpage environment with no contents inserts a pagebreak.
  • 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.yml navigation, write all generated outputs in .publish_cache, and package them into one .publish_cache/mkdocs.zip file;
  • a Markdown file: convert that single file, write all generated outputs in .publish_cache beside it, and package them into one ZIP file there;
  • a directory: recursively convert every *.md file 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

    • --base Numbered base HTML document.
    • --handout Numbered HTML handout with answer environments omitted.
    • --revealjs Numbered Reveal.js slide deck.
    • --html All 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 .

  • --all generates all output formats, including HTML, LaTeX article, LaTeX handout, and Beamer outputs.

  • --version VERSION, -v VERSION Add the version string to generated output filenames and ZIP names.

  • --no-mkdocs-page-zip In no-argument MkDocs mode, only include the merged MkDocs output in .publish_cache/mkdocs.zip.

  • -h, --help Show 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.

Metadata

Release files for gradientgrove 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gradientgrove 0.1.10
File Size Uploaded Provenance
gradientgrove-0.1.10.tar.gz 73.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gradientgrove 0.1.10
File Interpreter ABI Platform
gradientgrove-0.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 149.6 kB

Release files / gradientgrove-0.1.10.tar.gz

Download URL gradientgrove-0.1.10.tar.gz
Size 73.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4298d9403189cf0bbffd1fd0df8303305d585e1a48c26a26c6ac6c4cfe556679
BLAKE2b-256 checksum
How to use checksums
3fd40660f1f8b4fc84520dad385351c4219abc578ee697f4351eb88e2ccf1ab3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / gradientgrove-0.1.10-py3-none-any.whl

Download URL gradientgrove-0.1.10-py3-none-any.whl
Size 75.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48c73822741e51332c4bd6348e53d13d0ddc9da02c792cb0c05a82bd78863f21
BLAKE2b-256 checksum
How to use checksums
05a51eba9dc44523490f3f87a6b4d1c4291d5b700957962171e0423fd68908d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for gradientgrove 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gradientgrove-0.1.10.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page