{"id":18739751,"url":"https://github.com/roblabs/bash-notebook","last_synced_at":"2025-04-12T20:04:28.785Z","repository":{"id":136164903,"uuid":"102056268","full_name":"roblabs/bash-notebook","owner":"roblabs","description":"Write great documents with markdown, then execute in the shell. ","archived":false,"fork":false,"pushed_at":"2017-09-01T00:24:40.000Z","size":9,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T20:03:54.748Z","etag":null,"topics":["bash","cli","command-line-cartography","notebook"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/roblabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2017-09-01T00:14:26.000Z","updated_at":"2025-03-05T04:51:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea394a26-02ef-42bc-aa74-b4d7e49ee374","html_url":"https://github.com/roblabs/bash-notebook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fbash-notebook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fbash-notebook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fbash-notebook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fbash-notebook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roblabs","download_url":"https://codeload.github.com/roblabs/bash-notebook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625493,"owners_count":21135513,"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":["bash","cli","command-line-cartography","notebook"],"created_at":"2024-11-07T15:37:14.327Z","updated_at":"2025-04-12T20:04:28.779Z","avatar_url":"https://github.com/roblabs.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `bash` notebooks with `pandoc`\n\nDocument \u0026 execute your command line code.  For fans of the command line, and for use with [Command Line Cartography](#acknowledgements).\n\nWrite great documents with markdown, then execute in the shell.  Great for testing and ensuring you always have a functional shell script.\n\n## Other Inspiring \"Notebooks\"\n\n* For fans of `S+`, ... I mean `R` — [R Markdown](http://rmarkdown.rstudio.com)\n* For fans of Javascript, [RunKit.com](https://runkit.com/roblabs/bezier-spline-from-geojson-linestring)\n* For fans of Python, [Jupyter.org](https://try.jupyter.org)\n* For fans of bash, shell or other CLI, introducing this project.\n\n## Acknowledgements\n\n* A universal document converter — [`pandoc`](http://pandoc.org/try/)\n* [@mbostock](https://twitter.com/mbostock) for all the tools and coining the phrase [Command](https://medium.com/@mbostock/command-line-cartography-part-1-897aa8f8ca2c)-[Line](https://medium.com/@mbostock/command-line-cartography-part-2-c3a82c5c0f3) [Cartography](https://medium.com/@mbostock/command-line-cartography-part-3-1158e4c55a1e).  See the links on this line for an excellent overview.\n\n---\n\nUsing `pandoc` you can write plain markdown, then generate `bash` scripts from your code blocks.\n\n## Example\n\nTurn this markdown\n\n-----\n\n###### # Install `ndjson` command line tools\n\n###### ```{bash}\n###### # install once\nnpm install -g ndjson-cli\n\n###### # get version\nndjson-cat --version\n###### ```\n---\n\nInto a shell script that you can execute.\n\n```{bash}\n# install once\nnpm install -g ndjson-cli\n\n# get version\nndjson-cat --version\n```\n\n## Usage\n\nStrip out all the markdown except,\n* Headers\n* {bash} codeblocks\n\n```\npandoc -t bashNotebook.lua test.md \u003e test.sh\n\n# run the generated script\nsh test.sh\n```\n\n### Recipes\n\n#### [`./build.sh test.md`](test.md)\n\n``` bash\n# output\n\n$ ~/github/bash-notebook\n```\n\n#### [`./build.sh install-ndjson.md`](install-ndjson.md)\n\n``` bash\n# output\n/usr/local/bin/ndjson-cat -\u003e /usr/local/lib/node_modules/ndjson-cli/ndjson-cat\n/usr/local/bin/ndjson-filter -\u003e /usr/local/lib/node_modules/ndjson-cli/ndjson-filter\n/usr/local/bin/ndjson-join -\u003e /usr/local/lib/node_modules/ndjson-cli/ndjson-join\n/usr/local/bin/ndjson-map -\u003e /usr/local/lib/node_modules/ndjson-cli/ndjson-map\n/usr/local/bin/ndjson-sort -\u003e /usr/local/lib/node_modules/ndjson-cli/ndjson-sort\n/usr/local/bin/ndjson-reduce -\u003e /usr/local/lib/node_modules/ndjson-cli/ndjson-reduce\n/usr/local/bin/ndjson-split -\u003e /usr/local/lib/node_modules/ndjson-cli/ndjson-split\n/usr/local/bin/ndjson-top -\u003e /usr/local/lib/node_modules/ndjson-cli/ndjson-top\n+ ndjson-cli@0.3.1\nupdated 1 package in 2.564s\n0.3.1\n```\n\n#### [`./build.sh geojson-random.md`](geojson-random.md)\n\n``` bash\n# output\n{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-36.90517449751496,21.325557273812592]},\"properties\":{}},{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-140.50003789365292,-44.28771852515638]},\"properties\":{}}]}\n```\n\n#### [`./build.sh random-ndjson.md`](random-ndjson.md)\n\n``` bash\n# output\n\n## out.ndjson\n{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[68.68127477355301,66.4284011721611]},\"properties\":{}},{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[133.09121509082615,44.76928882766515]},\"properties\":{}},{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[46.628280663862824,-19.743516594171524]},\"properties\":{}}]}\n\n## out.ndjson\n{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[68.68127477355301,66.4284011721611]},\"properties\":{}}\n{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[133.09121509082615,44.76928882766515]},\"properties\":{}}\n{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[46.628280663862824,-19.743516594171524]},\"properties\":{}}\n```\n\n#### [`./build.sh geojson-random-precision.md`](geojson-random-precision.md)\n\n``` bash\n# output\n\n## out.2.geojson\n{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[68.68,66.43]},\"properties\":{}},{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[133.09,44.77]},\"properties\":{}},{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[46.63,-19.74]},\"properties\":{}}]}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froblabs%2Fbash-notebook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froblabs%2Fbash-notebook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froblabs%2Fbash-notebook/lists"}