{"id":30292668,"url":"https://github.com/fennecdjay/mdr","last_synced_at":"2025-08-17T00:37:40.670Z","repository":{"id":176308121,"uuid":"243593689","full_name":"fennecdjay/mdr","owner":"fennecdjay","description":"MDR, the markdown runner","archived":false,"fork":false,"pushed_at":"2024-03-23T12:31:00.000Z","size":486,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-23T13:41:05.014Z","etag":null,"topics":["hacktoberfest","literate-programming","markdown"],"latest_commit_sha":null,"homepage":"https://fennecdjay.github.io/mdr/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fennecdjay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-02-27T18:57:26.000Z","updated_at":"2024-03-23T12:29:51.000Z","dependencies_parsed_at":"2023-07-12T05:31:22.085Z","dependency_job_id":null,"html_url":"https://github.com/fennecdjay/mdr","commit_stats":null,"previous_names":["fennecdjay/mdr"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fennecdjay/mdr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fennecdjay%2Fmdr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fennecdjay%2Fmdr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fennecdjay%2Fmdr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fennecdjay%2Fmdr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fennecdjay","download_url":"https://codeload.github.com/fennecdjay/mdr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fennecdjay%2Fmdr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270791276,"owners_count":24645782,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"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":["hacktoberfest","literate-programming","markdown"],"created_at":"2025-08-17T00:37:40.117Z","updated_at":"2025-08-17T00:37:40.656Z","avatar_url":"https://github.com/fennecdjay.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MDR, a markdown runner\n\n![Linux](https://github.com/fennecdjay/mdr/workflows/Linux/badge.svg)\n![MacOs](https://github.com/fennecdjay/mdr/workflows/MacOs/badge.svg)\n![Windows](https://github.com/fennecdjay/mdr/workflows/Windows/badge.svg)\n[![Line Count](https://tokei.rs/b1/github/fennecdjay/mdr)](https://github.com/Gwion/mdr)  \n\nmdr is a **small** *program* and *markup*\ndesigned to facilitate documentation and testing.\nIt can both generate documentation pages and\ngenerate and actualaly test small code examples\nin your documentation. (This ensures any code\nexamples you present to your users actually work.)\n\n![logo](assets/logoreadme.png \"The Mdr logo! (WIP)\")\n\nI started this tool to help with [Gwion](https://github.com/fennecdjay/gwion)'s\ndevelopment, but it is not tied in any way to this project.\n\nLet's go over the basic functionality... :smile:\n\n\n## How to write documentation pages with `mdr`\n\nFor how to do a basic documentation\npage, [see this page's original source](\nhttps://github.com/fennecdjay/mdr/blob/master/README.mdr).\n\n\n## How to write code examples with `mdr`\n\nLet's write our first code example created from our\ndocumentation page, which also shows off templating and\nhow to have the code automatically compiled and tested.\n\n\n### Define a program structure\n\n  \u003e hello_world.c\n``` hello_world.c  \n@[[ Includes ]]\n\nint main(int argc, char** argv) {\n  @[[ Print ]]\n}\n```  \nWe fill in the `Includes` template variable as follows:\n\n\n### Filling in template variables\n\nAs we need the *puts* function, we need **stdio** headers.\n\n  \u003e Includes\n``` Includes  \n#include \u003cstdio.h\u003e\n```  \n\nWe also fill in the print function we use above:\n\n  \u003e Print\n``` Print  \nputs(\"Hello, World!\");\n```  \n\n\n### Compiling the example code\n\nNow, let's compile *hello_world.c* to make sure\nthis test code owrks.\n\n  \u003e exec: cc hello_world.c -o hello_world  \n```\n```  \n\nYes, there should be no output, and that's good news\nsince that means no compilation errors.\n\n\n### Including a code file or other output\n\nLet's look at *hello_world.c*:\n\n  \u003e exec: cat hello_world.c  \n```\n#include \u003cstdio.h\u003e\n\nint main(int argc, char** argv) {\n  puts(\"Hello, World!\");\n}\n```  \n\nThat's the content of the source file we generated (and compiled).\nYou can see how this can be used for arbitrary shell commands\nto generate output.\n\n\n### Testing example code\n\nThen we run our test program:\n\n  \u003e exec: ./hello_world  \n```\nHello, World!\n```  \n\nDo we read *Hello World!* ?\nAssuming yes, let's continue.\n\n\n### More test\n\n  \u003e exec: [ \"$(./hello_world)\" = \"Hello, World!\" ] \u0026\u0026 echo \"OK\" || echo \"NOT_OK\"  \n```\nOK\n```  \n\n\n## Building `mdr`\n\nAs a C program, it seemed natural to use [make](https://www.gnu.org/software/make)\nas a build system.\n\n``` sh\nmake\n```\n\n## Testing `mdr`\n                    \nAlso using make:    \n``` sh\nmake test                 \n```                   \n\nYou can also try\n``` sh\nbash scripts/test.sh\n```\n\n## Installing `mdr`\n\nAs easy as before, just type.\n\n``` sh\nmake install\n```\nor just copy `mdr` somewhere in your path.\n\n\n## Using `mdr`\n\nTo generate this doc page itself, use this command\nin the repository root:\n\n``` sh\nmdr README.mdr\n```\n\n-------\n\ngenerated from [this file](https://github.com/fennecdjay/mdr/blob/master/README.mdr)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffennecdjay%2Fmdr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffennecdjay%2Fmdr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffennecdjay%2Fmdr/lists"}