4. Output formats

4. Output formats

4.1. Markdown output

#' # Markdown                                                  ┐
#'                                                             │
#' This line is treated as markdown, since it starts with #'   │
#' The leading #' (including the space) is removed             ┘

#' Here is an example with some code                           ]

x = sin.(cos.([1, 2, 3]))                                      ┐
y = x.^2 - x                                                   ┘

By default, CodeChunks written to Documenter @example blocks. For example, the code above would result in the following markdown:

# Markdown

This line is treated as markdown, since it starts with #'
The leading #' (including the space) is removed

Here is an example with some code

```@example
x = sin.(cos.([1, 2, 3]))
y = x.^2 - x
```
Examples.markdownFunction.
Examples.markdown(inputfile, outputdir; kwargs...)

Generate a markdown file from inputfile and write the result to the directoryoutputdir.

Keyword arguments:

  • name: name of the output file, excluding .md. name is also used to name all the @example blocks. Defaults to the filename of inputfile.
  • preprocess, postprocess: custom pre- and post-processing functions, see the Custom pre- and post-processing section of the manual. Defaults to identity.
  • codefence: A Pair of opening and closing code fence. Defaults to
    "```@example $(name)" => "```"
  • documenter: boolean that says if the output is intended to use with Documenter.jl. Defaults to false. See the the manual section on Interaction with Documenter.
source

4.2. Notebook output

Examples.notebookFunction.
Examples.notebook(inputfile, outputdir; kwargs...)

Generate a notebook from inputfile and write the result to outputdir.

Keyword arguments:

  • name: name of the output file, excluding .ipynb. Defaults to the filename of inputfile.
  • preprocess, postprocess: custom pre- and post-processing functions, see the Custom pre- and post-processing section of the manual. Defaults to identity.
  • execute: a boolean deciding if the generated notebook should also be executed or not. Defaults to false.
  • documenter: boolean that says if the source contains Documenter.jl specific things to filter out during notebook generation. Defaults to false. See the the manual section on Interaction with Documenter.
source

4.3. Script output

Examples.scriptFunction.
Examples.script(inputfile, outputdir; kwargs...)

Generate a plain script file from inputfile and write the result to outputdir.

Keyword arguments:

  • name: name of the output file, excluding .jl. Defaults to the filename of inputfile.
  • preprocess, postprocess: custom pre- and post-processing functions, see the Custom pre- and post-processing section of the manual. Defaults to identity.
source