render anchor title instead of page title #8

Closed
opened 2024-03-27 19:14:39 +01:00 by usulpt · 4 comments
usulpt commented 2024-03-27 19:14:39 +01:00 (Migrated from github.com)

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

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
EddyLuten commented 2024-03-30 22:32:28 +01:00 (Migrated from github.com)

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.yml since 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:

[[the-alias#anchor|Custom Title]]
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.yml` since 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: ```md [[the-alias#anchor|Custom Title]] ```
usulpt commented 2024-04-01 09:56:19 +02:00 (Migrated from github.com)

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

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
EddyLuten commented 2024-04-07 00:59:44 +02:00 (Migrated from github.com)

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_titles and 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!

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_titles` and 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!
usulpt commented 2024-04-08 11:37:06 +02:00 (Migrated from github.com)

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! :)

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! :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
luten/mkdocs-alias-plugin#8
No description provided.