EddyLuten / mkdocs-alias-plugin

An MkDocs plugin allowing links to your pages using a custom alias
MIT License
12 stars 2 forks source link

Support for page anchors. #6

Closed shaloo closed 1 year ago

shaloo commented 1 year ago

If I create an alias for a page, is there a way to cross-reference a page anchor using an alias? For e.g.,

test.md

Refer to the [[devguide-page-ref|developer guide]]#install-section for more details

devguide.md


alias: devguide-page-ref


Some Title

Yada Yada Yada

Installation

Yada Yada Yada

Debug

Yada Yada Yada

I tried via [[devguide-page-ref|developer guide]]#install-section as well as [[devguide-page-ref#install-section|developer guide]] But the generated link is incorrect.

EddyLuten commented 1 year ago

The plugin currently doesn't support anchors, but adding support should be easy enough. I will update this issue with more info once it's complete.

EddyLuten commented 1 year ago

Support for page anchors is now available in version 0.6.0 available on PyPI. The syntax is:

[[devguide-page-ref#install-section|developer guide]]

This would link to devguide.md#install-section.

I've kept the anchor and the alias together since it's the bit that identifies which page to link to.

shaloo commented 1 year ago

Thanks @EddyLuten for the prompt response!