GithubHelp home page GithubHelp logo

eddyluten / mkdocs-categories-plugin Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 0.0 32 KB

An MkDocs plugin allowing for categorization of wiki pages

License: MIT License

Python 100.00%
categorization documentation mkdocs mkdocs-plugin wiki

mkdocs-categories-plugin's People

Contributors

eddyluten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mkdocs-categories-plugin's Issues

Plugin does not work properly when site is hosted in a subdirectory

Hi @EddyLuten,

Thanks for writing this plugin! I ran some tests with it and all seemed fine while hosting the MkDocs site files from the root of the website, e.g. site_url: https://www.example.com in mkdocs.yml. However, I found that the plugin does not work properly when hosting the files in a subdirectory of the site. E.g. site_url: https://www.example.com/subdir.

The problem lies in the fact that the plugin generates absolute links. Meaning: the category links on the category index page are always prefixed with /categories; it does not take the subdir in account. The same is true for the category pages (which contain links to the pages on which the category is used on) and the 'normal' pages, on which the categories of that page are listed.

The MkDocs documentation states that absolute paths with links are not officially supported (source) and that relative paths are to be used.

I prepared a small patch which makes the plugin generate relative links. Could you please take a look at it and share your thoughts? Thanks!

-Remy

plugin.py.patch.txt

Support for hierarchy of categories

Is it possilbe to define a hierarchy of categories so that each category page shows both pages directly assigned to it, as well as child categories? This is standard in mediawiki.

For example, given the following hierarchy, there will be a Boeing category page that shows both any pages directly assigned to the Boeing category, and it will show two child categories: 737 Max and 737-300.

Vehicles
--Airplanes
----Boeing
------737 Max
------737-300
----Airbus
------A320neo
------A380
--Cars
----Tesla
------Model 3
------Model Y
----Ford
------Explorer
------Focus

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.