{"id":13993116,"url":"https://github.com/leanprover/LeanInk","last_synced_at":"2025-07-22T17:30:53.906Z","repository":{"id":37009447,"uuid":"417511739","full_name":"leanprover/LeanInk","owner":"leanprover","description":"LeanInk is a command line helper tool for Alectryon which aims to ease the integration of Lean 4.","archived":true,"fork":false,"pushed_at":"2024-07-18T13:11:37.000Z","size":1287,"stargazers_count":60,"open_issues_count":13,"forks_count":16,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-11-06T13:31:41.513Z","etag":null,"topics":["alectryon","interactive-theorem-proving","lean","lean4","visualization"],"latest_commit_sha":null,"homepage":"","language":"Lean","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leanprover.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-15T13:35:30.000Z","updated_at":"2024-08-24T16:48:21.000Z","dependencies_parsed_at":"2024-01-10T09:28:31.164Z","dependency_job_id":"923395eb-acaf-42a6-abf4-adc82008ac35","html_url":"https://github.com/leanprover/LeanInk","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2FLeanInk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2FLeanInk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2FLeanInk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2FLeanInk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leanprover","download_url":"https://codeload.github.com/leanprover/LeanInk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227143372,"owners_count":17737151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alectryon","interactive-theorem-proving","lean","lean4","visualization"],"created_at":"2024-08-09T14:02:14.332Z","updated_at":"2024-11-29T14:31:34.988Z","avatar_url":"https://github.com/leanprover.png","language":"Lean","funding_links":[],"categories":["Lean"],"sub_categories":[],"readme":"![LeanInkLogo](https://user-images.githubusercontent.com/24965150/145307859-30350f23-4f7f-4aab-a1ab-34889ad44d9a.png)\n\n[![CI](https://github.com/leanprover/LeanInk/actions/workflows/build.yml/badge.svg)](https://github.com/insightmind/LeanInk/actions/workflows/build.yml)\n[![LƎⱯN - 4](https://img.shields.io/static/v1?label=LƎⱯN\u0026message=4\u0026color=black)](https://github.com/leanprover/lean4)\n\nLeanInk is a command line helper tool for [Alectryon](https://github.com/cpitclaudel/alectryon) which aims to ease the integration and support of [Lean 4](https://github.com/leanprover/lean4).\nAlectryon uses the information provided by LeanInk to create a static code visualization for Lean 4 code.\nFor more information about Alectryon make sure to take a look at their repository.\n\n\u003e The official version of Alectryon does not yet support LeanInk, as LeanInk is still in active development. Please use our [Alectryon Fork](https://github.com/insightmind/alectryon/tree/lean4) to test LeanInk.\n\n# Installation\n\nYou can either build LeanInk and install it yourself as shown below, or you can use the build script to install a LeanInk release version:\n\n```bash\nsh -c \"$(curl https://raw.githubusercontent.com/leanprover/LeanInk/main/init.sh -sSf)\"\n```\n\n## Building from source\n\nBefore you can build LeanInk from source make sure to install the latest version of [Lean 4](https://github.com/leanprover/lean4) using `elan`.\nThis will also automatically install the [Lake](https://github.com/leanprover/lake) package manager.\n\n```bash\ngit clone https://github.com/leanprover/LeanInk\ncd LeanInk\nlake build\n```\n\nTo install this built version it is recommended you simply add the `LeanInk/build/bin` folder to your PATH environment.\n\n# Usage\n\nAnalyzing a simple lean program `Input.lean` is very straightforward. To do so you simply use the `analyze` command (shorthand `a`) and provide LeanInk the input file.\n\n```bash\nleanInk analyze Input.lean\n# OR\nleanInk a Input.lean\n```\n\nThe `analyze` command will generate an output file `Input.lean.leanInk` with the annotate lean program, encoded using Alectryons fragment json format. (For more information about the json format take a look at [Alectryon.lean](https://github.com/leanprover/LeanInk/blob/main/LeanInk/Annotation/Alectryon.lean))\n\n---\n\nIf your lean program has external dependencies and uses Lake as its package manager you can use the `--lake` argument to provide the lakefile.\n\n```bash\nleanInk analyze Input.lean --lake lakefile.lean\n```\n\nLeanInk will then fetch any dependencies if necessary.\n\n---\n\nYou can also analyze multiple files sequentially (concurrent analysis should be possible but is currently out of scope, feel free to contribute!):\n\n```bash\nleanInk analyze Input1.lean Input2.lean\n```\n\nThis will create `Input1.leanink` and `Input2.leanink` respectively. However if you want to provide a lake should be valid for both input files, as you can only provide a single lake file.\n\n---\n\nTo get the supported Lean 4 version of your instance of LeanInk you can do the following:\n\n```bash\nleanInk leanVersion\n# OR\nleanInk lV\n```\n\n## Usage in Alectryon\n\nAlectryon automatically integrates LeanInk internally to analyze a Lean 4 code file or a documentation file with Lean 4 code blocks.\nTo embed Lean 4 in code blocks you have to use the `lean4::` directive for reStructuredText and `{lean4}` directive for myST markdown files. This is to distinguish the support of Lean 3 and Lean 4 in Alectryon.\n\nFor more information about Alectryon make sure to take a look at their repository.\n\n# Development\n\n## Updating\n\nWhen updating the `lean-toolchain`, please also:\n* update `test/dep/lean-toolchain` to match,\n* change the Mathlib commit in `test/dep.lakefile.lean` to a commit of Mathlib using the same toolchain,\n* run `lake update` in `test/dep/` to update the `lake-manifest.json`.\n\n## Experimental Features\n\n### Additional Type Hover Metadata\nThe following flags are experimental and used to display additional information about a source text token in Alectryon. However this feature in Alectryon is still in active development and available here: [AlectryonFork:typeid](https://github.com/insightmind/alectryon/tree/typeid):\n\n- `--x-enable-type-info` flag enables extraction of type information\n- `--x-enable-docStrings` flag enables extraction of doc strings\n- `--x-enable-semantic-token` flag enables extraction of semantic toke types for semantic syntax highlighting support\n\n## Running Tests\nThere are some aspects you might want to take note of when attempting to develop a feature or fix a bug in LeanInk.\n\nLeanInk uses simple diffing tests to make sure the core functionality works as expected. These tests are located in the `./test` folder.\n\nYou can run these tests using `lake script run tests`. This will run LeanInk for every `.lean`, that's not a `lakefile` or part of an `lean_package`. It will compare the output of LeanInk to the expected output within the `.lean.leanInk.expected` file.\n\nTo capture a new expected output file you can either run `lake script run capture` to capture the output for all files or use leanInk itself to generate an output for a single file and rename it afterwards.  Be sure to carefully examine the git diff before committing the new expected baselines.\n\n# Contributing\n\nLeanInk enforces the same [Contribution Guidelines](https://github.com/leanprover/lean4/blob/master/CONTRIBUTING.md) as Lean 4. Before contributing, make sure to read it.\n\nWe also highly encourage you to sign your commits.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2FLeanInk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanprover%2FLeanInk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2FLeanInk/lists"}