{"id":15138652,"url":"https://github.com/iaseth/readmix","last_synced_at":"2025-10-23T15:30:49.233Z","repository":{"id":154449399,"uuid":"632249341","full_name":"iaseth/readmix","owner":"iaseth","description":"Markdown with wings!","archived":false,"fork":false,"pushed_at":"2023-05-11T11:42:50.000Z","size":476,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T19:11:27.858Z","etag":null,"topics":["cli","markdown","npm","nunjucks","react","readme","readme-badges","readme-generator","readme-template","tailwindcss"],"latest_commit_sha":null,"homepage":"https://readmix.js.org/","language":"TypeScript","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/iaseth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-04-25T02:51:29.000Z","updated_at":"2023-12-11T09:59:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"db38d78b-0e84-460a-8164-303b0c035f79","html_url":"https://github.com/iaseth/readmix","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/iaseth%2Freadmix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iaseth%2Freadmix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iaseth%2Freadmix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iaseth%2Freadmix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iaseth","download_url":"https://codeload.github.com/iaseth/readmix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237843896,"owners_count":19375224,"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":["cli","markdown","npm","nunjucks","react","readme","readme-badges","readme-generator","readme-template","tailwindcss"],"created_at":"2024-09-26T07:43:02.676Z","updated_at":"2025-10-23T15:30:43.879Z","avatar_url":"https://github.com/iaseth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# readmix\n\n[`Readmix`](https://www.npmjs.com/package/readmix) is a command-line `README` generator.\n\nYou can find the source code at [`iaseth/readmix`](https://github.com/iaseth/readmix).\n\n\n## Table of contents\n* [readmix](#readmix)\n    * [Table of contents](#table-of-contents)\n    * [Installation](#installation)\n    * [Getting started](#getting-started)\n    * [Filename conventions](#filename-conventions)\n    * [Usage](#usage)\n    * [Features](#features)\n    * [Flags](#flags)\n    * [Props](#props)\n    * [Filters](#filters)\n        * [Example usage](#example-usage)\n    * [Mixins](#mixins)\n        * [Example usage](#example-usage)\n    * [Package details](#package-details)\n    * [Dependencies](#dependencies)\n    * [Dev dependencies](#dev-dependencies)\n    * [License](#license)\n\n\n\n## Installation\nYou can install [`readmix`](https://www.npmjs.com/package/readmix) with the following command:\n```\nnpm i -g readmix\n```\n\nNow you should be able to run the `readmix` command in your terminal.\n\n\n\n## Getting started\nTo get started with `Readmix`, create a file called `LICENSE.rx` in your current directory.\nPut the following text in that file:\n```\n{{ mitLicense(\"Ankur Seth\") }}\n```\nHere `mitLicense` is a mixin. A `mixin` is just a `JavaScript` function that returns a `string`.\nThis particular `mixin` is used to insert the `MIT License` in your name.\n`Readmix` contains similar `mixins` like `apache2License` and `gnuGplLicense` to insert any popular license in your file.\nMost of the license `mixins` accept 2 `args`, `Name` and `Year`.\n\nNow, you can compile the file with the following command:\n```\nreadmix --compile --markdown LICENSE.rx\n```\nThis will output a file called `LICENSE` containing the `MIT License` with your name in it.\n\n\n\n## Filename conventions\nAll readmix files end with the `.rx` entension. Readmix will only compile files that end with the `.rx` extension.\nThe output file will have the same filename but with the `.rx` removed.\n\n| Input Filename | Output Filename |\n| -------------- | --------------- |\n| `README.md.rx` | `README.md`     |\n| `LICENSE.rx`   | `LICENSE`       |\n\nWhile the main purpose of `Readmix` is to generate `markdown`, you can use it to generate almost any filetype.\nI often use `Readmix` to generate `.env`, `tex` and `css` files.\n\n\n\n## Usage\nTo compile your `README.rx` to `README`:\n```\nreadmix --compile --markdown README.rx\n```\n\nIf you want the output file to be called `README.md`, you should name the input file as `README.md.rx`.\n\nTo compile all `rx` files in the current directory:\n```\nreadmix --compile --markdown .\n```\n\nTo compile all `rx` files in the current directory and all subdirectories:\n```\nreadmix --compile --markdown --recursive .\n```\n\nTo compile your `README.rx` to `HTML`:\n```\nreadmix --compile --html README.rx\n```\n\nTo run a preview server for all `rx` files in the current directory:\n```\nreadmix --preview .\n```\nNot you can open [http://127.0.0.1:1996/](http://127.0.0.1:1996/) is your browser to see how your `rx` will look after compilation.\n\n\n\n## Features\n* Easily insert the contents of any file inside your `README`:\n\n    This will insert the contents of your `LICENSE` file:\n    ```\n    {{ \"LICENSE\" | File }}\n    ```\n\n    This will insert the contents of `tsconfig.json` file into a code-block:\n    ```\n    {{ \"tsconfig.json\" | CodeFile }}\n    ```\n\n    Here, `File` and `CodeFile` are filters provided by `Readmix`.\n\n* Easy access to `package.json` and `package-lock.json`:\n\n    This will print the app version:\n    ```\n    {{ packageJson.version }}\n    ```\n\n    This will print the app name:\n    ```\n    {{ packageLockJson.name }}\n    ```\n\n    `packageJson` and `packageLockJson` are available in every `rx` file assuming the corresponding `JSON` files are present.\n\n* Allows you to write comments in your `markdown` files:\n```\n:: This is a comment.\n```\n\n\n\n## Flags\n\nThe  `readmix` command accepts the following command line options:\n\n| `Short`   | `Long`           | Description                                                                  |\n| --------- | ---------------- | ---------------------------------------------------------------------------- |\n| `-A`      | `--api`          | Run the Readmix JSON API.                                                    |\n| `-C`      | `--compile`      | Compile to Markdown.                                                         |\n| `-D`      | `--debug`        | Turns debug mode ON.                                                         |\n| `-F`      | `--force`        | Force update files.                                                          |\n| `-H`      | `--html`         | Compile to HTML.                                                             |\n| `-I`      | `--init`         | Initialize readmix in directory, creates rxconfig.json with default options. |\n| `-L`      | `--list`         | List all input files.                                                        |\n| `-M`      | `--markdown`     | Compile to Markdown.                                                         |\n| `-O`      | `--open`         | Open live preview in default web browser.                                    |\n| `-P`      | `--preview`      | Run a live preview server.                                                   |\n| `-Q`      | `--quiet`        | Turns quiet mode ON.                                                         |\n| `-R`      | `--recursive`    | Select subdirectories recursively.                                           |\n| `-S`      | `--status`       | Print status.                                                                |\n| `-V`      | `--version`      | Print version.                                                               |\n| `-W`      | `--watch`        | Watch input files for changes.                                               |\n| `-X`      | `--experimental` | Turns experimental mode ON.                                                  |\n| `-Z`      | `--zen`          | Turns zen mode ON.                                                           |\n\n\n\n\n## Props\n\nEvery `rx` file has access to the global `Rx` object with the following properties:\n| Prop | Value |\n| --- | --- |\n| `appName` | `Readmix` |\n| `commands` | `Object [8]` |\n| `filters` | `Object [17]` |\n| `flags` | `Object [17]` |\n| `helpers` | `Object [22]` |\n| `mixins` | `Object [24]` |\n| `sugars` | `Object [3]` |\n| `utils` | `Object [1]` |\n| `descriptions` | `Object [4]` |\n| `packageJson` | `Object [14]` |\n| `packageLockJson` | `Object [5]` |\n| `tsconfigJson` | `Object [2]` |\n| `rxconfigJson` | `Object [4]` |\n| `gitconfig` | `Object [3]` |\n\n\nEvery `property` on the `Rx` object is also available globally.\nSo, you can just write `appName` instead of `Rx.appName`.\n\n\n\n## Filters\n\nIn addition to default filters in `nunjucks`, `Readmix` provides you with these additional `filters`:\n| Filter | Args |\n| --- | --- |\n| `Table` | 0 |\n| `Print` | 0 |\n| `PrintPropsTable` | 0 |\n| `PrintFunctionsTable` | 0 |\n| `PrintFiltersTable` | 0 |\n| `File` | 0 |\n| `CodeFile` | 0 |\n| `CodeBlock` | 0 |\n| `Indent` | 0 |\n| `GithubLink` | 0 |\n| `NpmLink` | 0 |\n\nEach `filter` is available globally.\n\n\n### Example usage\nYou can use the `File` filter to include the contents of your `LICENSE` file inside your `README`:\n\n```\n{{ \"LICENSE\" | File }}\n```\n\n\n\n## Mixins\n\nIn addition to props, the `Rx` object also contains a `mixins` object with the following `mixins`:\n| Function | Args |\n| --- | --- |\n| `arrayTable()` | 2 |\n| `objectTable()` | 1 |\n| `table()` | 0 |\n| `giveCredit()` | 0 |\n| `apache2License()` | 1 |\n| `bsd2License()` | 1 |\n| `bsd3License()` | 1 |\n| `cclLicense()` | 0 |\n| `epl1License()` | 0 |\n| `epl2License()` | 0 |\n| `gnuGplLicense()` | 1 |\n| `gnuLgplLicense()` | 1 |\n| `iscLicense()` | 1 |\n| `mitLicense()` | 1 |\n| `mplLicense()` | 0 |\n| `msplLicense()` | 0 |\n| `zlibLicense()` | 1 |\n| `tableOfContents()` | 1 |\n\n\nEvery `function` on the `Rx.mixins` object is also available globally.\nSo, you can just write `giveCredit()` instead of `Rx.mixins.giveCredit()` or `mixins.giveCredit()`.\n\n### Example usage\nYou can use the `giveCredit()` mixin to include a section giving credit to `Readmix`:\n\n```\n{{ giveCredit() }}\n```\n\n\n## Package details\n| `Name`         | `Value`                                         |\n| -------------- | ----------------------------------------------- |\n| `Name`         | `readmix`                                       |\n| `Description`  | `Readmix is a command-line markdown generator.` |\n| `Version`      | `0.9.0`                                         |\n| `Author`       | `iaseth`                                        |\n| `Homepage`     | `https://readmix.js.org`                        |\n| `Repository`   | `iaseth/readmix`                                |\n| `License`      | `MIT`                                           |\n| `Dependencies` | `8`                                             |\n\n\n\n## Dependencies\n|     | `Package`   | `Version`   |\n| --- | ----------- | ----------- |\n| 1   | `cors`      | `^2.8.5`    |\n| 2   | `express`   | `^4.18.2`   |\n| 3   | `ini`       | `^4.1.0`    |\n| 4   | `js-yaml`   | `^4.1.0`    |\n| 5   | `json5`     | `^2.2.3`    |\n| 6   | `marked`    | `^4.3.0`    |\n| 7   | `nunjucks`  | `^3.2.4`    |\n| 8   | `toml`      | `^3.0.0`    |\n\n\n\n## Dev dependencies\n|     | `Package`          | `Version`   |\n| --- | ------------------ | ----------- |\n| 1   | `@types/cors`      | `^2.8.13`   |\n| 2   | `@types/express`   | `^4.17.17`  |\n| 3   | `@types/marked`    | `^4.0.8`    |\n| 4   | `@types/node`      | `^18.16.0`  |\n| 5   | `@types/nunjucks`  | `^3.2.2`    |\n| 6   | `autoprefixer`     | `^10.4.14`  |\n| 7   | `html-color-names` | `^0.3.2`    |\n| 8   | `jest`             | `^29.5.0`   |\n| 9   | `postcss`          | `^8.4.23`   |\n| 10  | `tailwindcss`      | `^3.3.2`    |\n\n\n\n## License\nMIT License\n\nCopyright (c) Ankur Seth.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n## Credit\n\nThis file was generated using [`readmix`](https://github.com/iaseth/readmix).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiaseth%2Freadmix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiaseth%2Freadmix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiaseth%2Freadmix/lists"}