Browse Source

Add some more information about ## as Julia source code comments.

pull/72/head
Fredrik Ekre 6 years ago
parent
commit
fb4059d28c
  1. 5
      docs/src/fileformat.md
  2. 3
      docs/src/pipeline.md

5
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 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 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: Lets look at a simple example:
```julia ```julia
@ -22,6 +22,7 @@ Lets look at a simple example:
# In julia rational numbers can be constructed with the `//` operator. # In julia rational numbers can be constructed with the `//` operator.
# Lets define two rational numbers, `x` and `y`: # Lets define two rational numbers, `x` and `y`:
## Define variable x and y
x = 1//3 x = 1//3
y = 2//5 y = 2//5
@ -29,7 +30,7 @@ y = 2//5
z = x + y 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 used for the heading and the backticks for formatting code. The other lines are regular
julia code. We note a couple of things: 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 - The script is valid julia, which means that we can `include` it and the example will run

3
docs/src/pipeline.md

@ -35,6 +35,7 @@ with each line categorized:
# In julia rational numbers can be constructed with the `//` operator. <- markdown # In julia rational numbers can be constructed with the `//` operator. <- markdown
# Lets define two rational numbers, `x` and `y`: <- markdown # Lets define two rational numbers, `x` and `y`: <- markdown
<- code <- code
## Define variable x and y <- code
x = 1 // 3 <- code x = 1 // 3 <- code
y = 2 // 5 <- code y = 2 // 5 <- code
<- code <- code
@ -52,6 +53,7 @@ chunks:
# In julia rational numbers can be constructed with the `//` operator. │ markdown # In julia rational numbers can be constructed with the `//` operator. │ markdown
# Lets define two rational numbers, `x` and `y`: ┘ # Lets define two rational numbers, `x` and `y`: ┘
## Define variable x and y │
x = 1 // 3 │ x = 1 // 3 │
y = 2 // 5 │ code y = 2 // 5 │ code
@ -74,6 +76,7 @@ Lets define two rational numbers, `x` and `y`:
``` ```
Chunk #2: Chunk #2:
```julia ```julia
# Define variable x and y
x = 1 // 3 x = 1 // 3
y = 2 // 5 y = 2 // 5
``` ```

Loading…
Cancel
Save