{"id":13783909,"url":"https://github.com/remarkjs/remark-man","last_synced_at":"2025-12-12T03:58:04.457Z","repository":{"id":33904198,"uuid":"37619711","full_name":"remarkjs/remark-man","owner":"remarkjs","description":"plugin to compile markdown to man pages","archived":false,"fork":false,"pushed_at":"2023-09-22T09:20:38.000Z","size":587,"stargazers_count":95,"open_issues_count":0,"forks_count":7,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-11T19:40:19.949Z","etag":null,"topics":["groff","man","markdown","remark","remark-plugin","roff"],"latest_commit_sha":null,"homepage":"https://remark.js.org","language":"JavaScript","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/remarkjs.png","metadata":{"funding":{"github":"unifiedjs","open_collective":"unified"},"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}},"created_at":"2015-06-17T20:41:33.000Z","updated_at":"2024-11-13T11:35:11.000Z","dependencies_parsed_at":"2023-09-23T01:23:19.681Z","dependency_job_id":"b43e10c7-f652-4770-849d-0f7edaa045d5","html_url":"https://github.com/remarkjs/remark-man","commit_stats":{"total_commits":178,"total_committers":3,"mean_commits":"59.333333333333336","dds":"0.028089887640449396","last_synced_commit":"f57c882281f749284406cc9f3617b610e4eaf1e3"},"previous_names":["wooorm/mdast-man"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-man","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-man/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-man/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-man/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkjs","download_url":"https://codeload.github.com/remarkjs/remark-man/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-man/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259152795,"owners_count":22813227,"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":["groff","man","markdown","remark","remark-plugin","roff"],"created_at":"2024-08-03T19:00:32.864Z","updated_at":"2025-12-12T03:57:59.422Z","avatar_url":"https://github.com/remarkjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":["JavaScript","Plugins"],"sub_categories":[],"readme":"# remark-man\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n**[remark][]** plugin to turn markdown to man pages.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`unified().use(remarkMan[, options])`](#unifieduseremarkman-options)\n    *   [`Options`](#options)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([remark][]) plugin that compiles markdown\n(mdast) to roff/groff/troff (the format used for man pages).\n\nIt adds a compiler for unified that turns the final markdown (mdast) syntax\ntree into roff/groff/troff (the format used for man pages).\n\n## When should I use this?\n\nUse this when you know a bit about remark and ASTs and need mang pages.\nThis plugin combined with remark is quite good at turning markdown into man\npages.\nIt has good unicode support, proper support for nested lists and block quotes,\nsupports tables, and more.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install remark-man\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport remarkMan from 'https://esm.sh/remark-man@9'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import remarkMan from 'https://esm.sh/remark-man@9?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\nSay we have the following file `example.md`:\n\n```markdown\n# ls(1) -- list directory contents\n\n## SYNOPSIS\n\n`ls` \\[`-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1`] \\[*file* *...*]\n```\n\n…and a module `example.js`:\n\n```js\nimport remarkMan from 'remark-man'\nimport remarkParse from 'remark-parse'\nimport {read, write} from 'to-vfile'\nimport {unified} from 'unified'\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkMan)\n  .process(await read('example.md'))\n\nfile.extname = '.1'\nawait write(file)\n```\n\n…then running `node example.js` generates an `example.1` file, which contains:\n\n```roff\n.TH \"LS\" \"1\" \"September 2023\" \"\" \"\"\n.SH \"NAME\"\n\\fBls\\fR - list directory contents\n.SH \"SYNOPSIS\"\n.P\n\\fBls\\fR \\[lB]\\fB-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1\\fR\\[rB] \\[lB]\\fIfile\\fR \\fI...\\fR\\[rB]\n```\n\nRunning `man ./example.1` opens that in a manual viewer, which interprets it.\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`remarkMan`][api-remark-man].\n\n### `unified().use(remarkMan[, options])`\n\nTurn markdown into a man page.\n\n###### Parameters\n\n*   `options` ([`Options`][api-options], optional)\n    — configuration\n\n###### Returns\n\nTransform ([`Transformer`][unified-transformer]).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n*   `date` (`Date | number | string`, default: `new Date()`)\n    — date of page;\n    given to `new Date(x)`;\n    dates are centered in the footer line of the displayed page\n*   `description` (`string`, optional)\n    — description of page;\n    inferried from the main heading: `# hello-world(7) -- Two common words`\n    defaults to `'Two common words'`\n*   `manual` (`string`, optional)\n    — manual of page;\n    manuals are centered in the header line of the displayed page\n*   `name` (`string`, optional)\n    — title of the page;\n    inferried from the main heading (`# hello-world(7)` defaults to\n    `'hello-world'`) or the file name (`hello-world.1.md` defaults to\n    `'hello-world'`)\n*   `section` (`number`, optional)\n    — [manual section][wiki-man-section] of page;\n    inferred from the main heading (`# hello-world(7)` defaults to `7`) or the\n    file name (`hello-world.1.md` defaults to `1`)\n*   `version` (`string`, optional)\n    — version of page;\n    versions are positioned at the left of the footer line of the displayed\n    page\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Options`][api-options].\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `remark-man@^9`, compatible\nwith Node.js 16.\n\nThis plugin works with `unified` version 11+ and `remark` version 15+.\n\n## Security\n\nUse of `remark-man` does not involve **[rehype][]** (**[hast][]**) or user\ncontent so there are no openings for [cross-site scripting (XSS)][wiki-xss]\nattacks.\n\n## Related\n\n*   [`remark-rehype`](https://github.com/remarkjs/remark-rehype)\n    — turn markdown into HTML to support rehype\n*   [`remark-stringify`](https://github.com/remarkjs/remark/tree/main/packages/remark-stringify)\n    — compile markdown\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/remarkjs/remark-man/workflows/main/badge.svg\n\n[build]: https://github.com/remarkjs/remark-man/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-man.svg\n\n[coverage]: https://codecov.io/github/remarkjs/remark-man\n\n[downloads-badge]: https://img.shields.io/npm/dm/remark-man.svg\n\n[downloads]: https://www.npmjs.com/package/remark-man\n\n[size-badge]: https://img.shields.io/bundlejs/size/remark-man\n\n[size]: https://bundlejs.com/?q=remark-man\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/remarkjs/remark/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[health]: https://github.com/remarkjs/.github\n\n[contributing]: https://github.com/remarkjs/.github/blob/HEAD/contributing.md\n\n[support]: https://github.com/remarkjs/.github/blob/HEAD/support.md\n\n[coc]: https://github.com/remarkjs/.github/blob/HEAD/code-of-conduct.md\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[hast]: https://github.com/syntax-tree/hast\n\n[rehype]: https://github.com/rehypejs/rehype\n\n[remark]: https://github.com/remarkjs/remark\n\n[unified]: https://github.com/unifiedjs/unified\n\n[unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[wiki-man-section]: https://en.wikipedia.org/wiki/Man_page#Manual_sections\n\n[wiki-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[typescript]: https://www.typescriptlang.org\n\n[api-options]: #options\n\n[api-remark-man]: #unifieduseremarkman-options\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-man","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkjs%2Fremark-man","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-man/lists"}