{"id":21985595,"url":"https://github.com/ickshonpe/marked-commands","last_synced_at":"2026-05-09T02:34:36.545Z","repository":{"id":107186622,"uuid":"456515415","full_name":"ickshonpe/marked-commands","owner":"ickshonpe","description":"A macro for Bevy that generates extension traits that add marker components to entities when spawned.","archived":false,"fork":false,"pushed_at":"2022-02-07T13:57:19.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-23T10:51:02.550Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ickshonpe.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}},"created_at":"2022-02-07T13:24:08.000Z","updated_at":"2022-02-07T13:57:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a3dd1c3-d928-495a-9b31-003803eb1d42","html_url":"https://github.com/ickshonpe/marked-commands","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ickshonpe/marked-commands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickshonpe%2Fmarked-commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickshonpe%2Fmarked-commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickshonpe%2Fmarked-commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickshonpe%2Fmarked-commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ickshonpe","download_url":"https://codeload.github.com/ickshonpe/marked-commands/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickshonpe%2Fmarked-commands/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272793018,"owners_count":24993830,"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-08-30T02:00:09.474Z","response_time":77,"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":"2024-11-29T18:14:07.335Z","updated_at":"2026-05-09T02:34:31.504Z","avatar_url":"https://github.com/ickshonpe.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Marked Commands\n\nGenerates an extension trait that implements the methods \n`marked` and `marked_bundle` (and some other ones) equivalent to\n`spawn` and `spawn_bundle` except the new entities will also contain\nthe marker components passed to the macro.\nThe marker components must implement `Default`.\n\n## usage example\n\n```rust\nmarked_commands!((UIElementMarker,));\n\npub fn spawn_text_box(\n    mut commands: Commands,\n    asset_server: Res\u003cAssetServer\u003e,\n) {\n \n    commands.marked_bundle(NodeBundle {\n        style: Style {\n            position_type: PositionType::Absolute,\n            position: Rect { left: Val::Px(100.0), bottom: Val::Px(100.0), ..Default::default() },\n            padding: Rect::all(Val::Px(2.0)),\n            ..Default::default()\n        },\n        ..Default::default()\n    })\n    .with_children(|builder| {\n        builder.marked_bundle(NodeBundle {\n                color: UiColor (Color::DARK_GRAY),\n                style: Style {\n                    padding: Rect::all(Val::Px(4.0)),\n                    ..Default::default()\n                },\n                ..Default::default()\n            }\n        )\n        .with_children(|builder| {\n            builder.marked_bundle(TextBundle {\n                text: Text::with_section(\n                    \"Hello, world!\",\n                    TextStyle {\n                        font: asset_server.load(\"FiraMono-Regular.ttf\"),\n                        font_size: 16.0,\n                        color: Color::ANTIQUE_WHITE,\n                    },\n                    TextAlignment::default()\n                ),\n                 ..Default::default()\n            });\n        });\n    });\n}\n\npub fn despawn_text_box(\n    mut commands: Commands,\n    query: Query\u003cEntity, With\u003cUIElementMarker\u003e\u003e\n) {\n    query.for_each(|entity|\n        commands.entity(entity).despawn();\n    );\n}\n```\n## Info\n\n* Takes a bundle, so you can add as many marker components as you like! 100, why not.\n* I wouldn't use this (because it's a macro).\n* The example is bad. You only need to mark the root `NodeBundle` and then call `despawn_recursive`. \nBut then do you really need the macro if you are only marking the root.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fickshonpe%2Fmarked-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fickshonpe%2Fmarked-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fickshonpe%2Fmarked-commands/lists"}