{"id":26045813,"url":"https://github.com/seikichi/restructured","last_synced_at":"2025-04-10T11:43:24.596Z","repository":{"id":57355133,"uuid":"48904862","full_name":"seikichi/restructured","owner":"seikichi","description":"Pure JavaScript reStructuredText parser","archived":false,"fork":false,"pushed_at":"2019-03-30T23:51:18.000Z","size":1051,"stargazers_count":62,"open_issues_count":8,"forks_count":16,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-24T10:38:50.963Z","etag":null,"topics":["javascript","restructuredtext","restructuredtext-parser"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/seikichi.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}},"created_at":"2016-01-02T09:25:59.000Z","updated_at":"2025-02-11T13:10:44.000Z","dependencies_parsed_at":"2022-08-28T13:21:26.247Z","dependency_job_id":null,"html_url":"https://github.com/seikichi/restructured","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seikichi%2Frestructured","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seikichi%2Frestructured/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seikichi%2Frestructured/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seikichi%2Frestructured/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seikichi","download_url":"https://codeload.github.com/seikichi/restructured/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248212173,"owners_count":21065914,"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":["javascript","restructuredtext","restructuredtext-parser"],"created_at":"2025-03-07T20:48:21.107Z","updated_at":"2025-04-10T11:43:24.575Z","avatar_url":"https://github.com/seikichi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# restructured\n\n[![NPM](https://nodei.co/npm/restructured.svg?mini=true)](https://npmjs.org/package/restructured)\n[![Build Status](https://travis-ci.org/seikichi/restructured.svg?branch=master)](https://travis-ci.org/seikichi/restructured)\n\nA reStructuredText parser for JavaScript.\n\n## Online Demo\n\n[demo](https://seikichi.github.io/restructured/).\n\n## Example\n\n```bash\n\u003e npm install -g restructured\n\u003e echo 'Hello, world' | restructured | jq\n{\n  \"type\": \"document\",\n  \"children\": [\n    {\n      \"type\": \"paragraph\",\n      \"children\": [\n        {\n          \"type\": \"text\",\n          \"value\": \"Hello, world\\n\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nConsider the following script.\n\n```javascript\nimport restructured from 'restructured';\n\nconst parsed = restructured.parse(`\n=====\nTitle\n=====\n\nSubtitle\n--------\n\nThis is a paragraph.\n\n- This is item 1\n- This is item 2\n`);\n\nconsole.log(JSON.stringify(parsed));\n```\n\nThe above script outputs the following JSON.\n\n```json\n{\n  \"type\": \"document\",\n  \"children\": [\n    {\n      \"type\": \"section\",\n      \"depth\": 1,\n      \"children\": [\n        {\n          \"type\": \"title\",\n          \"children\": [\n            {\n              \"type\": \"text\",\n              \"value\": \"Title\"\n            }\n          ]\n        },\n        {\n          \"type\": \"section\",\n          \"depth\": 2,\n          \"children\": [\n            {\n              \"type\": \"title\",\n              \"children\": [\n                {\n                  \"type\": \"text\",\n                  \"value\": \"Subtitle\"\n                }\n              ]\n            },\n            {\n              \"type\": \"paragraph\",\n              \"children\": [\n                {\n                  \"type\": \"text\",\n                  \"value\": \"This is a paragraph.\\n\"\n                }\n              ]\n            },\n            {\n              \"type\": \"bullet_list\",\n              \"bullet\": \"-\",\n              \"children\": [\n                {\n                  \"type\": \"list_item\",\n                  \"children\": [\n                    {\n                      \"type\": \"paragraph\",\n                      \"children\": [\n                        {\n                          \"type\": \"text\",\n                          \"value\": \"This is item 1\\n\"\n                        }\n                      ]\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"list_item\",\n                  \"children\": [\n                    {\n                      \"type\": \"paragraph\",\n                      \"children\": [\n                        {\n                          \"type\": \"text\",\n                          \"value\": \"This is item 2\\n\"\n                        }\n                      ]\n                    }\n                  ]\n                }\n              ]\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n\n```\n\n## Progress\n\n- [x] Document Structure\n  - [x] Document\n  - [x] Sections\n  - [x] Transitions\n- [ ] Body Elements\n  - [x] Paragraphs\n  - [x] Bullet Lists\n  - [x] Enumerated Lists\n  - [x] Definition Lists\n  - [ ] Field Lists\n    - [ ] Bibliographic Fields\n    - [ ] RCS Keywords\n  - [ ] Option Lists\n  - [x] Literal Blocks\n    - [x] Indented Literal Blocks\n    - [x] Quoted Literal Blocks\n  - [ ] Line Blocks\n  - [x] Block Quotes\n  - [ ] Doctest Blocks\n  - [ ] Tables\n    - [ ] Grid Tables\n    - [ ] Simple Tables\n    - [ ] List tables\n    - [ ] CSV tables\n  - [ ] Explicit Markup Blocks\n    - [ ] Footnotes\n      - [ ] Auto-Numbered Footnotes\n      - [ ] Auto-Symbol Footnotes\n      - [ ] Mixed Manual and Auto-Numbered Footnotes\n    - [ ] Citations\n    - [ ] Hyperlink Targets\n      - [ ] Anonymous Hyperlinks\n    - [ ] Directives\n    - [ ] Substitution Definitions\n    - [x] Comments\n- [ ] Implicit Hyperlink Targets\n- [ ] Inline Markup\n  - [x] Emphasis\n  - [x] Strong Emphasis\n  - [ ] Interpreted Text\n  - [x] Inline Literals\n  - [ ] Hyperlink References\n    - [ ] Embedded URIs and Aliases\n  - [ ] Inline Internal Targets\n  - [ ] Footnote References\n  - [ ] Citation References\n  - [ ] Substitution References\n  - [ ] Standalone Hyperlinks\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseikichi%2Frestructured","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseikichi%2Frestructured","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseikichi%2Frestructured/lists"}