RexOps / rexify-website

Website content and code for rexify.org
https://www.rexify.org
14 stars 31 forks source link

Add syntax format to shell code examples #167

Open dboehmer opened 4 months ago

dboehmer commented 4 months ago

Some code examples, e.g. on https://www.rexify.org/get/index.html, show shell code. I suggest to declare the code format using this Markdown syntax to get syntax highlighting. This makes shell command a little more human friendly.

Current Markdown syntax (example from https://www.rexify.org/docs/guides/start_using__r__ex.html):

    $ rex -T
    Tasks
      start_apache                   Start Apache service
      uptime                         Get the uptime of all servers
    Server Groups
      myservers                       mywebserver, mymailserver, myfileserver

Output (no syntax highlighting):

$ rex -T
Tasks
  start_apache                   Start Apache service
  uptime                         Get the uptime of all servers
Server Groups
  myservers                       mywebserver, mymailserver, myfileserver

Suggested Markdown syntax:

```console
$ rex -T
Tasks
  start_apache                   Start Apache service
  uptime                         Get the uptime of all servers
Server Groups
  myservers                       mywebserver, mymailserver, myfileserver
```

Output (colored, at least on GitHub):

$ rex -T
Tasks
  start_apache                   Start Apache service
  uptime                         Get the uptime of all servers
Server Groups
  myservers                       mywebserver, mymailserver, myfileserver

Is this supported in the build system of the website? Would you accept a PR applying this?