{"id":18961634,"url":"https://github.com/trialanderrororg/reoff-markup-to-style","last_synced_at":"2026-02-13T11:32:47.338Z","repository":{"id":196149987,"uuid":"620003930","full_name":"TrialAndErrorOrg/reoff-markup-to-style","owner":"TrialAndErrorOrg","description":"Plugin for `reoff` that is able to change the styles of paragraphs based on the markup of the underlying text","archived":false,"fork":false,"pushed_at":"2024-06-28T18:53:45.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T07:27:09.795Z","etag":null,"topics":["abstract","ast","syntax","tree","unified"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TrialAndErrorOrg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-03-27T20:54:39.000Z","updated_at":"2023-03-29T19:56:26.000Z","dependencies_parsed_at":"2023-09-21T16:33:32.951Z","dependency_job_id":"7aad6974-0af4-4658-afaa-eb28cc2f2171","html_url":"https://github.com/TrialAndErrorOrg/reoff-markup-to-style","commit_stats":null,"previous_names":["trialanderrororg/reoff-markup-to-style"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/TrialAndErrorOrg/reoff-markup-to-style","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrialAndErrorOrg%2Freoff-markup-to-style","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrialAndErrorOrg%2Freoff-markup-to-style/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrialAndErrorOrg%2Freoff-markup-to-style/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrialAndErrorOrg%2Freoff-markup-to-style/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrialAndErrorOrg","download_url":"https://codeload.github.com/TrialAndErrorOrg/reoff-markup-to-style/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrialAndErrorOrg%2Freoff-markup-to-style/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273566728,"owners_count":25128629,"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-09-04T02:00:08.968Z","response_time":61,"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":["abstract","ast","syntax","tree","unified"],"created_at":"2024-11-08T14:13:49.118Z","updated_at":"2026-02-13T11:32:47.309Z","avatar_url":"https://github.com/TrialAndErrorOrg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Note**\n\u003e This repository is automatically generated from the [main parser monorepo](https://github.com/TrialAndErrorOrg/parsers). Please submit any issues or pull requests there.\n\n# reoff-markup-to-style\n\nPlugin for `reoff` that is able to change the styles of paragraphs based on the markup of the underlying text\n\n## Contents\n\n- [reoff-markup-to-style](#reoff-markup-to-style)\n  - [Contents](#contents)\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    - [`default()`](#default)\n      - [Example](#example)\n      - [Signature](#signature)\n      - [Parameters](#parameters)\n      - [Returns](#returns)\n    - [`Options`](#options)\n      - [Example](#example-1)\n  - [Syntax tree](#syntax-tree)\n  - [Security](#security)\n  - [Related](#related)\n  - [Contribute](#contribute)\n  - [License](#license)\n\n## What is this?\n\nA plugin for `reoff` for finding paragraphs that have a certain markup in a `docx` document and changing their style to a different style.\n\n## When should I use this?\n\nIf you want to change the style of paragraphs based on the markup of the underlying text.\n\nIf you want to change the style of paragraphs based on the markup of the underlying text, but are handling the `[ooxast][ooxast]` syntax tree yourself, use [ooxast-util-markup-to-style](https://github.com/TrialAndErrorOrg/ooxast-util-markup-to-style)\n\n## Install\n\nThis package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install as\n\n```bash\npnpm add reoff-markup-to-style\n# or with yarn\n# yarn add reoff-markup-to-style\n# or with npm\n# npm install reoff-markup-to-style\n```\n\n## Use\n\n## API\n\n---\n\n### `default()`\n\n`reoff` plugin for inferring paragraph styles from the markup of the underlying text.\n\nBy default, this plugin will infer the following styles:\n\n- `w:b` -\u003e `Heading 1`\n- `w:i` -\u003e `Heading 2`\n\nThis plugin can be configured to infer other styles as well.\n\n#### Example\n\n```ts\nconst options: Options = [\n  // find all paragraphs that are bold and larger than 24pt and make it a Title\n  {\n    markup: (rPr) =\u003e rPr['w:b'] \u0026\u0026 rPr['w:sz'] \u0026\u0026 rPr['w:sz']['w:val'] \u003e 24,\n    style: 'Title',\n  },\n  // find all paragraphs that are strikethrough text and make it a Comment\n  {\n    markup: 'w:strike',\n    style: 'Comment',\n  },\n]\n```\n\n#### Signature\n\n```ts\ndefault(options: Options = ...): ReturnType\u003cPlugin\u003c[Options?] | void[], Root, Root\u003e\u003e;\n```\n\n#### Parameters\n\n| Name      | Type                            | Description     |\n| :-------- | :------------------------------ | :-------------- |\n| `options` | [`Options`](modules.md#options) | Plugin options. |\n\n#### Returns\n\n`ReturnType`\u003c`Plugin`\u003c[`Options?`] | `void`[], `Root`, `Root`\u003e\u003e\n\nA reoff plugin.\n\nDefined in: reoff/reoff-markup-to-style/src/lib/reoff-markup-to-style.ts:35\n\n---\n\n### `Options`\n\n\u003e `Option`[]\n\n#### Example\n\n```ts\nconst options: Options = [\n  // find all paragraphs that are bold and larger than 24pt and make it a Title\n  {\n    markup: (rPr) =\u003e rPr['w:b'] \u0026\u0026 rPr['w:sz'] \u0026\u0026 rPr['w:sz']['w:val'] \u003e 24,\n    style: 'Title',\n  },\n  // find all paragraphs that are strikethrough text and make it a Comment\n  {\n    markup: 'w:strike',\n    style: 'Comment',\n  },\n]\n```\n\nDefined in: [ooxast/ooxast-util-markup-to-style/src/lib/ooxast-util-markup-to-style.ts:80](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/ooxast/ooxast-util-markup-to-style/src/lib/ooxast-util-markup-to-style.ts#L80)\n\n## Syntax tree\n\nUses the `[ooxast][ooxast]` syntax tree.\n\n## Security\n\n## Related\n\n- [ooxast-util-markup-to-style](https://github.com/TrialAndErrorOrg/ooxast-util-markup-to-style)\n\n## Contribute\n\n## License\n\n[GPL-3.0-or-later](LICENSE) © Thomas F. K. Jorna\n\n[unified]: https://unifiedjs.com\n[unifiedgh]: https://github.com/unifiedjs/unified\n[xast-from-xml]: https://github.com/syntax-tree/xast-util-from-xml\n[rehype]: https://github.com/rehypejs/rehype\n[rejour]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour\n[rejour-parse]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/rejour-parse\n[rejour-stringify]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/rejour-stringify\n[rejour-move-abstract]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/rejour-move-abstract\n[rejour-meta]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/rejour-meta\n[rejour-relatex]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/rejour-relatex\n[relatex]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/relatex\n[relatex-parse]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/relatex/relatex-parse\n[jast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/jast\n[jast-util-to-texast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/jast-util-to-texast\n[jastscript]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/jastscript\n[texast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/relatex/texast\n[texast-util-to-latex]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/relatex/texast-util-to-latex\n[hast]: https://github.com/syntax-tree/hast\n[xast]: https://github.com/syntax-tree/xast\n[mdast]: https://github.com/syntax-tree/mdast\n[mdast-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown\n[latex-utensils]: https://github.com/tamuratak/latex-utensils\n[latexjs]: https://github.com/latexjs/latexjs\n[reoff]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/reoff\n[reoff-parse]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/reoff/reoff-parse\n[reoff-rejour]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/reoff/reoff-rejour\n[ooxast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/ooxast/ooxast\n[ooxast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/ooxast/ooxast-util-to-jast\n[reoff-markup-to-style]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/reoff-markup-to-style\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrialanderrororg%2Freoff-markup-to-style","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrialanderrororg%2Freoff-markup-to-style","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrialanderrororg%2Freoff-markup-to-style/lists"}