From fb4059d28c7772e90ddf9a981a5089d44327a0c1 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Sun, 28 Jul 2019 16:15:27 +0200 Subject: [PATCH] Add some more information about ## as Julia source code comments. --- docs/src/fileformat.md | 5 +++-- docs/src/pipeline.md | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/src/fileformat.md b/docs/src/fileformat.md index 5569e44..8cccbc0 100644 --- a/docs/src/fileformat.md +++ b/docs/src/fileformat.md @@ -13,7 +13,7 @@ The basic syntax is simple: Leading whitespace is allowed before `#`, but it will be removed when generating the output. Since `#`-lines is treated as markdown we can not use that for regular julia -comments, for this you can instead use `##`, which will render as `#` in the output. +comments, for this you can instead use `## `, which will render as `# ` in the output. Lets look at a simple example: ```julia @@ -22,6 +22,7 @@ Lets look at a simple example: # In julia rational numbers can be constructed with the `//` operator. # Lets define two rational numbers, `x` and `y`: +## Define variable x and y x = 1//3 y = 2//5 @@ -29,7 +30,7 @@ y = 2//5 z = x + y ``` -In the lines starting with `#` we can use regular markdown syntax, for example the `#` +In the lines starting with `# ` we can use regular markdown syntax, for example the `#` used for the heading and the backticks for formatting code. The other lines are regular julia code. We note a couple of things: - The script is valid julia, which means that we can `include` it and the example will run diff --git a/docs/src/pipeline.md b/docs/src/pipeline.md index 267677b..5ee87e5 100644 --- a/docs/src/pipeline.md +++ b/docs/src/pipeline.md @@ -35,6 +35,7 @@ with each line categorized: # In julia rational numbers can be constructed with the `//` operator. <- markdown # Lets define two rational numbers, `x` and `y`: <- markdown <- code +## Define variable x and y <- code x = 1 // 3 <- code y = 2 // 5 <- code <- code @@ -52,6 +53,7 @@ chunks: # In julia rational numbers can be constructed with the `//` operator. │ markdown # Lets define two rational numbers, `x` and `y`: ┘ ┐ +## Define variable x and y │ x = 1 // 3 │ y = 2 // 5 │ code ┘ @@ -74,6 +76,7 @@ Lets define two rational numbers, `x` and `y`: ``` Chunk #2: ```julia +# Define variable x and y x = 1 // 3 y = 2 // 5 ```