~sircmpwn/sr.ht-discuss

3 3

Code Span Rendering on man.sr.ht

Details
Message ID
<CAJFYsWAe3CMjhROs3CintYTdsuFkhp-tF3r-6xvZgceeRZbw-g@mail.gmail.com>
DKIM signature
missing
Download raw message
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
Details
Message ID
<A3D705FB-F175-48A9-9173-A108B85A577F@jamsek.com>
In-Reply-To
<CAJFYsWAe3CMjhROs3CintYTdsuFkhp-tF3r-6xvZgceeRZbw-g@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message

> 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.
Details
Message ID
<39M7a2HOVt1FZ0Y4LgK9YO6BrJWjxSwvFrDXf-jC5gf6CIOywg-oIg-I67LM4-ZOUPd7NZMiXGJZd6ZaVLPJNScZrmxuOYlDNubEoav_4c0=@glamber.com>
In-Reply-To
<A3D705FB-F175-48A9-9173-A108B85A577F@jamsek.com> (view parent)
DKIM signature
missing
Download raw message
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
Details
Message ID
<CR4502T90BOK.1MTP8S5IDU08N@fembook>
In-Reply-To
<A3D705FB-F175-48A9-9173-A108B85A577F@jamsek.com> (view parent)
DKIM signature
missing
Download raw message
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
Reply to thread Export thread (mbox)