{"id":51900383,"url":"https://github.com/drupol/pulldown-cmark-codeblock","last_synced_at":"2026-07-26T14:03:15.182Z","repository":{"id":362301207,"uuid":"1230667340","full_name":"drupol/pulldown-cmark-codeblock","owner":"drupol","description":"A fenced code block extractor for Markdown documents built on pulldown-cmark","archived":false,"fork":false,"pushed_at":"2026-07-01T22:34:27.000Z","size":54,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-02T00:23:14.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drupol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","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},"funding":{"github":"drupol"}},"created_at":"2026-05-06T07:55:10.000Z","updated_at":"2026-07-01T22:34:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/drupol/pulldown-cmark-codeblock","commit_stats":null,"previous_names":["drupol/pulldown-cmark-codeblock"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/drupol/pulldown-cmark-codeblock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fpulldown-cmark-codeblock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fpulldown-cmark-codeblock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fpulldown-cmark-codeblock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fpulldown-cmark-codeblock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drupol","download_url":"https://codeload.github.com/drupol/pulldown-cmark-codeblock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fpulldown-cmark-codeblock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35916664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-26T02:00:06.503Z","response_time":89,"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":[],"created_at":"2026-07-26T14:03:14.303Z","updated_at":"2026-07-26T14:03:15.174Z","avatar_url":"https://github.com/drupol.png","language":"Rust","funding_links":["https://github.com/sponsors/drupol"],"categories":[],"sub_categories":[],"readme":"![GitHub stars][GitHub stars]\n[![Crates.io Version][Crates.io Version]][pulldown-cmark-codeblock crates]\n[![Crates.io License][Crates.io License]][pulldown-cmark-codeblock crates]\n[![Donate!][Donate!]][sponsor link]\n\n# pulldown-cmark-codeblock\n\nExtract Markdown code blocks from Markdown documents parsed with\n[`pulldown-cmark`](https://crates.io/crates/pulldown-cmark).\n\n`pulldown-cmark` already exposes the fenced code block info string through\n`Event::Start(Tag::CodeBlock(CodeBlockKind::Fenced(info_string)))`. This crate\nbuilds on top of that lower-level event stream and returns complete,\nready-to-use code block records.\n\n- fenced or indented block kind\n- language parsed from the first info string word\n- raw info string\n- remaining attributes as a raw string or token iterator\n- code block source text\n- byte range covering the whole block\n- zero-based line range covering the whole block\n- indentation before the opening marker\n\n````rust\nuse pulldown_cmark_codeblock::{code_blocks, CodeBlockKind};\n\nlet markdown = \"# Title\\n\\n```rust runnable key=value\\nfn main() {}\\n```\\n\";\nlet block = code_blocks(markdown).next().unwrap();\n\nassert!(matches!(block.kind, CodeBlockKind::Fenced(_)));\nassert_eq!(block.language.as_deref(), Some(\"rust\"));\nassert_eq!(block.info_string, \"rust runnable key=value\");\nassert_eq!(block.attributes.as_deref(), Some(\"runnable key=value\"));\nassert_eq!(block.attributes().collect::\u003cVec\u003c_\u003e\u003e(), [\"runnable\", \"key=value\"]);\nassert_eq!(block.source, \"fn main() {}\\n\");\nassert_eq!(block.line_range, 2..5);\n````\n\nThe detailed API documentation is written in `src/lib.rs` with crate-level\n`//!` rustdoc comments, so it is generated directly by `cargo doc` and\npublished with the crate documentation.\n\n[GitHub stars]: https://img.shields.io/github/stars/drupol/pulldown-cmark-codeblock.svg?style=flat-square\n[Donate!]: https://img.shields.io/badge/Sponsor-Github-brightgreen.svg?style=flat-square\n[sponsor link]: https://github.com/sponsors/drupol\n[Crates.io License]: https://img.shields.io/crates/l/pulldown-cmark-codeblock?style=flat-square\n[Crates.io Version]: https://img.shields.io/crates/v/pulldown-cmark-codeblock?style=flat-square\n[pulldown-cmark-codeblock crates]: https://crates.io/crates/pulldown-cmark-codeblock\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupol%2Fpulldown-cmark-codeblock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrupol%2Fpulldown-cmark-codeblock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupol%2Fpulldown-cmark-codeblock/lists"}