Hello,
I am currently writing some coding guidelines and let them render with
the help of man.sr.ht. While reading the rendered version I saw a
little inelegance with the rendering of the "code span" elements.
On websites like GitHub/GitLab/Bitbucket the "code span" elements are
rendered with a monospace font and a light background (same as normal
code blocks), which helps to distinguish them better from normal text.
On man.sr.ht the "code span" elements are only rendered with a
monospace font. This makes it harder to distinguish them better from
normal text.
Would it be possible to add the some background color to
"code span" elements?
[code span]: https://spec.commonmark.org/0.29/#code-span
Rendering example man.sr.ht:
See tutorial[1] with "code span" elements like '~/.ssh/id_rsa.pub',
'sr.ht' or 'README.md'.
Rendering example GitHub:
See cheatsheet[2] section 'Code and Syntax Highlighting'
[1]: https://man.sr.ht/tutorials/set-up-account-and-git.md
[2]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting
---
~sblumentritt
> On 9 Nov 2019, at 10:50 pm, Sebastian Blumentritt <blumentritt.sebastian@gmail.com> wrote:> > Hello,> > Would it be possible to add the some background color to> "code span" elements?> > [code span]: https://spec.commonmark.org/0.29/#code-span> > Rendering example man.sr.ht:> See tutorial[1] with "code span" elements like '~/.ssh/id_rsa.pub',> 'sr.ht' or 'README.md'.
For my n=1 experience, I find the format on sr.ht as identifiable as but more
appealing than the GitHub example cited.
I second this request. Especially with very short code spans it can be
difficult to see that something is referred to as “code” vs ordinary
text.
In addition, it seems inconsistent to show code blocks with one kind of
format and inline code using a different format.
Glade
I'm in support of this idea as well. For those who need this feature as
a reader, you can probably find a browser extension that lets you write
custom css for specified sites. For example, on Firefox, there is
Stylus^[0]. The css below works pretty well for me:
```css
code {
background: #eee;
border-radius: 3px;
padding: 1px 3px;
}
```
However, as a writer, I hope we can still update this, since I cannot
ensure people reading my documentation have the custome styles. This
leads to me having to adapt my style of writing, sometimes using code
blocks where inline blocks may flow better, to ensure it is clear where
the inline code blocks start and end.
I can help submit a patch for this, if we can get an approval of this
proposal.
0. https://addons.mozilla.org/en-US/firefox/addon/styl-us/
Coco