Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Reference: [`Listing and source code blocks`](https://asciidoctor.org/docs/ascii
Reference: [`Building blocks in AsciiDoc`](https://asciidoctor.org/docs/asciidoc-writers-guide/#building-blocks-in-asciidoc)

```
[source, <language>]
[source,<language>]
----
text
text
Expand All @@ -273,7 +273,7 @@ Optional define the `<language>`

Example:
```
[source,console]
[source,bash]
----
subscription-manager repos --enable rhel-server-rhscl-7-rpms
----
Expand All @@ -282,12 +282,18 @@ You can also use `include` in code blocks to include an example.

Example:
```
[source,console]
[source,bash]
----
include::example$installation/post-installation-steps.sh[]
----
```

**IMPORTANT** For highlighting `bash` commands properly, distinct when to use `console` and when to use `bash` as source language:
Comment thread
EParzefall marked this conversation as resolved.

* Use `console` whenever there is a bash prompt with one of the following prompt characters `> % $ #` where there can also be up to 3 whitespaces _before_ the bash prompt, or a bash prompt like `[test@ubuntu~]$`. The bash prompt will be visible, rendered differently but cant be selected with the mouse manually. `bash` commands post the bash prompt will be highlighted. Note that if there is no bash prompt upfront, no highlighting will take place!
Comment thread
EParzefall marked this conversation as resolved.
* Use `bash` whenever there is no bash prompt upfront and you either show shell commands or bash scripts.
* Note that you can copy a source block via clicking the copy symbol at the right of the language at any time without the bash prompt, if any is present.
Comment thread
EParzefall marked this conversation as resolved.

### OCC Examples

When creating examples that show how to use occ, ensure that you use the `occ-command-example-prefix` attribute.
Expand Down