From 49d1bceb6d64864004737cd113aafb037d0e58a4 Mon Sep 17 00:00:00 2001 From: J S <49557684+svilupp@users.noreply.github.com> Date: Fri, 12 May 2023 12:07:11 +0100 Subject: [PATCH] updated examples --- docs/src/outputformats.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/src/outputformats.md b/docs/src/outputformats.md index 5c4312f..d3c3e4d 100644 --- a/docs/src/outputformats.md +++ b/docs/src/outputformats.md @@ -94,11 +94,17 @@ Literate can output markdown in different flavors. The flavor is specified using Literate.jl will produce a `.qmd` file, which can be used as input to Quarto CLI to produce a variety of output formats, including HTML, PDF, Word and RevealJS slides. Syntax tips: -- `# `(hashtag followed by a space) at the beginning of a line will be stripped and anything following will rendered as a markdown, e.g., `# # Header level 1` in your script will be rendered as `# Header level 1` in your .qmd file (ie, it will show as a header). Use this for adding the YAML header at the top. -- `#`(hashtag not followed by a space) at the beginning of a line will be stripped and anything following will be rendered as part of the code block. This is useful to provide Quarto commands in computation blocks, e.g., `## echo: false` in your script will be rendered as `#| echo: false` which will tell Quarto to not echo the code block in the output (see [Guide: Executions options](https://quarto.org/docs/computations/execution-options.html) for more commands). +- `# `(hashtag followed by a space) at the beginning of a line will be stripped and anything that follows will rendered as a markdown, e.g., `# # Header level 1` in your script will be rendered as `# Header level 1` in your .qmd file (ie, it will show as a header). Use this for adding the YAML header at the top or any Markdown blocks in the Quarto guide. +- `##|`(two hashtags followed by a pipe) at the beginning of a line will strip the first hashtag and interpret the remainder of the line as part of the code block. This is useful to provide Quarto commands in computation blocks, e.g., `##! echo: false` would be rendered as `#| echo: false` and would tell Quarto not to "echo" the outputs of the execution (see [Guide: Executions options](https://quarto.org/docs/computations/execution-options.html) for more commands). - Make sure to always provide the YAML header and specify IJulia kernel when executing the file by Quarto, e.g., -```# ---\n# title: "My Report"\n# jupyter: julia-1.9\n# ---` (notice how all lines are escaped with a `# ` that Literate.jl will strip and render the markdown - see Quarto's YAML [header examples](https://quarto.org/docs/get-started/hello/vscode.html#render-and-preview)) -- If any markdown components (eg, headers) are not rendering correctly in your Quarto outputs, make sure they are surrounded by empty lines (eg, add an empty line before and after the header) to help Quarto parse them correctly +``` +# --- +# title: "My Report" +# jupyter: julia-1.9 +# --- +``` + Notice how all lines are escaped with a `# ` so Literate.jl knows to strip the hashtags and render it as markdown (see [Authoring Tutorial](https://quarto.org/docs/get-started/authoring/vscode.html#multiple-formats) for more examples) +- If any markdown components (eg, headers) are not rendering correctly in your Quarto outputs, make sure they are surrounded by empty lines (e.g., add an empty line before and after the header) to help Quarto parse them correctly Steps to install: - Install [Quarto CLI](https://quarto.org/docs/getting-started/installation.html)