render anchor title instead of page title #8
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
luten/mkdocs-alias-plugin#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
hello!
been using the plugin and it works great, however when I use anchors within the aliases, the rendered title is always for the main page and not for the anchor itself. is it possible to render the anchor title instead?
thank you!
Jorge
Hi Jorge, thanks for filing this issue! This could certainly be accomplished on a technical level, though it would have to be an opt-in feature configured through
mkdocs.ymlsince it would change the existing behavior, and I don't want to break the plugin for other users.I'll take a look at implementing it, though I'm not sure when I'll get to it. For now, as a workaround, I suggest using custom titles:
yeah, that's exactly what I've been doing for now, but it would be a welcome addition for automation and fire-and-forget editing. still, just thought I'd make the suggestion :)
cheers and kutgw,
Jorge
Alright, I figured I'd give it a whirl and implemented the feature today. After upgrading to version 0.8.0, you should be able to enable the config flag
use_anchor_titlesand begin pulling in titles from headings.This will only work for anchors generated through Markdown headings, which should be fine for most cases since embedded HTML is a bit of an edge case anyway. Meaning that it won't work for other types of anchors, such as pure HTML anchors, e.g.:
<a name="anchor">...Let me know if this works for you. I'm already beginning to use it in my personal KB. Thanks for the feature suggestion!
wow, didn't think you'd actually pick this up any time soon, so our productive builds can't be changed, but I've tested in in our test environment and it looks good, going to ship it in the next builds, thank you so much! :)