{"id":22866839,"url":"https://github.com/insomnimus/mars","last_synced_at":"2026-03-06T01:02:16.739Z","repository":{"id":209749251,"uuid":"724858074","full_name":"insomnimus/mars","owner":"insomnimus","description":"A markdown to html convertion tool","archived":false,"fork":false,"pushed_at":"2026-01-09T18:07:58.000Z","size":190,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-13T08:47:59.225Z","etag":null,"topics":["cli","html","markdown","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/insomnimus.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-11-28T23:46:53.000Z","updated_at":"2026-01-09T18:02:16.000Z","dependencies_parsed_at":"2024-01-05T13:53:27.598Z","dependency_job_id":"0927f785-27e0-4da2-925f-dea073141a43","html_url":"https://github.com/insomnimus/mars","commit_stats":null,"previous_names":["insomnimus/mars"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/insomnimus/mars","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insomnimus%2Fmars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insomnimus%2Fmars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insomnimus%2Fmars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insomnimus%2Fmars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insomnimus","download_url":"https://codeload.github.com/insomnimus/mars/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insomnimus%2Fmars/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30156850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","html","markdown","rust"],"created_at":"2024-12-13T12:17:38.270Z","updated_at":"2026-03-06T01:02:16.690Z","avatar_url":"https://github.com/insomnimus.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mars\nMars is a Markdown to HTML convertion tool.\n\n## Features\n- Supports github flavoured markdown\n- Supports metadata blocks\n- Can convert an entire directory, preserving the filesystem hierarchy\n- While converting a directory, convert relative markdown links in documents to .html if the specified file exists\n- Self contained and lean executable\n- Automatic pretty formatting of generated HTML through statically linked [libtidy](https://github.com/htacg/tidy-html5)\n- Lets you insert custom CSS, scripts or raw HTML into `\u003chead\u003e`\n- Minimal memory footprint\n\n## Installation\nGrab a binary from [the releases page](https://github.com/insomnimus/mars/releases) ([here's the latest release](https://github.com/insomnimus/mars/releases/latest)) and put it somewhere in your PATH.\n\nOr build from source:\n## Building From Source\nYou will need:\n- A working rust toolchain version 1.74.0 or newer\n- clang, for generating libtidy bindings on the go\n- CMake and a C compiler, to build libtidy from source\n\nyou don't need libtidy installed. [tidy-sys](https://github.com/insomnimus/tidy-sys) takes care of it automatically.\n\n```shell\n# The file will be located in `target/release/mars` (with a .exe suffix on Windows)\n# You can move it anywhere you wish\ncargo build --release\n# OR you can install through cargo\ncargo install --path .\n```\n\n### Build Configuration / Crate Features\nCurrently there's only one feature you can turn on/off:\n- `argfile`: Enables loading arguments from argfiles if the `MARS_CONFIG_PATH` environment variable points to a file during runtime. This feature is enabled by default.\n\nTo disable all features enabled by default, pass `--no-default-features` on the command line while building or installing mars.\n\n\n## Usage\nThere are 4 modes of operation:\n- Single input file, no output file: prints to stdout: `mars foo.md`\n- Single input file, one output file: Converts input and saves to output: `mars foo.md -o foo.html`\n- Single input directory, write to directory: Converts `.md` files in input recursively and writes to output directory, preserving the hierarchy: `mars . -O ../docs` (notice the capital `-O`)\n- Multiple input files, write to directory: Converts all input files and writes under the output directory: `mars foo.md bar.md -O ../docs`\n\nAdditionally you can insert styling, scripts or otherwise any raw HTML into the `\u003chead\u003e` section of converted documents.\n### Example: Use Sakura CSS\n```shell\nmars ./docs/ -O ./docs/html -c \"https://cdn.jsdelivr.net/npm/sakura.css/css/sakura.css\"\n# You can specify the -c option multiple times\n# There's a convenience flag for Sakura.css:\nmars ./docs/ -O ./docs/html --sakura-css\n```\n\n### Example: Convert all Markdown files in your home\n```shell\n# The -a/--all flag makes mars not ignore hidden files and folders\nmars \"$HOME\" --all -O ./docs\n```\n\n### Example: Convert a single file\n```shell\nmars ./readme.md -o ./readme.html\n```\n\n### Example: Read markdown from stdin\n```shell\ncat readme.md | mars -o readme.html -\n```\n\n## Metadata\nYou can specify metadata on top of a markdown file. The format for the block is YAML.\n\nThe below snippet demonstrates the usage and all the possible metadata fields:\n```markdown\n---\ntitle: Example Metadata Usage\nlang: en\nhard_breaks: true\ncss: [\"https://example.com/foo.css\", \"https://example.com/bar.css\"]\nscript: [\"https://example.com/foo.js\"]\nhead: '\u003cmeta name=\"description\" content=\"Demonstrate usage of metadata blocks!\"\u003e'\n---\n\nRest of your content goes here.\n```\n\nThat is\n- A metadata block starts with `---`\n- and then a new line\n- then a YAML map containing key-value pairs\n- and it ends with a line containing only `---`\n\nKeys not shown above are simply ignored.\n\nIf the text between `---` does not contain valid YAML, it is not considered a metadata block; it's rendered to HTML as Markdown.\n\n### Metadata Precedence\n- For keys that are not lists, values in the Markdown source take precedence.\n- For lists such as `css` and `script`, the values are combined into a single list without duplication\n\t- Insertion order is preserved.\n\t- The values specified on the command line are appended to values specified in the source.\n\t- If the `--normalize-css` flag is used, the `Normalize.css` import will be put on top.\n\t- If the `--sakura-css` flag is used, the `Sakura.css` import will be last.\n## Formatting Options\nYou can learn about the possible knobs at [docs/formatting-options.md](docs/formatting-options.md).\u003cbr\u003e\nThe same content is also available through the `--help-format` option.\n\n## Config File Syntax\nIf the `argfile` feature is enabled (it is by default), mars will load extra arguments from the file pointed to by the `MARS_CONFIG_PATH` environment variable.\n\nIf the environment variable is not set, or if reading the contents of the file fails, no configuration will be loaded.\nErrors while reading the file are silently ignored.\n\n- The file must contain any number of command line options per line.\n- Each line is trimmed of whitespace.\n- Empty lines and lines starting with `#` are ignored (after trimming whitespace).\n- No escaping or quoting is done; each line is simply an argument.\n\n### Example Config File\n```conf\n# Mars configuration\n\n# set the default language\n--lang=en\n# Always use Normalize.css\n--normalize-css\n\n# Use tabs by default\n-findent=tabs\n\n# If you want to use long names of options, the value must be on a separate line:\n--format\nwrap=100\n# Or, use =\n--format=indent=8\n\n# Names and values of format options are trimmed.\n# Names and avlues of format options are also case insensitive.\n# Finally, you can use `:` or `=` to separate format key/value pairs:\n-fEOL: crlf\n# Or\n-feol = crlf\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsomnimus%2Fmars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsomnimus%2Fmars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsomnimus%2Fmars/lists"}