website icon indicating copy to clipboard operation
website copied to clipboard

Remove `$` from commands

Open moficodes opened this issue 2 years ago • 5 comments

In a number of doc pages we have $ in the command.

If we were to copy the command to run ourselves the $ will also get copied. We should remove these.

e.g. https://etcd.io/docs/v3.5/quickstart/

moficodes avatar Mar 31 '24 00:03 moficodes

/assign

moficodes avatar Mar 31 '24 00:03 moficodes

Hey @moficodes, as discussed during the triage meeting, there is a Markdown lint rule regarding this. Please refer to: https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md014---dollar-signs-used-before-commands-without-showing-output

Regarding linting, refer to: https://github.com/etcd-io/website/pull/774#discussion_r1498552258

ivanvc avatar Apr 25 '24 18:04 ivanvc

While I understand the Markdown linting rule. My concern were more with the usability of the commands. We have a copy button but its pretty useless with the $ and output in the same block.

I think we should remove all $ signs from command that people might want to copy and paste and also separate outputs from the same code block. Its one time tedious work. but once done it will make the whole project more user friendly.

moficodes avatar Apr 25 '24 20:04 moficodes

I agree, but if the code block also contains sample output, what's the value of copying it? I think we need someone else (thinking of @jmhbnz after he returns from his leave) to weigh in.

ivanvc avatar Apr 25 '24 21:04 ivanvc

We should follow markdownlint conventions where possible unless we have a very good reason not to.

The page we are talking about is https://etcd.io/docs/v3.5/quickstart.

On that page I can see we have source code blocks that include both the command run, as well as the output of that command within a single block. The guidance for this is as linked by @ivanvc and essentially says the way we do it currently is correct as we need to distinguish between the command, and the output produced by the command.

If we want to use the copy/paste functionality for the command, then we would need to split the output of the commands into separate code blocks, otherwise the $ signs need to stay.

I don't have a strong opinion which approach we take (sticking with current state, vs adding separate results blocks), so longs we are adhering to best practices outlined in markdownlint and being consistent across the site.

jmhbnz avatar May 05 '24 09:05 jmhbnz

Closing - We are following markdownlint best practice currently and I don't think rewriting pages to separate command from results is a priority for website. We have many pages that need much more meaningful updates currently. Happy to re-open if community has strong opposition or something changes around best practices from lint.

jmhbnz avatar May 12 '24 22:05 jmhbnz