primer / doctocat

A Gatsby theme for building Primer documentation sites

Home Page:https://primer.style/doctocat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Showing CLI examples

ampinsk opened this issue · comments

Right now, we're showing CLI/Terminal examples using images, but it would be nice to have a solution that allowed for copy/pasting.

Ideas we discussed:

  • A "dark theme" version of the current codeblocks
  • Leveraging syntax highlighting in some way to automate colorizing examples

We can definitely change the syntax highlighting of code examples to a dark theme when the language is set to shell. For example, a code example written like this:

```shell
npm run develop
```

... would render like this:

image

... instead of like this:

image


Correctly rendering the font-weight and colors in examples likes would be more difficult to implement. We'd likely have to introduce new syntax to allow you to indicate what words should be rendered in different colors and font weights.

image

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.