{"id":16315597,"url":"https://github.com/andreasabel/agda2lagda","last_synced_at":"2026-02-23T21:47:38.433Z","repository":{"id":40332545,"uuid":"300035575","full_name":"andreasabel/agda2lagda","owner":"andreasabel","description":"Simple conversion from Agda text to literate Agda text.","archived":false,"fork":false,"pushed_at":"2024-04-11T03:42:56.000Z","size":147,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T21:57:58.292Z","etag":null,"topics":["agda","command-line-tool","latex","literate-programming"],"latest_commit_sha":null,"homepage":"https://andreasabel.github.io/agda2lagda/","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreasabel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-09-30T19:22:49.000Z","updated_at":"2024-07-07T08:12:07.000Z","dependencies_parsed_at":"2024-01-22T21:08:33.948Z","dependency_job_id":"0b1aa000-1158-407f-9915-3cacf8b10a2c","html_url":"https://github.com/andreasabel/agda2lagda","commit_stats":{"total_commits":77,"total_committers":1,"mean_commits":77.0,"dds":0.0,"last_synced_commit":"370d957374de2c107cd20da78599b65d7da3574d"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasabel%2Fagda2lagda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasabel%2Fagda2lagda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasabel%2Fagda2lagda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasabel%2Fagda2lagda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreasabel","download_url":"https://codeload.github.com/andreasabel/agda2lagda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244703590,"owners_count":20496147,"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":["agda","command-line-tool","latex","literate-programming"],"created_at":"2024-10-10T21:57:57.410Z","updated_at":"2026-02-23T21:47:33.410Z","avatar_url":"https://github.com/andreasabel.png","language":"Haskell","readme":"[![Hackage version](https://img.shields.io/hackage/v/agda2lagda.svg?label=Hackage\u0026color=informational)](http://hackage.haskell.org/package/agda2lagda)\n[![agda2lagda on Stackage Nightly](https://stackage.org/package/agda2lagda/badge/nightly)](https://stackage.org/nightly/package/agda2lagda)\n[![Stackage LTS version](https://www.stackage.org/package/agda2lagda/badge/lts?label=Stackage)](https://www.stackage.org/package/agda2lagda)\n[![Cabal build](https://github.com/andreasabel/agda2lagda/workflows/Haskell-CI/badge.svg)](https://github.com/andreasabel/agda2lagda/actions)\n[![Stack build](https://github.com/andreasabel/agda2lagda/workflows/Stack%20build/badge.svg)](https://github.com/andreasabel/agda2lagda/actions)\n\n\n\nagda2lagda: Convert program to literate program (Agda/Haskell)\n==============================================================\n\nGenerate a literate Agda/Haskell script from an Agda/Haskell script.\nProduces LaTeX or Markdown literate scripts.\n\nSpecification\n-------------\n\nConversion into LaTeX (default):\n\n- Single line comments are turned into ordinary LaTeX.\n  * Paragraphs followed by a line of equal signs are turned into `\\heading`s.\n  * Paragraphs followed by a line of dashes are turned into `\\subheading`s.\n  * Consecutive paragraphs starting `*` are turned into an `itemize` environment.\n  * At the end of the file, extra block comment terminators are removed.\n\n- Comment blocks, if started on the 0th column, count as _commenting out_.\n  These will be turned into TeX comments.\n  Nested comments are not recognized.\n\n- The rest is interpreted as code and wrapped in a `code` environment.\n\nConversion into Markdown (option `--markdown`) is similar,\nbut nothing needs to be done for headings and itemize environments:\n\n- Single line comments are turned into ordinary text.\n  * At the end of the file, extra block comment terminators are removed.\n\n- Comment blocks, if started on the 0th column, count as _commenting out_.\n  These will be turned into HTML comments.\n  Nested comments are not recognized.\n\n- The rest is interpreted as code and wrapped in a code environment (triple backticks).\n\nExamples\n--------\n\nGiven input [`Foo.agda`](https://github.com/andreasabel/agda2lagda/blob/master/test/Foo.agda):\n- Invocation `agda2lagda Foo.agda` produces output\n  [`Foo.lagda.tex`](https://github.com/andreasabel/agda2lagda/blob/master/test/golden/Foo.lagda.tex).\n- Invocation `agda2lagda --markdown Foo.agda` produces output\n  [`Foo.lagda.md`](https://github.com/andreasabel/agda2lagda/blob/master/test/golden/Foo.lagda.md).\n\nLaTeX examples (rendered):\n- http://www.cse.chalmers.se/~abela/#MultiSortedAlgebra\n- http://www.cse.chalmers.se/~abela/#cr-sk\n\nExample `Makefile` to turn `.agda` file into highlighted HTML via Markdown (since `v0.2023.1.12`):\n```make\nFILE=Foo\nTITLE=The Title\n\ndefault : md/html/$(FILE).html\n\n# Step 1: agda2lagda: Produce Markdown literate script.\n\nmd/%.lagda.md : %.agda\n\tagda2lagda -f --markdown -o md/ $\u003c\n\n# Step 2: agda: Highlight and format code blocks as HTML.\n# Also produces Agda.css.\n\nmd/html/%.md : md/%.lagda.md\n\tcd md ; agda --html --html-highlight=auto ../$\u003c\n\n# Step 3: pandoc: Produce HTML.  Improvise header to make HTML self-contained.\n\nmd/html/%.html : md/html/%.md\n\techo '\u003c!DOCTYPE HTML\u003e\u003chtml\u003e\u003chead\u003e\u003cmeta charset=\"utf-8\"\u003e\u003ctitle\u003e$(TITLE)\u003c/title\u003e\u003clink rel=\"stylesheet\" href=\"Agda.css\"\u003e\u003c/head\u003e' \u003e $@\n\tpandoc -f markdown -t html $\u003c \u003e\u003e $@\n```\n\nInstallation from binary\n------------------------\n\nBinaries for Linux, macOS and Windows are available from [GitHub releases](https://github.com/andreasabel/agda2lagda/releases).\nJust download the executable for your platform there and put it in a directory that is in the system `PATH`.\n\nFor example, under Linux (similar under macOS):\n```shell\nVERSION=\"0.2023.3.25\"\nSRC=\"https://github.com/andreasabel/agda2lagda/releases/download/v${VERSION}/agda2lagda-${VERSION}-linux.binary\"\nTGT=\"/usr/local/bin/agda2lagda\"\nwget ${SRC} -O ${TGT}\nchmod +x ${TGT}\n```\nFor macOS, there is also a installer package, e.g.:\n```shell\nVERSION=\"0.2023.3.25\"\nSRC=\"https://github.com/andreasabel/agda2lagda/releases/download/v${VERSION}/agda2lagda-${VERSION}-mac.pkg\"\nTGT=\"/tmp/agda2lagda.pkg\"\nwget ${SRC} -O ${TGT}\nopen ${TGT}\n```\nVerify the installation with these commands (Linux/macOS):\n```console\n$ which agda2lagda\n/usr/local/bin/agda2lagda\n$ agda2lagda --version\nagda2lagda version 0.2023.3.25\n```\n\nInstallation from source\n------------------------\n\nThese are standard installation instructions.\n\nLast update of installation instructions: 2023-03-25.\n\n### From stackage.org\n\nRequires [stack](https://docs.haskellstack.org/en/stable/install_and_upgrade/).\n```\nstack update\nstack install agda2lagda --resolver nightly\n```\n\n### From hackage.haskell.org\n\nRequires GHC \u003e= 8.0 and the Haskell Cabal.\n```\ncabal update\ncabal install agda2lagda\n```\n\n### From the repository\n\n```\ngit clone https://github.com/andreasabel/agda2lagda.git\ncd agda2lagda\ncabal install\n```\nAlternatively to the last line, you can use `stack`.\nE.g. if you have GHC 8.10.7 installed, you can use this compiler as follows:\n```\nstack install --system-ghc --stack-yaml stack-8.10.7.yaml\n```\nAlternatively, `stack` can install the compiler for you:\n```\nstack install --stack-yaml stack-xx.yy.zz.yaml\n```\nThe `xx.yy.zz` is a placeholder for the GHC version,\nchoose one (for which there is a `.yaml` file).\n\nAt the time of writing, installation with these GHC versions has been tested:\n8.0.2, 8.2.2, 8.4.4, 8.6.5, 8.8.4, 8.10.7, 9.0.2, 9.2.7, 9.4.4.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreasabel%2Fagda2lagda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreasabel%2Fagda2lagda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreasabel%2Fagda2lagda/lists"}