-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/suggest an edit link #1506
Conversation
Includes new configuration option `git-repository-edit-baseurl` for supporting non-GitHub repository layouts.
…dependent of git_repository_url.
The `IndexPreprocessor` rewrites the path for files named `README.md` to be `index.md`. This breaks the edit link in some circumstances. To address this issues, the `Chapter` struct has now a new attribute called `source_path`. This is initialized with the same value as `path`, but is never ever changed. Finally, the edit link is built by using the `source_path` rather than the `path`.
Add a working example of the edit links feature to the examples
Add "edit" links to the pages of mdbook own book
ping @ehuss: this is the updated PR for the edit links feature |
Thanks for picking this up! I was thinking, since this isn't related to git in any way, perhaps the field could be called Otherwise looks good to me! |
Change the name of the git-repository-edit-url-template to be more generic: `edit-url-template` Signed-off-by: Flavio Castelli <fcastelli@suse.com>
@ehuss: sure, that's fine with me. I updated the PR to reflect your suggestion. Let me know if you want me to squash the last commit with the previous one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Need to filter what we actually need from this file, but it includes accessibility and navigation fixes, plus the additions necessary for edit-url-template [1] to work. [1] rust-lang/mdBook#1506
improve github-page intergration rust-lang/mdBook#1506
This PR is based on #1148 and supersedes it.
Compared to the originating PR, this one rebases the code against the current
master
branch and, most important of all, fixes the broken links reported by the early testers of this feature. I'm referring to the broken links to pages that were namedREADME.md
.I've successfully tested this feature against a complex mdbook hosted on GitHub, Bitbucket and Gitea