{"id":15355942,"url":"https://github.com/fibo/kiss-literate-programming","last_synced_at":"2025-07-03T18:32:56.324Z","repository":{"id":45696436,"uuid":"50495247","full_name":"fibo/kiss-literate-programming","owner":"fibo","description":"is a minimal literate programming boilerplate","archived":false,"fork":false,"pushed_at":"2022-08-05T08:35:51.000Z","size":10,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T06:39:29.887Z","etag":null,"topics":["literate-programming"],"latest_commit_sha":null,"homepage":"https://fibo.github.io/kiss-literate-programming","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fibo.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}},"created_at":"2016-01-27T09:07:42.000Z","updated_at":"2024-05-09T10:10:15.000Z","dependencies_parsed_at":"2022-08-04T19:15:11.189Z","dependency_job_id":null,"html_url":"https://github.com/fibo/kiss-literate-programming","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fibo/kiss-literate-programming","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fkiss-literate-programming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fkiss-literate-programming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fkiss-literate-programming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fkiss-literate-programming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fibo","download_url":"https://codeload.github.com/fibo/kiss-literate-programming/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fkiss-literate-programming/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263379404,"owners_count":23457841,"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":["literate-programming"],"created_at":"2024-10-01T12:26:21.506Z","updated_at":"2025-07-03T18:32:56.296Z","avatar_url":"https://github.com/fibo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KISS-Literate-Programming\n\n\u003e is a minimal literate programming boilerplate\n\n[![KLP](https://fibo.github.io/svg/klp-badge.svg)](https://fibo.github.io/kiss-literate-programming)\n\n## Description\n\nMerge two beautiful concepts: the [KISS principle](https://en.wikipedia.org/wiki/KISS_principle) and the [Literate programming approach](https://en.wikipedia.org/wiki/Literate_programming).\n\nThe *KISS-Literate-Programming* (from now on, KLP) is defined by the following rules:\n\n* All source code and documentation are contained in a *README.md* text file, which is written using [Markdown syntax](https://daringfireball.net/projects/markdown/syntax).\n* Source code rows embedded in *README.md* start with 4 spaces; code examples can use the backtick syntax and are ignored. See the [readme template](#readme-template) as example.\n* Source code is generated running `make`.\n\nKLP is agnostic about:\n\n* The programming language chosen.\n* Installation instructions.\n\nMost of all: KLP does not need an implementation like the one provided here, you can just edit *Makefile* and *README.md* by hand! Of course you can also use `klp` command, see [installation instructions](#installation)\n\n## ADDENDUM\n\nThis KLP implementation uses bash and rely on GNU make which is available on every OS.\n\nFor a more advanced, yet tiny, tool please check out [markdown2code](https://fibo.github.io/markdown2code).\nIt is recommended if you have Node.js installed, in particular you can use triple backticks and highlight your code.\n\n## Badge\n\nAdd the row below in your markdown file to get a badge\n\n```\n[![KLP](https://fibo.github.io/svg/klp-badge.svg)](https://fibo.github.io/kiss-literate-programming)\n```\n\n## Usage\n\nSuppose you want to create a shell command, for instance *hello-world.sh*. I suppose\nyou version it using a *git* repository inside an *hello-world* folder.\n\n```\nmkdir hello-world\ncd hello-world\nklp hello-world.sh\n```\n\nNow you have a *README.md* you can edit to add documentation and code. See [this README.md itself](https://raw.githubusercontent.com/fibo/kiss-literate-programming/master/README.md) as example.\n\n## Annotated source\n\nStart a `klp` function\n\n    klp() {\n\nwhich expects one parameter, otherwise prints its **usage**\n\n    \tif [ -z \"$1\" ]\n    \tthen\n    \t\tcat \u003c\u003c-MESSAGE\n    \t\t# KISS Literate programming\n    \t\t##\n    \t\t# Installation instructions, source and license available here:\n    \t\t# https://fibo.github.io/kiss-literate-programming\n    \t\t##\n    \t\tUSAGE: klp foo\n    \t\tMESSAGE\n\n    \t\treturn 1\n    \tfi\n\n    \tTARGET=$1\n\nCheck if *README.md* and *Makefile* already exist, do not overwrite them.\n\n    \tif [ -e Makefile ]\n    \tthen\n    \t\techo Makefile already exists\n    \t\treturn 1\n    \tfi\n\n    \tif [ -e README.md ]\n    \tthen\n    \t\techo README.md already exists\n    \t\treturn 1\n    \tfi\n\nGenerate *README.md*\n\n    \tcat \u003c\u003cREADME \u003e README.md\n\n\nusing the following template\n\u003ca name=\"readme-template\"\u003e\u003c/a\u003e\n\n    \u003c!-- TODO: edit name and description --\u003e\n    # name\n\n    \u003e description\n\n    [![KLP](https://fibo.github.io/svg/klp-badge.svg)](https://fibo.github.io/kiss-literate-programming)\n\n    ## Installation\n\n    \u003c!-- TODO: installation instructions here --\u003e\n\n    ## Usage\n\n\n    ## Annotated source\n\n    Documentation here\n\n        your code here\n\n    more documentation\n    more documentation\n\n    ```\n    example code\n    ```\n\n        more code\n        more code more code\n        more code more code more code\n\n    more documentation\n\n    ## License\n\n    \u003c!-- TODO: license here --\u003e\n\nRemember to change *name*, *description* and so on.\nPlease keep the *kiss-literate* badge to support the project.\n\n    README\n\nGenerate *Makefile*\n\n    \tcat \u003c\u003cMAKEFILE \u003e Makefile\n    .PHONY: $TARGET\n\n    $TARGET:\n    \tgrep '    ' README.md | sed -e 's/    //' \u003e $TARGET\n    MAKEFILE\n\nClean up\n\n    \tunset TARGET\n    }\n\n## Installation\n\nInstructions borrowed from [git-aware-prompt](https://github.com/jimeh/git-aware-prompt#installation).\n\n```\nmkdir -p ~/.bash\ncd ~/.bash\ngit clone git://github.com/fibo/kiss-literate-programming.git\n```\n\nIf you prefer, you can just copy the [klp.sh](https://raw.githubusercontent.com/fibo/kiss-literate-programming/master/klp.sh) somewhere.\n\nEdit your *~/.bash_profile* or *~/.profile* and add the following\n\n```\nsource ~/.bash/kiss-literate-programming/klp.sh\n```\n\n## Requirements\n\n* grep and sed: used for extracting code from *README.md*\n* cat: used to generate *Makefile* and *README.md*.\n* bash\n* make\n* git: optionally used for installation\n\n\n## Examples\n\nFollows a list of examples embracing KLP method:\n\n* [5m](https://fibo.github.io/5m/)\n* [aws-lambda-res](https://fibo.github.io/aws-lambda-res/)\n* [mdconf-from](https://fibo.github.io/mdconf-from/)\n* [numerology](https://fibo.github.io/numerology/)\n* [prime-number](https://fibo.github.io/prime-number/)\n* [static-props](https://fibo.github.io/static-props/)\n* [volatility](https://fibo.github.io/volatility/)\n* [y-combinator](https://fibo.github.io/y-combinator/)\n* [fibo's home initializer script](https://github.com/fibo/home/blob/gh-pages/README.md#init-home)\n\n## License\n\n[MIT](https://fibo.github.io/mit-license)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibo%2Fkiss-literate-programming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffibo%2Fkiss-literate-programming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibo%2Fkiss-literate-programming/lists"}