{"id":32574891,"url":"https://github.com/stormlightlabs/parserst","last_synced_at":"2026-05-17T02:04:51.923Z","repository":{"id":320677779,"uuid":"1082993287","full_name":"stormlightlabs/parserst","owner":"stormlightlabs","description":"reStructuredText parser \u0026 renderer written in Rust","archived":false,"fork":false,"pushed_at":"2025-10-25T06:12:08.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-25T08:15:19.789Z","etag":null,"topics":["markdown","recursive-descent-parser","restructuredtext","rst","rust","serde"],"latest_commit_sha":null,"homepage":"","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/stormlightlabs.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-25T06:00:46.000Z","updated_at":"2025-10-25T06:12:11.000Z","dependencies_parsed_at":"2025-10-25T08:15:22.993Z","dependency_job_id":"d22a5a60-3bc2-47b5-8271-c391ec4b6df7","html_url":"https://github.com/stormlightlabs/parserst","commit_stats":null,"previous_names":["stormlightlabs/parserst"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/stormlightlabs/parserst","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stormlightlabs%2Fparserst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stormlightlabs%2Fparserst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stormlightlabs%2Fparserst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stormlightlabs%2Fparserst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stormlightlabs","download_url":"https://codeload.github.com/stormlightlabs/parserst/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stormlightlabs%2Fparserst/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281617485,"owners_count":26531925,"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-10-29T02:00:06.901Z","response_time":59,"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":["markdown","recursive-descent-parser","restructuredtext","rst","rust","serde"],"created_at":"2025-10-29T11:57:52.894Z","updated_at":"2025-10-29T11:57:57.239Z","avatar_url":"https://github.com/stormlightlabs.png","language":"Rust","funding_links":["https://ko-fi.com/desertthunder"],"categories":[],"sub_categories":[],"readme":"# parseRST\n\nA lightweight, recursive-descent **reStructuredText parser** written in Rust.\n\n## Overview\n\n`parserst` is a small, fast, and self-contained parser for [reStructuredText](https://docutils.sourceforge.io/rst.html) documents.\nIt aims to provide a clean, idiomatic Rust API for converting `.rst` content into structured AST nodes or HTML/Markdown.\n\nThis crate is ideal for:\n\n- Building static site generators, documentation tools, or format converters.\n- Integrating reStructuredText support into note-taking or content-processing apps.\n- Experimenting with parsing techniques and markup language design.\n- Parsing Python [docstrings](https://github.com/stormlightlabs/beacon)\n\n## Features\n\n| Category              | Description                                                                                      |\n| --------------------- | ------------------------------------------------------------------------------------------------ |\n| **Inline parsing**    | Supports `*emphasis*`, `**strong**`, `` `code` ``, and `` `link \u003chttps://...\u003e`_``.               |\n| **Block parsing**     | Detects headings, paragraphs, lists (ordered/unordered), code fences, and quote blocks.          |\n| **Output**            | Render to **HTML** (always available) or **Markdown** (requires `markdown` feature).             |\n| **Serialization**     | Serialize AST to JSON, YAML, or any serde-supported format (requires `serde` feature).           |\n| **AST Access**        | Exposes a clean, typed AST (`Block`, `Inline`, `Field`, `ListKind`) for custom rendering.        |\n| **Error Handling**    | Safe `Result\u003cVec\u003cBlock\u003e, ParseError\u003e` API with detailed line numbers.                            |\n| **Minimal deps**      | No external parser frameworks or macros; all features are optional and can be enabled as needed. |\n\n## Installation\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\nparserst = \"0.1\"\n\n# With markdown support\nparserst = { version = \"0.1\", features = [\"markdown\"] }\n\n# With serde serialization support\nparserst = { version = \"0.1\", features = [\"serde\"] }\n\n# With all features\nparserst = { version = \"0.1\", features = [\"markdown\", \"serde\"] }\n```\n\n## Example\n\n```rust\nuse parserst::html_of;\n\nfn main() {\n    let rst = r#\"\nHeading\n=======\n\nThis is *emphasized*, **bold**, and ``inline code``.\n\n- Item 1\n- Item 2\n\"#;\n\n    let html = html_of(rst);\n    println!(\"{}\", html);\n}\n```\n\n**Output:**\n\n```html\n\u003ch1\u003eHeading\u003c/h1\u003e\n\u003cp\u003e\n    This is \u003cem\u003eemphasized\u003c/em\u003e, \u003cstrong\u003ebold\u003c/strong\u003e, and\n    \u003ccode\u003einline code\u003c/code\u003e.\n\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eItem 1\u003c/li\u003e\n    \u003cli\u003eItem 2\u003c/li\u003e\n\u003c/ul\u003e\n```\n\nThe AST can be serialized to any format supported by serde: JSON, YAML, TOML, MessagePack, etc.\n\n## Design\n\n- **Recursive Descent** — every rule is expressed in idiomatic Rust, not macros.\n- **Predictable** — prioritizes correctness over complete reStructuredText parity.\n- **Composabe** — easy to extend or replace the renderer layer (e.g., to JSON, Markdown, or AST tools).\n- **No Unsafe** — guaranteed safe Rust implementation.\n\n## Tests \u0026 Builds\n\n```bash\ncargo test\n```\n\nTest with specific feature configurations:\n\n```bash\n# Without any features\ncargo test --no-default-features\ncargo build --no-default-features # or cargo build\n\n# With markdown\ncargo test --features markdown\ncargo build --features markdown\n\n# With serde\ncargo test --features serde\ncargo build --features serde\n\n# All features\ncargo test --all-features\ncargo build --release --all-features\n```\n\nUsing `just` (if you have [just](https://github.com/casey/just) installed):\n\n```bash\n# View all recipes\njust -l\n```\n\n## API Overview\n\n| Function                   | Description                                                             |\n| -------------------------- | ----------------------------------------------------------------------- |\n| `parse(input: \u0026str)`       | Parses `.rst` text into a `Vec\u003cBlock\u003e` AST.                             |\n| `html_of(input: \u0026str)`     | Parses and renders the input as HTML.                                   |\n| `markdown_of(input: \u0026str)` | Parses and renders the input as Markdown (requires `markdown` feature). |\n\n### Types\n\n| Item         | Description                                                                             |\n| ------------ | --------------------------------------------------------------------------------------- |\n| `Block`      | Top-level AST nodes such as headings, paragraphs, directives, field lists, tables, etc. |\n| `Inline`     | Inline nodes nested inside `Block` variants (text, emphasis, strong, code, links)       |\n| `Field`      | A field entry within a field list (e.g., `:param x: description`)                       |\n| `ListKind`   | Enum describing list flavor (`Ordered` or `Unordered`) for `Block::List`                |\n\n## License\n\nSee [MIT License](./LICENSE) or learn [more here](https://opensource.org/license/mit)\n\n---\n\nMade with ⚡️ by Stormlight Labs.\n\nStormlight Labs is just me, [Owais](https://github.com/desertthunder). Support my work on [Ko-fi](https://ko-fi.com/desertthunder).\n\n[![Brainmade](https://brainmade.org/88x31-dark.png)](https://brainmade.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstormlightlabs%2Fparserst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstormlightlabs%2Fparserst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstormlightlabs%2Fparserst/lists"}