{"id":13929609,"url":"https://github.com/younata/mdbook-chapter-path","last_synced_at":"2025-03-14T03:12:29.140Z","repository":{"id":57637501,"uuid":"372027714","full_name":"younata/mdbook-chapter-path","owner":"younata","description":"mdbook preprocessor to provide paths to chapters.","archived":false,"fork":false,"pushed_at":"2021-05-30T02:28:38.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-28T09:20:08.472Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/younata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-29T17:03:49.000Z","updated_at":"2021-08-10T15:11:39.000Z","dependencies_parsed_at":"2022-09-02T03:20:56.018Z","dependency_job_id":null,"html_url":"https://github.com/younata/mdbook-chapter-path","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younata%2Fmdbook-chapter-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younata%2Fmdbook-chapter-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younata%2Fmdbook-chapter-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younata%2Fmdbook-chapter-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/younata","download_url":"https://codeload.github.com/younata/mdbook-chapter-path/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243515567,"owners_count":20303258,"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":[],"created_at":"2024-08-07T18:02:26.694Z","updated_at":"2025-03-14T03:12:29.115Z","avatar_url":"https://github.com/younata.png","language":"Rust","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# mdbook-chapter-path\n\n[![CI status](https://ci.younata.com/api/v1/pipelines/knowledge/jobs/mdbook-chapter-path/badge)](https://ci.younata.com/teams/main/pipelines/knowledge/jobs/mdbook-chapter-path/)\n[![Latest Version](https://img.shields.io/crates/v/mdbook-chapter-path.svg)](https://crates.io/crates/mdbook-chapter-path)\n\n\n[mdBook](https://github.com/rust-lang/mdbook) preprocessor for providing the path to a chapter based on its name.\n\n## Getting Started\n\nFirst, install the `mdbook-chapter-path` crate\n\n```\ncargo install mdbook-chapter-path\n```\n\nThen, add the following line to your `book.toml` file:\n\n```toml\n[preprocessor.chapter-path]\n```\n\nOnce done, you can now use `{{#path_for $NAME_OF_CHAPTER}}` to insert the path (relative to `SUMMARY.md`) to that chapter.\n\nE.g. If you have a chapter named \"Whatever\" located at \"foo/whatever.md\", the markdown `{{#path_for Whatever}}` will replace that with `/foo/whatever.md`.\n\nThis even works for anchor links, e.g. `{{#path_for Whatever#an_anchor}}` will replace that with `/foo/whatever.md#an_anchor`.\n\nThis is useful because it means the link will survive moving files around.\n\n## Configuration\n\n`mdbook-chapter-path` will use whatever is listed in `output.html.site-url` as the base path for all links, defaulting to '/'.\n\nAdditionally, you can enable `strict` mode. If this is set to `true`, `mdbook-chapter-path` will exit with an error whenever it encounters a duplicate chapter name. This defaults to `false`, meaning that duplicate chapter names are allowed.\n\n⚠️ Without strict mode enabled, if you have multiple chapters with the same name (case-insensitive), then `mdbook-chapter-path` will provide the path for whichever chapter is listed last in the book.\n\n```toml\n[preprocessor.chapter-path]\nstrict = true\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyounata%2Fmdbook-chapter-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyounata%2Fmdbook-chapter-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyounata%2Fmdbook-chapter-path/lists"}