{"id":17383670,"url":"https://github.com/rigelrozanski/shelldown","last_synced_at":"2026-04-11T03:03:47.947Z","repository":{"id":57485343,"uuid":"94737911","full_name":"rigelrozanski/shelldown","owner":"rigelrozanski","description":"Let your markdown tutorials test themselves!","archived":false,"fork":false,"pushed_at":"2017-08-31T07:25:22.000Z","size":19,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-03T13:34:55.175Z","etag":null,"topics":["automation","bash","markdown","markdown-parser","shell-script","tutorial","tutorial-code"],"latest_commit_sha":null,"homepage":"","language":"Go","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/rigelrozanski.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":"2017-06-19T04:55:40.000Z","updated_at":"2020-03-22T04:15:28.000Z","dependencies_parsed_at":"2022-08-26T11:11:04.549Z","dependency_job_id":null,"html_url":"https://github.com/rigelrozanski/shelldown","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rigelrozanski/shelldown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigelrozanski%2Fshelldown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigelrozanski%2Fshelldown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigelrozanski%2Fshelldown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigelrozanski%2Fshelldown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rigelrozanski","download_url":"https://codeload.github.com/rigelrozanski/shelldown/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigelrozanski%2Fshelldown/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31667034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["automation","bash","markdown","markdown-parser","shell-script","tutorial","tutorial-code"],"created_at":"2024-10-16T07:43:27.777Z","updated_at":"2026-04-11T03:03:47.921Z","avatar_url":"https://github.com/rigelrozanski.png","language":"Go","readme":"# shelldown!\n\n[![CircleCI](https://circleci.com/gh/rigelrozanski/shelldown.svg?style=svg)](https://circleci.com/gh/rigelrozanski/shelldown)\n\n_Generate shell scripts from embedded comments and code blocks within markdown_\n\n---\n\n\n### Installation\n```\ngo get github.com/rigelrozanski/shelldown\nmake all\n```\n\n### Usage\n\nThe premise of `shelldown` is to be able to generate a shell script\nto test any bash scripts codeblocks you may have within your a markdown file. \nThis is accomplished by loading a template shell script which is contained within\nmarkdown comments at the top of you markdown file:\n\n```\n\u003c!---\n\u003cAll your regular shell commands go here\u003e\n--\u003e\n```\n\nWithin the body of your markdown file you may have codeblocks you wish to test.\nTo designate a codeblock for testing simply add `shelldown[index]` to the first line\ndesignating a codeblock. Here `index` refers to any integer:\n\n``````  \n```  shelldown[0]\necho \"my codeblock\"\necho \"what a cool echo\"\n```\n``````\n\nTo reference from this codeblock within shell script template use\n`#shelldown[index][line]` where the `index` is the same integer as above, and\n`line` is the line number within the code block to be referenced. Note that if \nthe line number is set to `-1` then the entire codeblock will be used.\n\nHere is a very simple completed example:\n\n``````\n\u003c!---\n#!/bin/bash\n\n#shelldown[0][1]\n--\u003e\n\n# My cool markdown file\n\nhere is some awesome code btw:\n\n``` shelldown[0]\necho \"everything is okay\"\necho \"everything is right\"\n\n```\n``````\n\nTo generate the shell script use the command:\n\n```\nshelldown path/to/markdown.md\n```\n\nif the bash script generated from the above example was run, it should output\n`everything is okay` as it was referencing the second line the first codeblock\n\n\n### Full Examples\n\nFor full demonstration checkout the examples within `examples/`.  Here\n`example_simple.md` is a simple demonstration of the principles of shelldown,\nand `example_shunit2.md` is a more complex example which takes advantage of the\n[shunit2](https://github.com/kward/shunit2) tool (highly recommended for bash\ntesting)\n\nThese examples can automatically be run by using calling `make test_example`. \nCheck out the code within the Makefile for full detail. However the calls that \nare made effectively perform the following commands:\n\n```\nshelldown examples\nbash example_simple.sh\nbash example_shunit2.sh\n```\n\nNote that you must have [shunit2](https://github.com/kward/shunit2) installed.\nAdditionally, it's worth mentioning, that within the `.gitignore` file in this \nrepo we prevent git from tracking the scripts which `shelldown` generates. \nThis is important for ensuring that no antiquated data remains after shelldown \nmarkdown file has been updated  \n \n### Contributing\n\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n\n### License\n\nshelldown is released under the Apache 2.0 license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frigelrozanski%2Fshelldown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frigelrozanski%2Fshelldown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frigelrozanski%2Fshelldown/lists"}