GithubHelp home page GithubHelp logo

eddyluten / mkdocs-alias-plugin Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 2.0 66 KB

An MkDocs plugin allowing links to your pages using a custom alias

License: MIT License

Python 100.00%
aliases documentation mkdocs mkdocs-plugin wiki

mkdocs-alias-plugin's People

Contributors

eddyluten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mkdocs-alias-plugin's Issues

Option to use relative url

I use your plugin for a project documentation and I really enjoy it!

I recently encountered a problem with the alias link, as the url used for replacement is an absolute url.
Indeed my documentation site is hosted on a specific route: https://my_site.net/my_project/documentation/
In this case using an absolute url resulted in a link that points to the wrong destination :
https://my_site.net/my_alias instead of https://my_site.net/my_project/documentation/my_alias

I would like to add an option to make the link relative to the current page to fix this issue.

Is it possible to force escaping double square brackets in code blocks?

Hello ๐Ÿ‘‹

First of all congratulations for the great plugin, I find it very useful. But now I'm facing something that maybe wasn't taken into account when the plugin was developed, or maybe I'm doing something wrong. I hope somebody can shed some light over this.

The issue happens when I want to put literally [[ something ]], enclosed by double square brackets inside a code block.

Specifically, I want to put a code block with something like:

```shell
   [[ ! -d $HOME/myfolder ]] && mkdir $HOME/myfolder
```

which renders just fine in Markdown, but the MKDocs console prints it as a warning because the double square brackets are interpreted as an alias that doesn't exist.

WARNING  -  Alias ' ! -d $HOME/myfolder ' not found in 'test.md'

I know it can be legit using aliases within code blocks, in fact I use them, but just wondering if there could be a way to force escaping them, so they are not interpreted as an alias. As said, this is not a big deal, as the website renders good, it is just to avoid that WARNING message in the console log.

Great job with the plugin! ๐Ÿ’ช

Thanks and regards.

Type annotation error with Python 3.8

With the recent release of version 0.8.0 of mkdocs-alias, we started having errors when building our documentation using Python 3.8 (See these CI logs).

It seems that the package's code started using list for annotating lists of objects instead of using List from the typing package and that is not supported in Python 3.8.

There are 2 possible solutions:

  • Add from __future__ import annotations at the top of the plugin module.
  • Use List from the typing package instead of list until Python 3.8 is no longer supported.

specific words cause the plugin to fail

hello.

whenever I use the word "context" (upper or lowercase) in an alias definition under the frontmatter YAML of an mkdocs.yml file, the build process fails with the following error:

meta_data['alias']['text']
~~~~~~~~~~~~~~~~~~^^^^^^^^

I'm using Python 3.11, mkdocs 1.5.3 with mkdocs-material 9.4.1

thanks!
Jorge

CI Checks

Enable CI for all version of Python that MkDocs targets, which currently seems to be 3.8: pyproject.toml.

Aliases VS Code Extension Wishlist

It would be nice to have a tie-in VS Code extension that added first-class support for aliases in Markdown files. I'm capturing some of the requirements here before starting development on it.

Proper Rendering

Aliases are rendered strangely within VS Code:

Screen Shot 2022-07-07 at 11 11 07 AM

Rendering these aliases closer to links would be preferable:

Screen Shot 2022-07-07 at 11 13 52 AM

Also perhaps displaying red squigglies if the alias wasn't found within the scope of the project.

Auto-Completion

While typing the [[ alias syntax, it would be nice to have an auto-complete dialog show with known aliases and their associated page titles.

Screen Shot 2022-07-07 at 11 16 43 AM

Defining Aliases

It would be nice to have a way to easily define an alias for any active Markdown file, including inserting a meta-section into the file if none exists.

render anchor title instead of page title

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

Support for page anchors.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.