Azure / simdem

Tool for Simulating Demo's, delivering Tutorials and using documentation as tests.
MIT License
34 stars 17 forks source link

SimDem does not support code samples or outputs within backticks ``` #116

Closed jasonmesser7 closed 2 years ago

jasonmesser7 commented 2 years ago

Simdem does not support yaml code samples in back ticks. In Azure documentation it is common to do the following

image

Example blocker:

image

Here is the raw code. `yaml apiVersion: apps/v1 kind: Deployment metadata: name: azure-vote-back spec: replicas: 1 selector: matchLabels: app: azure-vote-back template: metadata: labels: app: azure-vote-back spec: nodeSelector: "kubernetes.io/os": linux containers:

Suggested solutions: Easiest - Anytime there is a character after ``` on the same line simply output the below command, do not execute. Medium - require a tag of 'bash' or another key word to be placed in front of all code samples that you want ran. Print all other sections as normal Hard- Code Simdem to simply print output and potentially respond differently to specific listed tags like json, yaml, output etc.

SorraTheOrc commented 2 years ago

I believe your "medium" suggestion is the best.

Today Simdem is only interested in executable Bash. Adding the Bash identifier would result in the code being properly rendered when using the markdown for human consumption and, as you suggest, would be clearly mark executable content.

I can't imagine what SimDem would do with non-executable content such as JSON or YAML. So let's not complicate things with that until there is a solid use case.

rgardler-msft commented 2 years ago

I believe this is fixed in #123, a test case is included in that PR. @jasonmesser7 please verify and close this issue if that is correct.

rgardler-msft commented 2 years ago

Note the fix in #123 is dependent on #122 if an expected_similarity rating is required on a result block. However, where no similarity is needed it works as expected. Bumping the priority of #122 as a result