Skip to content

DOC use default_role='any'#12355

Merged
qinhanmin2014 merged 1 commit intoscikit-learn:masterfrom
jnothman:default_role
Oct 14, 2018
Merged

DOC use default_role='any'#12355
qinhanmin2014 merged 1 commit intoscikit-learn:masterfrom
jnothman:default_role

Conversation

@jnothman
Copy link
Copy Markdown
Member

Fixes #11186

I've realised that sphinx's 'any' mostly does what we want:

  • resolves references to glossary terms and other things from the std domain (e.g. section refs) before others
  • resolves to code objects (e.g. LogisticRegression, linear_model.LogisticRegression) otherwise
  • leaves unlinked otherwise

We may find that we want more control over it than this eventually, but it's a good start.

In all cases it uses <code> monospace formatting, which could perhaps be improved upon. CSS can be used to do more styling if appropriate, as each link has classes that indicate the type of the target; alternatively, the role definition can be extended.

We may consider replacing many of our double backticks with single backticks in documentation that is little touched by open PRs.

@adrinjalali
Copy link
Copy Markdown
Member

Not really sure how one would go after reviewing this, but the docs seem fine as far as I can tell. Just one thing, is it building the pages somewhat not completely?

On the generated artifacts, in this page I don't see the plot I see on the master's equivalent. If that's expected, then it looks good to me.

@amueller
Copy link
Copy Markdown
Member

Given that we generally have avoided this, I don't think the docs will change a lot doing this, so I think we should just go ahead.
@adrinjalali I don't think examples are run by default.

@qinhanmin2014
Copy link
Copy Markdown
Member

This is what single backticks looks like, I doubt whether it is what we want. (I guess sphinx is now trying to link everything with single backticks?)
2018-10-12_114714

@jnothman
Copy link
Copy Markdown
Member Author

Yes, backticked terms will be monospace, and linked where possible. Why is that not what we want @qinhanmin2014?
We can do quite a lot to change fonts and styling with CSS: sphinx attached lots of helpful classes to the role. What would you suggest?

@qinhanmin2014
Copy link
Copy Markdown
Member

Yes, backticked terms will be monospace, and linked where possible. Why is that not what we want

I guess sometimes (most times maybe) contributors use single backticks for specific terms, like double backticks. They actually don't want to link it to any existing materials in the repo (if so, maybe they'll be using things like :ref:). So I don't think trying to link everything with single backticks is a good idea. These black bold fonts usually indicates some broken links we need to fix.

@jnothman
Copy link
Copy Markdown
Member Author

jnothman commented Oct 14, 2018 via email

@qinhanmin2014
Copy link
Copy Markdown
Member

I don't see why we shouldn't link...

I'll vote +0. Waiting for a +2 to merge this one.

Copy link
Copy Markdown
Member

@qinhanmin2014 qinhanmin2014 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a doc issue, I'll follow the majority.

@qinhanmin2014 qinhanmin2014 merged commit 274ce3a into scikit-learn:master Oct 14, 2018
anuragkapale pushed a commit to anuragkapale/scikit-learn that referenced this pull request Oct 23, 2018
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change default role in sphinx

4 participants