website icon indicating copy to clipboard operation
website copied to clipboard

[feature request] Custom markdown syntax for "variables" in code snippets

Open jesscodez opened this issue 9 years ago • 7 comments

This is a...

  • [x] Feature Request
  • [ ] Bug Report

Problem:

In code snippets it can be unclear whether a value is part of the "actual code", or an example value that the reader should swap out.

For instance, dapi-test-pod in:

screen shot 2017-06-23 at 4 24 26 pm

While the reader can figure this out by reading the instructions carefully, by and large we should assume that there's a lot of skimming going on. 😝 There are probably quite a few cases where users directly copy-and-paste lines of code without altering them.

Proposed Solution:

DigitalOcean highlights "variables" in code snippets (see https://www.digitalocean.com/community/tutorials/digitalocean-s-writing-guidelines#variables). It looks like the following:

screen shot 2017-06-23 at 3 43 10 pm

We could likewise implement custom markdown syntax to enable something like this.

Page to Update:

Generally the whole site.

jesscodez avatar Jun 23 '17 23:06 jesscodez

cc @chenopis (I don't think I have the ability to assign things?) Also, would definitely be interested into working on this myself!

jesscodez avatar Jun 23 '17 23:06 jesscodez

Try /assign @chenopis in a comment.

chenopis avatar Jun 23 '17 23:06 chenopis

/assign @abiogenesis-now

chenopis avatar Jun 23 '17 23:06 chenopis

This is a good idea (and one common solution to the problem). BUT ... we also already have this recommendation in the style guide: https://kubernetes.io/docs/home/contribute/style-guide/#use-angle-brackets-for-placeholders. (TL;DR: another common solution) My guess is that the issue exists because there's non-conformance to the doc style guide all over the place. How much can we automate fixing the markup for what's already in place?

Bradamant3 avatar Jul 05 '17 14:07 Bradamant3

on hold, but I'll tag this with team/heptio anyways

jesscodez avatar Aug 10 '17 22:08 jesscodez

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta. /lifecycle stale

fejta-bot avatar Jan 03 '18 01:01 fejta-bot

Hmm...not on the immediate roadmap, but still a nice to have. I'll close this issue for now and track it in my own todos, barring any objections.

jesscodez avatar Jan 03 '18 17:01 jesscodez