Skip to content
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

tools: fix anchors in generated documents #2491

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/api_assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ code a:hover {
color: white !important;
}

pre.api_stability_0 a,
pre.api_stability_1 a,
pre.api_stability_2 a,
pre.api_stability_3 a,
pre.api_stability_4 a,
pre.api_stability_5 a {
Copy link
Contributor

Choose a reason for hiding this comment

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

.sh_sourceCode a should actually suffice, as this is the selector that resets text-decoration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But this resets only for the as within pres with api_stability_* class applied, right?

Edit: It looks like sh_sourceCode is only for the source code. But this is not source code.

Copy link
Contributor

Choose a reason for hiding this comment

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

But this is not source code.

It may not be, but the parent pre has the sh_sourceCode class which is the root of this problem. Maybe investigate removing that class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@silverwind Oh, I have never done much of css before. But I couldn't find references to sh_sourceCode in the css file. How they are actually linked?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's added by the syntax-highlighting library (

sh_addClass(element, 'sh_sourceCode');
) because these stability notices are indented with 4 spaces which technically makes them source code for the parser.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I ll try the change you suggested.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, I think it could cause side effects with a in actual code, so your approach might be better overall. Let's just remove the overqualified selectors, so it's just .api_stability_0 a etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@silverwind You mean api_stability_0 will never be used without pre?

Copy link
Contributor

Choose a reason for hiding this comment

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

It shouldn't. Generally it's bad practice in CSS to prefix a class selector with the node type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh okay. I'll remove it then.

text-decoration: underline;
}

.api_stability_0 {
background-color: #D60027;
}
Expand Down