-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Implement mkdocs key from v2 config #4486
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
Changes from 2 commits
c1d791e
5918ce0
019fc27
8b077e9
050c974
c469d64
ce16fe7
9caace0
d9d2f25
b0d23a6
3962715
1aa8126
ca60dca
96f6241
a03da2b
357f034
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -823,12 +823,16 @@ def validate_final_doc_type(self): | |
should support per version doctype, but we need to | ||
adapt the rtd code for that. | ||
""" | ||
if self.doctype != self.defaults.get('doctype', 'sphinx'): | ||
dashboard_doctype = self.defaults.get('doctype', 'sphinx') | ||
if self.doctype != dashboard_doctype: | ||
key = 'mkdocs' if self.doctype == 'mkdocs' else 'sphinx' | ||
self.error( | ||
key, | ||
'Your documentation type should match ' | ||
'the one from the admin panel of your project.', | ||
'Your project is configured as "{doctype}" in your admin ' | ||
'dashboard, but there was a "{key}" key specified.'.format( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One last nitpick. The error is sort of inverted i feel -- we don't actually tell the user the they need a "sphinx" key, just that they can't have a "mkdocs" key. I feel we need to be clearer here, ie:
Also, for some of the odd documentation types, it looks like we're putting the slug in there, so:
I feel like we want the verbose name instead. This shouldn't be a huge change, just using the model field to resolve the verbose name, but if it is a large change, it's not horribly important. This piece is temporary and it's probably close enough for most users. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mmm, I'm not sure about accessing the db from the config module (we don't do that there). I'm changing the error message. |
||
doctype=dashboard_doctype, | ||
key=key, | ||
), | ||
code=INVALID_KEYS_COMBINATION, | ||
) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doctype
here is the interpolation that could be displayed assphinx_htmldir
.key
in this string can only besphinx
ormkdocs
.