Parameters Highlight

To bring attention to important parameters in your CLI examples use the cli fence plugin. ```cli {highlight: "important"} my-super-command paramA --important-flag=true ``` my-super-command paramA --important-flag=true Note: Parameter names gets matched as long as their names contain the passed value. markdown ```cli {highlight: "important"} my-super-command paramA --important-flag=true another-command stop ``` my-super-command paramA --important-flag=true another-command stop

Include Plugin

Alternatively to fence plugin above, you can use include type. Note: options listed below are applicable to either form :include-cli-command: my-super-command paramA --important-flag=true {highlight: "important"} my-super-command paramA --important-flag=true

Long Commands

Long command lines will be automatically wrapped into multiple lines. another-command --score=2 --name=Name --value=8 --long-parameter-test --another-long-parameter1 --another-long-parameter2 --another-long3 Use threshold parameter to specify the max length of a line before splitting: :include-cli-command: another-command --score=2 --name=Name --value=8 --long-parameter-test --another-long-parameter1 --another-long-parameter2 --another-long3 { highlight: ["name", "value"], threshold: 30 } another-command --score=2 --name=Name --value=8 --long-parameter-test --another-long-parameter1 --another-long-parameter2 --another-long3 Use splitAfter to force line splitting after specified parameter: :include-cli-command: another-command --score=2 --name=Name --value=8 --long-parameter-test --another-long-parameter1 --another-long-parameter2 --another-long3 { highlight: ["name", "value"], splitAfter: ["--score=2", "--value=8"] } another-command --score=2 --name=Name --value=8 --long-parameter-test --another-long-parameter1 --another-long-parameter2 --another-long3 Note: Unlike highlight , splitAfter must be an exact match

Handle Special Symbols

If your command contains special symbols, such as { , move the command definition to a command option :include-cli-command: {command: "another-command {file1} [file2]", highlight: ["file1"]} another-command {file1} [file2]

From File

You can read a command from file. :include-cli-command: {commandFile: "cli/command.txt", highlight: "value"} my-captured-command --param=10 --another=value my-captured-command --param=10 --another=value This option is useful for displaying a captured command during tests.

ANSI Colors Output

CLI renders ANSI colors automatically. webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms) :include-cli-output: cli/ansi.out webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms)

Title

Use title to specify output of the output :include-cli-output: cli/ansi.out {title: "captured output"} webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms)

Anchor

When you specify a title, hover mouse over it to see a clickable anchor.Use anchorId to override auto generated identifier. :include-cli-output: cli/ansi.out { title: "captured output", anchorId: "my-output" } webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms)

Output Highlight

Use to highlight lines :include-cli-output: cli/ansi.out { title: "captured output", "highlight": "GET https" } webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms) Use to highlight lines based on the content of a file :include-cli-output: cli/ansi.out {highlightPath: "cli/file-path-of-asserted-lines.txt"} statusCode equals 200 executed HTTP GET webtau:000> http.get("https://jsonplaceholder.typicode.com/todos/1") > executing HTTP GET https://jsonplaceholder.typicode.com/todos/1 . header.statusCode equals 200 matches: header.statusCode: actual: 200 <java.lang.Integer> expected: 200 <java.lang.Integer> (47ms) { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } . executed HTTP GET https://jsonplaceholder.typicode.com/todos/1 (342ms)

Wide Mode

Use wide option to occupy as much horizontal space as available :include-cli-output: cli/wide-output.out { title: "Captured output", wide: true } long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output long line from captured output

Extract Snippets

Use startLine , endLine to extract specific content by using marker lines. :include-cli-output: cli/file-path-of-captured.out { title: "Limited captured output", startLine: "git push", endLine: "master -> master" } Mykolas-MacBook-Pro:znai-reactjs mykola$ git push Counting objects: 13, done. Delta compression using up to 8 threads. Compressing objects: 100% (13/13), done. Writing objects: 100% (13/13), 1.25 KiB | 0 bytes/s, done. Total 13 (delta 11), reused 0 (delta 0) remote: Resolving deltas: 100% (11/11), completed with 11 local objects. To https://github.com/testingisdocumenting/znai.git e310685..900e0be master -> master More on snippets extractions: snippets/snippets-manipulation Snippets Manipulation.

Presentation Mode

In presentation mode, cli command related plugins will simulate typing inside the terminal.You can gradually reveal cli-output by providing revealLineStop parameter. :include-cli-output: cli/file-path-of-captured.out {revealLineStop: [0, 4], highlight: "remote"} Passed will highlight each line as a separate slide. Delta compression using up to 8 threads. Compressing objects: 100% (16/16), done. Writing objects: 100% (16/16), 1.34 KiB | 0 bytes/s, done. Total 16 (delta 14), reused 0 (delta 0) remote: Resolving deltas: 100% (14/14), completed with 10 local objects. To https://github.com/testingisdocumenting/znai.git ea44003..e310685 master -> master Mykolas-MacBook-Pro:znai-reactjs mykola$ git push Counting objects: 13, done. Delta compression using up to 8 threads. Compressing objects: 100% (13/13), done. Writing objects: 100% (13/13), 1.25 KiB | 0 bytes/s, done. Total 13 (delta 11), reused 0 (delta 0) remote: Resolving deltas: 100% (11/11), completed with 11 local objects. To https://github.com/testingisdocumenting/znai.git e310685..900e0be master -> master Mykolas-MacBook-Pro:znai-reactjs mykola$ git push Counting objects: 33, done. Delta compression using up to 8 threads. Compressing objects: 100% (33/33), done. Writing objects: 100% (33/33), 3.34 KiB | 0 bytes/s, done. Total 33 (delta 28), reused 0 (delta 0) remote: Resolving deltas: 100% (28/28), completed with 14 local objects. To https://github.com/testingisdocumenting/znai.git 900e0be..bb9993f master -> master