{"id":17026957,"url":"https://github.com/geckoeidechse/mdbook-gitbook","last_synced_at":"2026-01-31T19:01:47.396Z","repository":{"id":220179340,"uuid":"750441000","full_name":"GeckoEidechse/mdbook-gitbook","owner":"GeckoEidechse","description":"mdBook preprocessor to render GitBook specific syntax","archived":false,"fork":false,"pushed_at":"2024-11-01T11:39:41.000Z","size":1400,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T16:41:37.984Z","etag":null,"topics":["gitbook","mdbook","mdbook-preprocessor","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/mdbook-gitbook","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeckoEidechse.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-01-30T16:47:03.000Z","updated_at":"2025-11-22T12:29:46.000Z","dependencies_parsed_at":"2024-02-09T23:24:15.196Z","dependency_job_id":"1cbb4d78-ff62-4bcf-8b0c-7af82675bc4b","html_url":"https://github.com/GeckoEidechse/mdbook-gitbook","commit_stats":null,"previous_names":["geckoeidechse/mdbook-gitbook"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/GeckoEidechse/mdbook-gitbook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeckoEidechse%2Fmdbook-gitbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeckoEidechse%2Fmdbook-gitbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeckoEidechse%2Fmdbook-gitbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeckoEidechse%2Fmdbook-gitbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeckoEidechse","download_url":"https://codeload.github.com/GeckoEidechse/mdbook-gitbook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeckoEidechse%2Fmdbook-gitbook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28950279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["gitbook","mdbook","mdbook-preprocessor","rust"],"created_at":"2024-10-14T07:45:23.354Z","updated_at":"2026-01-31T19:01:47.377Z","avatar_url":"https://github.com/GeckoEidechse.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mdbook-gitbook\n\n[![crates.io](https://img.shields.io/crates/v/mdbook-gitbook.svg)](https://crates.io/crates/mdbook-gitbook)\n[![MPL 2.0 LICENSE](https://img.shields.io/github/license/GeckoEidechse/mdbook-gitbook.svg)](LICENSE)\n[![docs.rs](https://docs.rs/mdbook-gitbook/badge.svg)](https://docs.rs/mdbook-gitbook)\n[![Build](https://github.com/GeckoEidechse/mdbook-gitbook/actions/workflows/build.yml/badge.svg)](https://github.com/GeckoEidechse/mdbook-gitbook/actions/workflows/build.yml)\n[![Test](https://github.com/GeckoEidechse/mdbook-gitbook/actions/workflows/test.yml/badge.svg)](https://github.com/GeckoEidechse/mdbook-gitbook/actions/workflows/test.yml)\n\n[mdBook](https://github.com/rust-lang/mdBook) preprocessor to properly render [GitBook](https://www.gitbook.com/) specific syntax in mdBook.\n\nYou can compare this preprocessor to GitBook by looking at the same sample book on:\n\n- [GitBook](https://mdbook.gitbook.io/mdbook-gitbook/)\n- [mdBook](https://geckoeidechse.github.io/mdbook-gitbook/) (via GitHub pages)\n\nTo see the list of existing and supported syntax, see [this GitHub issue](https://github.com/GeckoEidechse/mdbook-gitbook/issues/1).\n\n\u003e **Note:**\n\u003e\n\u003e This mdBook preprocessor was written for local rendering of the [NorthstarWiki](https://github.com/R2Northstar/NorthstarWiki/) where it covers the majority of the used GitBook-specific syntax.\n\u003e As such I'm not planning to add support for more GitBook widgets etc, however contributions to expand the supported syntax are more than welcome \u003c3\n\u003e\n\u003e Similarly, if you'd like to take over maintainership or ownership of this crate, please get in touch via an issue in the GitHub repo of this crate.\n\n## Usage\n\nFirst, install the preprocessor:\n\n```bash\ncargo install mdbook-gitbook\n```\n\nThen, add the preprocessor to your `book.toml`:\n\n```toml\n[book]\nauthors = [\"Jill Doe\"]\nlanguage = \"en\"\nmultilingual = false\nsrc = \"src\"\ntitle = \"My awesome Book\"\n\n# ADD THIS\n[preprocessor.gitbook]\n\n```\n\n## Development\n\n### How it works\n\nThe way this preprocessor works is primarily by using regexes to search for specific patterns like\n\n```\n{% embed url=\"URL_HERE\" %}\n```\n\nand then replacing it with the corresponding HTML code like\n\n```html\n\u003cdiv style=\"border: 1px solid #ccc; padding: 10px; max-width: 500px; margin: 10px\"\u003e\n  \u003ca href=\"URL_HERE\"\u003e\n    \u003cdiv style=\"display: flex; align-items: center;\"\u003e\n      \u003cdiv style=\"margin-right: 10px;\"\u003e\n        \u003cimg alt=\"\" src=\"{icon_link}\" width=\"100%\" height=\"auto\" decoding=\"async\"\n          style=\"width: 32px; height: 32px; border-radius: 4px;\"\u003e\n      \u003c/div\u003e\n      \u003cdiv style=\"flex-grow: 1;\"\u003e\n        \u003cdiv style=\"font-weight: bold; margin-bottom: 5px;\"\u003e\n          EXTRACTED_PAGE_TITLE\n        \u003c/div\u003e\n        \u003cdiv style=\"color: #666;\"\u003e\n          EXTRACTED_PAGE_NAME\n        \u003c/div\u003e\n      \u003c/div\u003e\n    \u003c/div\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n```\n\n### Expanding the preprocessor\n\nThe currently supported syntax is tracked in [this GitHub issue](https://github.com/GeckoEidechse/mdbook-gitbook/issues/1)\n\nTo add support for some currently unsupported syntax, expand the existing existing main render loop in `lib.rs`\n\n```rust\n/// Apply to all chapters\nfn handle_chapter(chapter: \u0026mut Chapter) -\u003e Result\u003c(), Error\u003e {\n    chapter.content = hints::render(\u0026chapter.content)?;\n    chapter.content = embeds::render(\u0026chapter.content)?;\n    chapter.content = content_refs::render(\u0026chapter.content)?;\n    // Add your additional syntax parsing here\n\n    Ok(())\n}\n```\n\nwith a function that calls the corresponding parsing logic.\n\nIn your parsing logic, use regex or any other methods to scan for the specific pattern of the syntax you want to support and replace it with the corresponding HTML code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeckoeidechse%2Fmdbook-gitbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeckoeidechse%2Fmdbook-gitbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeckoeidechse%2Fmdbook-gitbook/lists"}