Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Seasawher/mk-exercise
Simple and intuitive tool to manage exercises in textbooks written in Lean.
https://github.com/Seasawher/mk-exercise
lean lean4
Last synced: 23 days ago
JSON representation
Simple and intuitive tool to manage exercises in textbooks written in Lean.
- Host: GitHub
- URL: https://github.com/Seasawher/mk-exercise
- Owner: Seasawher
- License: mit
- Created: 2024-01-15T13:09:09.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T12:31:37.000Z (about 2 months ago)
- Last Synced: 2024-10-25T13:21:03.702Z (about 2 months ago)
- Topics: lean, lean4
- Language: Lean
- Homepage:
- Size: 84 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mk-exercise
This tool erases parts of Lean code and replaces them with `sorry`. I developed this to make it easier to manage exercises in textbooks written in Lean.
This is inspired by a script in [a glimpse of lean](https://github.com/PatrickMassot/GlimpseOfLean/tree/master).
## How to use
### Basic usage
Add this repository to your `lakefile`:
```lean
require «mk-exercise» from git
"https://github.com/Seasawher/mk-exercise" @ "main"
```Don't forget to run `lake update mk-exercise` after editing the `lakefile`. And simply run `lake exe mk_exercise `.
### Setup GitHub Action
GitHub Action allows you to run this every time a particular branch is updated, automatically updating the exercises to the latest state. You may wish to look at [yuma-mizuno/lean-math-workshop](https://github.com/yuma-mizuno/lean-math-workshop), where exercises are managed using this tool.
## Features
* Replace the code enclosed by `-- sorry` with `sorry`, preserving indentation.
* Replace the inline code enclosed by `/-+-/` with `sorry`.
* Replace the code after `/- sorry -/` with sorry.
* Lines ending with `--##` are ignored.
* Blocks enclosed with `--##--` are ignored.Check the test code for more information.
* [input file](./Test/Src/Solution.lean)
* [expected output](./Test/Exp/Solution.lean)