fredrikekre / fredrikekre/DocumenterCodeBlocks.jl

Do not show underline until hover

Open Beginner friendly
#21 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
28
Forks
1
Avg merge
37m
Merged PRs (30d)
2

Description

This is completely a matter of taste, but I figure I might as well express my opinion: I find the underlining of links to be too noisy, even the toned-down dotted underline. My preference would be for no underline at all until I hover over the block, and then use the dotted underline that's currently always on (instead of the solid underline).

I can achieve that locally by putting the following in a `docs/src/assets/codeblocks.css` file and adding it to my list of `assets` in `Documenter.HTML`:

```
/* Overrides for DocumenterCodeBlocks' `juliasyntax-tokens.css`.
*
* The plugin underlines reference links in code blocks with a dotted line at
* rest, going solid while the pointer is inside the block. We want no underline
* at rest, and the dotted line only on hover.
*
* The leading `html` is required: the plugin appends its stylesheet to
* `Documenter.HTML(assets=...)` during its own pipeline step, so it is loaded
* after this file and wins any tie on specificity.
*/

html pre code a.julia-ref {
text-decoration: none;
}

html pre:hover code a.julia-ref {
text-decoration: underline;
text-decoration-style: dotted;
text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
text-underline-offset: 2px;
}
```

Obviously, it's your project, so you decide the default aesthetics. So, feel free to close, or leave open as documentation for anyone who has the same preference as me.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the referenced docs/src/assets/codeblocks.css and the Documenter.HTML asset pipeline, then inspect the plugin's juliasyntax-tokens.css styling for a.julia-ref links. The change is done when links have no underline at rest and use the existing dotted underline while hovering over the code block; verify the rendered documentation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, julia
Domain
documentation, frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.