New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Tag support (again) [with arguments and explained in depth) #1828
Comments
As a core feature it will never happen as the core devs have no need for the feature and no interest in building/maintaining it. As a third party plugin, people who actually care about the feature can build/maintain it and not be tied to the much slower release cycle of the core. Seems to me like this is better as a plugin. If I wanted the feature, I would want it as a plugin. I suggest building the plugin and if it becomes wildly popular then we will consider adding it to the core. |
@noraj
I do not think that can be good arguments for anything because these points will only put third party developers in a bad light. (I do not think that is your intention.) @waylan An interesting point which I can see: extending the plugin system for a better and simpler usage of template blocks or template inheritance in general. Which allows to use a template or template block of the plugin without a manual copying of files to the custom directory by the user. A plugin author can also provide templates or template blocks with his plugin. |
I'm actually using this VSCode plugin to have YAML frontmatter support for my markdown notes. I looked at all OSS documentation staticgens like MkDocs, Sphinx, Daux, SkyDocs, Docsify, Docute, Couscous, Docusaurus, Orchid. But none have a tag support. Paradoxically nearly all generic staticgen (blog, website, etc.) have it. So I was wondering why staticgen targeting documentation will remove such a handy feature. Either blog post or documentation pages could take advantages of such a feature. |
See my previous comment:
A website or blog is a different system than a documentation, therefore the requirements are different.
Nothing can be removed if it was not there before. 😉 Based on your initial comment, I think the search is your problem, not the lack of tag support. To improve the search results or fix existings problem, the issue should be reported at the issue tracker of lunr.js. |
@froschdesign Ultimately tags index with a dedicated page is not required, having tags displayed is a nice to have but not mandatory, but at least lunr.js should take into account tags from the frontmatter and give them an heavy ratio (more than the the content) to help referencing. You may be more aligned with this idea. Auto-quote:
|
An argument for why tags display is useful for any documentation:
No project needs that or is using that? mozilla is using tags in its documentation for the HTTP protoco or JavaScript langl: https://developer.mozilla.org/en-US/docs/Web/HTTP / https://developer.mozilla.org/en-US/docs/Web/JavaScript Or docker: Or any big serious documentation project that is thousands or hundred of thousands pages. |
Yeah but I think the index page and tags displays matters a lot. I was saying it was no mandatory for my little documentation as you seemed no wanting to implement that, but it I would really love it and it would greatly improve my documentation. |
Please keep in mind: I'm not against tags in documentations, but I see no need to add the tag support to the core of MkDocs. This also applies to a lot of other feature requests. For voting your own comments: 👍 😉 |
Saying it can exist as a plugin will end in the feature never existing. And as plugin are unofficial they are unsupported and not guarantee to works or to be maintained. That's why I'm lobbying for such an essential feature to be in core. Also theme are compliant with the core but not with all plugins. |
Core vs feature: http://www.stateoftheevolution.com/core-vs-plugins Plugin when:
So it should be core. Also plugin have to be compatible with mkdocs versions, need to be manually installed, need some dependencies that won't be package with mkdocs, and may conflicts with other plugins.
@florimondmanca Please give me a strong argument why it should be a plugin ? @waylan Please, could you read it all my comments and arguments (now there are more and better arguments about why it is needed and why it need to be a core feature), and give your final statement: "Yes I will add it to the roadmap to implement this in the future" or "no I don't want to develop this feature". |
It's easy: convince @waylan and pay for it. Just like any other open source project. |
That's a big shortcut and ignoring the dozen of others I arguments I gave about compatibility, installation, faint of users, dependencies, conflicts, support, guarantee.
That's not the free libre and open-source philosophy. Close source it and sell it if the goal is earning money. I know how "feature requests" feels, when people asks for features but nobody help you, pay you and you're doing the development and maintaining it on your free personal time. But that's how FLOSS projects works: you dev tools without any returns but other people dev other tools without any returns that you can use for free. |
Mkdocs isn't motivated by money for features, but yeah sometimes people are told to create a PR if they want a feature, because sometimes it isn't in the interest of the maintainers to add a feature, but they aren't against a feature. Sometimes though, a PR will be rejected as it doesn't align with the vision of the the project, and if you want it, you'd have to fork or create a plugin. That is how open source works. |
Unfortunately yes, resulting in tons of forks and divided work and effort. |
I wouldn't want it either way. The projects I maintain and choose to volunteer to help at do not fund my time spent on them. They offer value for free, and because of that, are allowed to be biased in their approach. |
I would have developed it if mkdocs was in ruby by I'm not programming in python. |
You can port it to Ruby if you like. |
Please read the code of conduct https://www.pypa.io/en/latest/code-of-conduct/
|
I'm locking this discussion to let everyone cool down. For the record, I've stated my position: This should be implemented as a plugin. I will only reconsider if such a plugin becomes wildly popular. |
Tag support [Feature request]
Feature idea
Adding tags (keywords) in frontmatter (meta-data) will generate a page referencing all pages containing this page.
Example:
In frontmatter you add (in YAML for example):
So it will create a endpoint
http://mkdocs.org/tags/dev
andhttp://mkdocs.org/tags/python
referencing, respectively, all pages containing thedev
tag and thepython
tag.Then on the page of the documentation where there is such a
tags
frontmatter, the page will contain some tag link#dev
and#python
respectively referencing the previously mentioned endpoints.Related issues
There was already #759 and #1411.
In the old #759 issue, waylan and d0ugal said this feature was out of scope right now.
The feature request was severely lacking of argumentation and why this must be a core feature.
In this issue, waylan also said this feature would be better as a plugin (because he didn't see the need/use case for it to be in core) but this was before version 1.0 and the API was not existing yet. So at this time it was not even possible to make a plugin.
This issue was forgotten.
In the more recent #1411, plugin through the API is now possible and waylan said that frontmatter (meta-data) will allow a plugin to retrieve tags.
Bit he still suggest to create a plugin and don't see the need for tag support to be part of MkDocs. He also suggest it can be a theme dependant feature.
Why this would be a great feature?
I good real life example will be better to understand than pages of theoretical argumentation.
Imagine I want to build a hacking documentation with a tree like that (for, let's say, my OSCP exam preparation):
So I want to be able to search for a keyword (tag) like snmp and see all machines write-up where I attacked snmp, all cheat sheets explaining snmp stuff, all tools I can use to exploit snmp, etc.
Without tag support this is impossible.
One could say: "But there is already the search feature parsing teh content of pages" yeah but this is automatic and introduce a lot of false positive (content containing a keywork but not really about it) and false negative (content not containing teh keywork but actually talking about it) when the tag feature will be manual so there will be only exact matches.
Why this shouldn't be theme dependant?
First of all this mean you will have to choose between:
This will also mean that each theme creator will have to implement its own tag support, resulting in:
And finally why would a theme creator will implement a feature not provided by the core API?
And theme should be themes (CSS) not providing half the feature of the product.
Why this shouldn't be plugin based?
By making a plugin for providing this feature:
So in the end very few themes will support tags as a theme creator can't provide support for all plugins.
Imagine you want to create a Hexo theme, you definitely won't add support for the currently 295 existing hexo plugins.
Conclusion
Saying that it should be a plugin or theme dependant is killing the feature:
So now, I wish everybody as understand the need of tag support (every static site generator has support for it so why no documentation static site generator has it?) and this feature to be part of the core. (I also hope you won't insta-close this issue as a wontfix).
The text was updated successfully, but these errors were encountered: