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
Source tags rendering incorrectly. #1471
Comments
This appears to be related to your custom theme and a change in how MkDocs handles Markdown meta-data. Markdown's default is to return raw meta-data such that each value is a list of lines (most of which contain one item). As this doesn't really make sense for MkDocs, in 0.17 MkDocs now joins those items into a string. However, in your template, you are still treating the value of I'm assuming a page would only ever have a single "source" to link to, so the loss of ability to define a list shouldn't be a problem here. The change was made with the understanding that the feature was completely undocumented and mostly unused. @tomchristie I suspect you are the only one who has ever made use of it. The only officially supported meta-data key is |
This is very possibly true. |
That’s not quite the case for us, no. Occasionally a single docs page will refer to more than one module. |
I'm not quite sure of the best way to support this. The underlying library offers a way to define a "type" for a given key which would convert the raw data to that "type". However, that is not exposed to the MkDocs user. Truth be told, I would like to switch to using YAML for the meta-data. Of course, YAML has type-support builtin and users already are using YAML for the config file. The problem is that Markdown systems which use YAML traditionally require a YAML deliminator (line of |
I have just stumbled upon this. But the mkdocs’ documentation suggests that {% for filename in page.meta.source %}
<a class="github" href="https://github.com/.../{{ filename }}">
<span class="label label-info">{{ filename }}</span>
</a>
{% endfor %} Maybe that example should be fixed to replace the Ah, and also the default theme is doing the same. I tried adding a |
Good catch. I wasn't aware we were expecting lists anywhere internally. Probably the correct change to the documentation is to update the meta-data in the sample document to use YAML style meta-data. Then the existing template would be correct. Note that the existing behavior of Meta-Data is correctly documented under writing your docs (YAML style retains types, including lists, while MultiMarkdown style returns a single string for each key). It might also make sense to have the templates check the type of |
Refs: encode/django-rest-framework#5945
Building against 0.17.3
Building against 0.16.3
Presumably they're incorrectly being treated as a list even in the single-tag case.
The text was updated successfully, but these errors were encountered: