{"id":19564485,"url":"https://github.com/dioxuslabs/manganis","last_synced_at":"2025-04-12T20:45:20.763Z","repository":{"id":188310059,"uuid":"677137920","full_name":"DioxusLabs/manganis","owner":"DioxusLabs","description":"An asset system for the Rust ecosystem","archived":false,"fork":false,"pushed_at":"2025-03-18T21:18:49.000Z","size":679,"stargazers_count":59,"open_issues_count":13,"forks_count":13,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-09T18:10:09.813Z","etag":null,"topics":["assets","bundler","rust"],"latest_commit_sha":null,"homepage":"","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/DioxusLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"DioxusLabs","open_collective":"dioxus-labs"}},"created_at":"2023-08-10T20:46:15.000Z","updated_at":"2025-04-04T03:05:38.000Z","dependencies_parsed_at":"2023-08-14T21:36:29.737Z","dependency_job_id":"acf3289e-fb3f-4d3b-892e-ef830b3ebf14","html_url":"https://github.com/DioxusLabs/manganis","commit_stats":null,"previous_names":["demonthos/collect-assets","dioxuslabs/manganis"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DioxusLabs%2Fmanganis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DioxusLabs%2Fmanganis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DioxusLabs%2Fmanganis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DioxusLabs%2Fmanganis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DioxusLabs","download_url":"https://codeload.github.com/DioxusLabs/manganis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631688,"owners_count":21136556,"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":["assets","bundler","rust"],"created_at":"2024-11-11T05:22:13.387Z","updated_at":"2025-04-12T20:45:20.742Z","avatar_url":"https://github.com/DioxusLabs.png","language":"Rust","funding_links":["https://github.com/sponsors/DioxusLabs","https://opencollective.com/dioxus-labs"],"categories":[],"sub_categories":[],"readme":"# Manganis\n\n# ⚠️ **Manganis has moved into the main diouxs repo [here](https://github.com/DioxusLabs/dioxus/tree/main/packages/manganis)**\n\nThe Manganis allows you to submit assets to a build tool that supports collecting assets. It makes it easy to self-host assets that are distributed throughout your library. Manganis also handles optimizing, converting, and fetching assets.\n\nIf you defined this in a component library:\n```rust\nconst AVIF_ASSET: \u0026str = manganis::mg!(\"rustacean-flat-gesture.png\");\n```\n\nAVIF_ASSET will be set to a new file name that will be served by some CLI. That file can be collected by any package that depends on the component library.\n\n```rust\n// You can include tailwind classes that will be collected into the final binary\nconst TAILWIND_CLASSES: \u0026str = manganis::classes!(\"flex flex-col p-5\");\n\n// You can also collect arbitrary files. Relative paths are resolved relative to the package root\nconst _: \u0026str = manganis::mg!(\"test-package-dependency/src/asset.txt\"); \n// You can use URLs to copy read the asset at build time\nconst _: \u0026str = manganis::mg!(\"https://rustacean.net/assets/rustacean-flat-happy.png\");\n\n// You can collect images which will be automatically optimized\npub const PNG_ASSET: manganis::ImageAsset =\n    manganis::mg!(image(\"rustacean-flat-gesture.png\"));\n// Resize the image at compile time to make the assets smaller\npub const RESIZED_PNG_ASSET: manganis::ImageAsset =\n    manganis::mg!(image(\"rustacean-flat-gesture.png\").size(52, 52));\n// Or convert the image at compile time to a web friendly format\npub const AVIF_ASSET: manganis::ImageAsset = manganis::mg!(image(\"rustacean-flat-gesture.png\")\n    .format(ImageType::Avif));\n// You can even include a low quality preview of the image embedded into the url\npub const AVIF_ASSET_LOW: manganis::ImageAsset = manganis::mg!(image(\"rustacean-flat-gesture.png\")\n\t.format(ImageType::Avif)\n\t.low_quality_preview());\n\n// You can also collect google fonts\npub const ROBOTO_FONT: \u0026str = manganis::mg!(font()\n    .families([\"Roboto\"]));\n// Specify weights for fonts to collect\npub const COMFORTAA_FONT: \u0026str = manganis::mg!(font()\n    .families([\"Comfortaa\"])\n    .weights([400]));\n// Or specific text to include only the characters used in that text\npub const ROBOTO_FONT_LIGHT_FONT: \u0026str = manganis::mg!(font()\n    .families([\"Roboto\"])\n    .weights([200])\n    .text(\"hello world\"));\n```\n\n## Adding Support to Your CLI\n\nTo add support for your CLI, you need to integrate with the [manganis_cli_support](https://github.com/DioxusLabs/manganis/tree/main/cli-support) crate. This crate provides utilities to collect assets that integrate with the Manganis macro. It makes it easy to integrate an asset collection and optimization system into a build tool.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdioxuslabs%2Fmanganis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdioxuslabs%2Fmanganis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdioxuslabs%2Fmanganis/lists"}