{"id":16178457,"url":"https://github.com/spielcrypto/yew_prism","last_synced_at":"2025-03-19T01:30:48.805Z","repository":{"id":38334268,"uuid":"256354205","full_name":"spielcrypto/yew_prism","owner":"spielcrypto","description":"highlighter code component based in Prism","archived":false,"fork":false,"pushed_at":"2023-03-04T12:45:01.000Z","size":855,"stargazers_count":9,"open_issues_count":16,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-10T19:58:44.451Z","etag":null,"topics":["codehighlight","rustwasm","yew"],"latest_commit_sha":null,"homepage":"https://docs.rs/crate/yew_prism","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/spielcrypto.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":null,"security":null,"support":null,"governance":null},"funding":{"github":"dancespiele","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-04-16T23:38:02.000Z","updated_at":"2025-03-10T17:02:30.000Z","dependencies_parsed_at":"2023-07-14T09:04:54.483Z","dependency_job_id":null,"html_url":"https://github.com/spielcrypto/yew_prism","commit_stats":null,"previous_names":["spielrs/yew_prism","spielcrypto/yew_prism"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spielcrypto%2Fyew_prism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spielcrypto%2Fyew_prism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spielcrypto%2Fyew_prism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spielcrypto%2Fyew_prism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spielcrypto","download_url":"https://codeload.github.com/spielcrypto/yew_prism/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243958060,"owners_count":20374788,"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":["codehighlight","rustwasm","yew"],"created_at":"2024-10-10T05:13:47.726Z","updated_at":"2025-03-19T01:30:48.496Z","avatar_url":"https://github.com/spielcrypto.png","language":"Rust","funding_links":["https://github.com/sponsors/dancespiele"],"categories":[],"sub_categories":[],"readme":"# `Yew Prism`\n\nYew Prism is a highlighter code component based in [Prism](https://prismjs.com) for [yew](https://yew.rs)\n\n## How it works\n\n1. Install the `prismjs` node module\n\n    `npm install prismjs`\n\n2. Import the prismjs module and styles, and all the languages component which you want to use for highlighting,\nin your javascript/typescript main file yew project\n\n```typescript\nimport 'prismjs/themes/prism.css';\nimport 'prismjs';\nimport 'prismjs/components/prism-markup';\nimport 'prismjs/components/prism-rust';\nimport module from '../crate/Cargo.toml';\n\nmodule.run();\n```\n\n**Note:** You can use [yew-parcel-template](https://github.com/spielrs/yew-parcel-template) or another template described\n[here](https://yew.rs/docs/getting-started/starter-templates) to create a yew project\n\n3. Add yew_prism in your cargo.toml\n\n```toml\n[dependencies]\nyew = { version = \"0.17\", features = [\"web_sys\"]}\nyew_prism=\"0.4\"\n```\n\n4. Now you are ready to use the component \u0026#128640;\n\n## Example\n\n```rust\nuse yew::prelude::*;\nuse yew_prism::Prism;\n\npub struct App;\nimpl Component for App {\n    type Message = ();\n    type Properties = ();\n\n    fn create(_: Self::Properties, _: ComponentLink\u003cSelf\u003e) -\u003e Self {\n        App {}\n    }\n\n    fn update(\u0026mut self, _: Self::Message) -\u003e ShouldRender {\n        false\n    }\n\n    fn change(\u0026mut self, _props: Self::Properties) -\u003e ShouldRender {\n        false\n    }\n\n    fn view(\u0026self) -\u003e Html {\n        html! {\n            \u003cPrism\n                code=\"let greeting: \u0026str = \\\"Hello World\\\";\"\n                language=\"rust\"\n            /\u003e\n        }\n    }\n}\n\n```\n\n## Run documentation page\n\n1. `git clone https://github.com/spielrs/yew_prism.git`\n3. `cd yew_prism`\n4. `npm install` \n5. `npm start`\n\n## License\n\nYew Prism is MIT licensed. See [license](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspielcrypto%2Fyew_prism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspielcrypto%2Fyew_prism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspielcrypto%2Fyew_prism/lists"}