{"id":16028194,"url":"https://github.com/ewpratten/git2codeblock","last_synced_at":"2025-04-05T04:42:10.156Z","repository":{"id":62439481,"uuid":"399815455","full_name":"ewpratten/git2codeblock","owner":"ewpratten","description":"Turn GitHub and GitLab codesnippet URLs into Markdown codeblocks","archived":false,"fork":false,"pushed_at":"2021-08-25T14:08:49.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T12:47:15.985Z","etag":null,"topics":["code-fetch","codeblock","git-codeblock","markdown","utility"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/git2codeblock","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ewpratten.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}},"created_at":"2021-08-25T12:45:12.000Z","updated_at":"2021-08-25T14:33:51.000Z","dependencies_parsed_at":"2022-11-01T22:01:40.206Z","dependency_job_id":null,"html_url":"https://github.com/ewpratten/git2codeblock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"ewpratten/rust-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewpratten%2Fgit2codeblock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewpratten%2Fgit2codeblock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewpratten%2Fgit2codeblock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewpratten%2Fgit2codeblock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ewpratten","download_url":"https://codeload.github.com/ewpratten/git2codeblock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289394,"owners_count":20914464,"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":["code-fetch","codeblock","git-codeblock","markdown","utility"],"created_at":"2024-10-08T20:41:28.945Z","updated_at":"2025-04-05T04:42:10.128Z","avatar_url":"https://github.com/ewpratten.png","language":"Rust","readme":"# git2codeblock\n[![Crates.io](https://img.shields.io/crates/v/git2codeblock)](https://crates.io/crates/git2codeblock) \n[![Docs.rs](https://docs.rs/git2codeblock/badge.svg)](https://docs.rs/git2codeblock) \n[![Build](https://github.com/Ewpratten/git2codeblock/actions/workflows/build.yml/badge.svg)](https://github.com/Ewpratten/git2codeblock/actions/workflows/build.yml)\n[![Clippy](https://github.com/Ewpratten/git2codeblock/actions/workflows/clippy.yml/badge.svg)](https://github.com/Ewpratten/git2codeblock/actions/workflows/clippy.yml)\n[![Audit](https://github.com/Ewpratten/git2codeblock/actions/workflows/audit.yml/badge.svg)](https://github.com/Ewpratten/git2codeblock/actions/workflows/audit.yml)\n\n\n`git2codeblock` is a crate that converts git URLs into codeblocks. This is mainly for use in one of my Discord bots, but is written to be used anywhere.\n\n## Example\n\nGiven the url: [`https://gitlab.com/ewpratten/DeepSpace/-/blob/master/CODEOWNERS#L2`](https://gitlab.com/ewpratten/DeepSpace/-/blob/master/CODEOWNERS#L2), `git2codeblock` will realize that this is GitLab, correctly process the file, and return a Markdown fenced codeblock.\n\n```rust\nlet url = \"https://gitlab.com/ewpratten/DeepSpace/-/blob/master/CODEOWNERS#L2\";\nlet codeblock = git2codeblock::extract_codeblock(url).await.unwrap();\nassert_eq!(codeblock, \"```\\n*       @ewpratten @slownie @johnlownie @LordMichaelmort @awpratten\\n```\");\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewpratten%2Fgit2codeblock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fewpratten%2Fgit2codeblock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewpratten%2Fgit2codeblock/lists"}