{"id":16631079,"url":"https://github.com/mehedimi/shortcode-parser","last_synced_at":"2025-03-11T19:23:05.305Z","repository":{"id":160802377,"uuid":"625582956","full_name":"mehedimi/shortcode-parser","owner":"mehedimi","description":"WordPress  flavored shortcode parser written in rust","archived":false,"fork":false,"pushed_at":"2023-05-21T23:38:55.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-18T06:28:53.712Z","etag":null,"topics":["rust","shortcode","wp","wp-shorcode"],"latest_commit_sha":null,"homepage":"https://github.com/mehedimi/shortcode-parser","language":"Rust","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/mehedimi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-09T15:04:48.000Z","updated_at":"2023-05-21T23:40:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3fd28ed-5adf-4c49-a984-28494d2ab597","html_url":"https://github.com/mehedimi/shortcode-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehedimi%2Fshortcode-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehedimi%2Fshortcode-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehedimi%2Fshortcode-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehedimi%2Fshortcode-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehedimi","download_url":"https://codeload.github.com/mehedimi/shortcode-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243096356,"owners_count":20235644,"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":["rust","shortcode","wp","wp-shorcode"],"created_at":"2024-10-12T04:50:52.382Z","updated_at":"2025-03-11T19:23:05.284Z","avatar_url":"https://github.com/mehedimi.png","language":"Rust","readme":"# Shortcode Parser\nWordPress flavored shortcode parser written in rust.\n\u003e NB: Currently this crate is not for production use. \n\u003e If you need to experiment with this, feel free use as local crate.\n\n### Installation\n```toml\n[dependencies]\nshortcode_parser = { path = \"PATH_OF_THE_CRATE\" }\n```\n\nor\n\n```toml\n[dependencies]\nshortcode_parser = { git = \"https://github.com/mehedimi/shortcode-parser\", branch = \"main\" }\n```\n\n\n### Example\nHere is a simple `[audio]` shortcode parsed into html.\n\n```rust\nuse shortcode_parser::Shortcode;\n\nfn main() {\n    let mut shortcode = Shortcode::new();\n\n    shortcode.add(\"audio\", |_content, attrs| {\n        let tag_attrs = attrs\n            .unwrap()\n            .iter()\n            .map(|attr| {\n                return format!(\"{}=\\\"{}\\\"\", attr.0, attr.1);\n            })\n            .collect::\u003cVec\u003c_\u003e\u003e()\n            .join(\" \");\n\n        return format!(\"\u003caudio {}\u003e\u003c/audio\u003e\", tag_attrs);\n    });\n\n    let content = \"This is a [audio class=\\\"audio\\\"] tag\";\n\n    shortcode.render(content.to_string());\n    // Output: This is a \u003caudio class=\"audio\"\u003e\u003c/audio\u003e tag\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehedimi%2Fshortcode-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehedimi%2Fshortcode-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehedimi%2Fshortcode-parser/lists"}