<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Julia Community 🟣: Ronny Bergmann</title>
    <description>The latest articles on Julia Community 🟣 by Ronny Bergmann (@kellertuer).</description>
    <link>https://forem.julialang.org/kellertuer</link>
    <image>
      <url>https://forem.julialang.org/images/d-GMnbqwcDsdGbI8jMtVdoWWmiijptzE5j_ambPS72Q/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L3VzZXIvcHJvZmls/ZV9pbWFnZS82MzYv/NDAwZTczZDYtMjQ5/YS00MTU3LTlhZGMt/OTljOTc1MzQwYTY0/LmpwZWc</url>
      <title>Julia Community 🟣: Ronny Bergmann</title>
      <link>https://forem.julialang.org/kellertuer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.julialang.org/feed/kellertuer"/>
    <language>en</language>
    <item>
      <title>Improve your documentation using Vale.sh</title>
      <dc:creator>Ronny Bergmann</dc:creator>
      <pubDate>Fri, 17 Nov 2023 09:34:38 +0000</pubDate>
      <link>https://forem.julialang.org/kellertuer/improve-your-documentation-using-valesh-5587</link>
      <guid>https://forem.julialang.org/kellertuer/improve-your-documentation-using-valesh-5587</guid>
      <description>&lt;p&gt;having unified and well-readable documentation is an important aspect of providing the user of a Julia package to not only get started, but to also use the package throughout. For example there are the &lt;a href="https://developers.google.com/style/"&gt;Google developer documentation style guide&lt;/a&gt; or the &lt;a href="https://docs.microsoft.com/en-us/style-guide/welcome/"&gt;Microsoft Writing Style Guide&lt;/a&gt;.&lt;br&gt;
In my own experience, these guides are only followed, if a developer (here: myself) is reminded often enough to follow them. I recently added a GitHub action to my Package repository to &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/master/.github/workflows/changelog.yml"&gt;remember to update the Changelog&lt;/a&gt; before merging a PR.&lt;/p&gt;

&lt;p&gt;I would like to present a short introduction on how to set up a check for the above style guides using the example of the Google set of rules for your Julia package documentation. This is inspired by the setup of &lt;a href="https://jump.dev"&gt;JuMP.jl&lt;/a&gt;, where I personally stumbled into this.&lt;/p&gt;
&lt;h1&gt;
  
  
  Installation and setup.
&lt;/h1&gt;

&lt;p&gt;For the style guides there exists the nice project &lt;a href="//vale.sh"&gt;vale.sh&lt;/a&gt;, which can for example be easily &lt;a href="https://vale.sh/docs/vale-cli/installation/"&gt;installed&lt;/a&gt; using &lt;a href=""&gt;homebrew&lt;/a&gt; on Mac OS.&lt;/p&gt;

&lt;p&gt;After that, we can call &lt;code&gt;vale&lt;/code&gt; on terminal, which for example accepts a folder to check all files in.&lt;/p&gt;

&lt;p&gt;To setup &lt;code&gt;vale&lt;/code&gt; for your documentation, create a &lt;code&gt;docs/.vale.ini&lt;/code&gt; in the &lt;code&gt;docs&lt;/code&gt; folder. Mine has the following content&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;StylesPath = styles
MinAlertLevel = warning
Vocab = Manopt

Packages = Google

[*.md]
BasedOnStyles = Vale, Google
TokenIgnores =          \
    \$.+?\$,            \
    \]\(@(ref|id|cite).+?\), \
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first two lines tell vale, that styles are stored in &lt;code&gt;docs/styles&lt;/code&gt;, and that we want to see already warnings and not only errors (but not suggestions).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Vocab = Manopt&lt;/code&gt; means that in the file &lt;code&gt;docs/styles/Vocab/Manopt/accept.txt&lt;/code&gt; we collect (one entry per line) words, especially names, that are not considered errors, mine for example contains&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Manifolds.jl
[Mm]anopt(:?.org|.jl)?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;such that &lt;code&gt;Manifolds.jl&lt;/code&gt; is considered a correct word, as well as &lt;code&gt;manopt&lt;/code&gt; both with M and m upfront, and with or without the suffixes .org and .jl – so regular expressions an also be used therein.&lt;/p&gt;

&lt;p&gt;We also specify that we want to use the &lt;code&gt;Google&lt;/code&gt; package – especially on Markdown files. Within these, we want to ignore math &lt;code&gt;$...$&lt;/code&gt; and documenter style id/ref/cite entries.&lt;/p&gt;

&lt;h1&gt;
  
  
  Running Vale
&lt;/h1&gt;

&lt;p&gt;With this setup, we can already call &lt;code&gt;vale sync&lt;/code&gt; (from within the &lt;code&gt;docs/&lt;/code&gt; folder) for setup, which installs the &lt;code&gt;Google&lt;/code&gt; package for the above developer guidelines. after that &lt;code&gt;vale src&lt;/code&gt; checks its rules on the files in the &lt;code&gt;docs/src&lt;/code&gt; folder, which for us means all Markdown files.&lt;/p&gt;

&lt;p&gt;Another possibility is to use the &lt;a href="https://marketplace.visualstudio.com/items?itemName=ChrisChinchilla.vale-vscode"&gt;VS Code extension&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Finally, one can add a run of vale for example to the documenter run on CI, since vale also provides several GitHub actions. My &lt;code&gt;documenter.yml&lt;/code&gt; contains the step&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      - name: "vale.sh spell check"
        uses: errata-ai/vale-action@reviewdog
        with:
          files: docs/src
          fail_on_error: true
          filter_mode: nofilter
          vale_flags: "--config=docs/.vale.ini"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which besides running the same &lt;code&gt;vale src&lt;/code&gt; as above also does the &lt;code&gt;vale sync&lt;/code&gt; setup before, so there is no need to check in the automatically installed &lt;code&gt;styles&lt;/code&gt; like the &lt;code&gt;Google&lt;/code&gt; one from this example.&lt;/p&gt;

&lt;h1&gt;
  
  
  Vale.sh your code files
&lt;/h1&gt;

&lt;p&gt;Besides just the Markdown files in the docs, you can also put the &lt;code&gt;vale.ini&lt;/code&gt; into your main folder and adapt it to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;StylesPath = docs/styles
MinAlertLevel = warning
Vocab = Manopt

Packages = Google

[*.{md,jl}]
BasedOnStyles = Vale, Google
TokenIgnores =          \
    \$.+?\$,            \
    \]\(@(ref|id|cite).+?\), \
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since Vale 2.30, Julia files can also be checked. To be precise, doc strings, strings, comments are also run through vale. Of course you also have to adapt the CI accordingly.&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;The start might take a while to work through ones own documentation and doc strings and follow a style, but I for example learned to avoid &lt;code&gt;i.e.&lt;/code&gt; in documentations by now and to unify several styles, like capitalisation of headings even more.&lt;/p&gt;

</description>
      <category>documentation</category>
      <category>vale</category>
    </item>
    <item>
      <title>Render Quarto Tutorials in Documenter.jl with GitHub Actions</title>
      <dc:creator>Ronny Bergmann</dc:creator>
      <pubDate>Fri, 30 Jun 2023 10:58:12 +0000</pubDate>
      <link>https://forem.julialang.org/kellertuer/render-quarto-tutorials-in-documenterjl-with-github-actions-3fo</link>
      <guid>https://forem.julialang.org/kellertuer/render-quarto-tutorials-in-documenterjl-with-github-actions-3fo</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I am a large fan of tutorials to provide users an easy start for example when using a new Julia package. For best of cases, a tutorial contains code that can not only be run by the user, but that is also&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;run in the example to illustrate which result to expect&lt;/li&gt;
&lt;li&gt;included in the documentation and matches in style&lt;/li&gt;
&lt;li&gt;consistent – that is does not suddenly break &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These points brought me to &lt;a href="https://quarto.org/"&gt;quarto&lt;/a&gt;, since it is easy to write, in markdown + Julia Code, get‘s rendered into Markdown, which can be stored in the documentation folder easily to match the general style. One can even reference other functions in the documentation using just &lt;a href="https://documenter.juliadocs.org/stable/man/syntax/#@ref-link"&gt;&lt;code&gt;@ref&lt;/code&gt;&lt;/a&gt; from Documenter.&lt;br&gt;
My favourite feature of Quarto is that, since it is just Julia Code evaluated, it allowed to use local environments for consistency. For a package, I prefer to change one small thing from pure consistency, that is, load always the master branch of the package the documentation / tutorial is for. This way, one can easily check, that also the tutorials are not breaking.&lt;/p&gt;

&lt;p&gt;Since this workflow means, that some markdown files of the documentation, it would be great to have the examples automatically run on &lt;a href="https://github.com/features/actions"&gt;GitHub CI&lt;/a&gt; when generating the documentation. &lt;br&gt;
Of course, since some examples might take a bit to run, caching them would also be great. Luckily, Quarto already has a &lt;code&gt;_freeze&lt;/code&gt; mechanism.&lt;/p&gt;
&lt;h2&gt;
  
  
  Structure of this tutorial
&lt;/h2&gt;

&lt;p&gt;After a short explanation of the setup we use in &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/"&gt;&lt;code&gt;Manopt.jl&lt;/code&gt;&lt;/a&gt;, this tutorial explains how to set up you Documentation CI to also include Quarto examples to be run, if they have been changed.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;In the &lt;code&gt;Manopt.jl&lt;/code&gt; structure, the tutorials share a common environment in &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/tree/master/tutorials"&gt;&lt;code&gt;tutorials/&lt;/code&gt;&lt;/a&gt;, with their own &lt;code&gt;Project.toml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Each of the tutorials should be developed locally and tested with &lt;code&gt;quarto render&lt;/code&gt; (or &lt;code&gt;quarto preview&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;This workflow was developed with Julia 1.9 and Quarto 1.3&lt;/p&gt;
&lt;h2&gt;
  
  
  Handling Python Dependencies
&lt;/h2&gt;

&lt;p&gt;A main challenge of rendering quarto markdown files is, that this is done with &lt;a href="https://jupyter.org"&gt;Jupyter&lt;/a&gt; and hence requires python as a dependency.&lt;/p&gt;

&lt;p&gt;So there is a necessity to handle python dependencies when/before running quarto. Since this happens within the documentation, the &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/master/docs/Project.toml"&gt;environment Project.toml&lt;/a&gt; for the &lt;code&gt;docs/&lt;/code&gt; folder takes care of this employing &lt;a href="https://github.com/cjdoris/CondaPkg.jl"&gt;CondaPkg.jl&lt;/a&gt;, see also the &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/master/docs/CondaPkg.toml"&gt;CondaPkg.toml&lt;/a&gt; file, which is quite minimal.&lt;/p&gt;

&lt;p&gt;Together with &lt;a href="https://github.com/JuliaLang/IJulia.jl"&gt;&lt;code&gt;IJulia.jl&lt;/code&gt;&lt;/a&gt; just calling&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight julia"&gt;&lt;code&gt;&lt;span class="n"&gt;CondaPkg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;withenv&lt;/span&gt;&lt;span class="x"&gt;()&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="x"&gt;[&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="x"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;allows to execute command line calls with the specified python packages (here only Jupyter) installed &lt;em&gt;and&lt;/em&gt; having a Julia kernel available&lt;/p&gt;

&lt;h2&gt;
  
  
  Documentation: Modifying the &lt;code&gt;make.jl&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;In order to make the tutorials only render when specified, the &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/master/docs/make.jl"&gt;&lt;code&gt;make.jl&lt;/code&gt;&lt;/a&gt; is executable and has as a first line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env Julia&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way a normal run of building the documentation, for example running &lt;code&gt;include("make.jl")&lt;/code&gt; on REPL would not trigger running all tutorials, but on terminal doing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./make.jl --quarto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;does. The idea is that either &lt;code&gt;quarto render&lt;/code&gt; or the command line call would only be executed from time to time and usually the &lt;code&gt;.md&lt;/code&gt; files from the tutorials are already rendered and available in the documentation source tree.&lt;/p&gt;

&lt;p&gt;Besides that, the &lt;code&gt;make.jl&lt;/code&gt; contains &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/c8c175fc260a4d8255fe2688e0751bb0833ae515/docs/make.jl#L17C1-L30C4"&gt;a block&lt;/a&gt; that, given &lt;code&gt;--quarto&lt;/code&gt;, renders all &lt;code&gt;.qmd&lt;/code&gt; files.&lt;/p&gt;

&lt;p&gt;To be safe, this block not only runs in the &lt;code&gt;CondaPkg&lt;/code&gt; environment, but also resolves/instantiates the tutorial folder for once, but also makes sure, the new Jupyter (if not from cache) is aware of the &lt;code&gt;IJulia&lt;/code&gt; kernel by once building that package in the tutorials environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight julia"&gt;&lt;code&gt;&lt;span class="n"&gt;CondaPkg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;withenv&lt;/span&gt;&lt;span class="x"&gt;()&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="nd"&gt;@info&lt;/span&gt; &lt;span class="s"&gt;"Rendering Quarto"&lt;/span&gt;
    &lt;span class="n"&gt;tutorials_folder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@__DIR__&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="s"&gt;"/../tutorials"&lt;/span&gt;
    &lt;span class="c"&gt;# instantiate the tutorials environment if necessary&lt;/span&gt;
    &lt;span class="n"&gt;Pkg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;activate&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tutorials_folder&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;Pkg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="x"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;Pkg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;instantiate&lt;/span&gt;&lt;span class="x"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;Pkg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"IJulia"&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt; &lt;span class="c"&gt;# build IJulia to the right version.&lt;/span&gt;
    &lt;span class="n"&gt;Pkg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;activate&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@__DIR__&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt; &lt;span class="c"&gt;# but return to the docs one before&lt;/span&gt;
    &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`quarto render $(tutorials_folder)`&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/c8c175fc260a4d8255fe2688e0751bb0833ae515/tutorials/_quarto.yml#L3"&gt;the quarto config&lt;/a&gt; is set up to store the results in the documentation &lt;code&gt;docs/src&lt;/code&gt; directory, they are rendered when running &lt;code&gt;make.jl&lt;/code&gt; into html. Here, the &lt;code&gt;quarto&lt;/code&gt; command is also run within the environment having the python packages installed, as discussed in the last section.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI: Modifying the GitHub Action
&lt;/h2&gt;

&lt;p&gt;The second part of this tutorial is concerned with the &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/c8c175fc260a4d8255fe2688e0751bb0833ae515/.github/workflows/documenter.yml"&gt;&lt;code&gt;documenter.yml&lt;/code&gt;&lt;/a&gt; workflow, which is modified to also allow caching of the results.&lt;/p&gt;

&lt;p&gt;We first install Quarto with the corresponding action&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- uses: quarto-dev/quarto-actions/setup@v2
  with:
    version: 1.3.353
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the main part is, to cache quite a few folders between CI runs. This is done by Hashing the corresponding folder and allowing to load old caches from this folder as well.&lt;br&gt;
We cache&lt;/p&gt;
&lt;h3&gt;
  
  
  Julia
&lt;/h3&gt;

&lt;p&gt;Which is possible with its own cache&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- name: Julia Cache
  uses: julia-actions/cache@v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Quarto
&lt;/h3&gt;

&lt;p&gt;Since quarto stores pre-rendered results in the &lt;code&gt;_freeze&lt;/code&gt; subfolder, we cache this folder. Note that the restored keys allow to also load previous versions, where the current hash does not hit, that way, if some tutorial is changed, the unchanged ones still obtain their old cached versions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- name: Cache Quarto
  id: cache-quarto
  uses: actions/cache@v3
  env:
    cache-name: cache-quarto
  with:
    path: tutorials/_freeze
    key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('tutorials/*.qmd') }}
    restore-keys: |
      ${{ runner.os }}-${{ env.cache-name }}-
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Documenter
&lt;/h3&gt;

&lt;p&gt;Since we also want to cache the old &lt;code&gt;.md&lt;/code&gt; files that &lt;code&gt;quarto&lt;/code&gt; stores within the documenter tree, we also cache that folder&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- name: Cache Documenter
  id: cache-documenter
  uses: actions/cache@v3
  env:
    cache-name: cache-documenter
  with:
    path: docs/src/tutorials
    key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('tutorials/*.qmd') }}
    restore-keys: |
      ${{ runner.os }}-${{ env.cache-name }}-
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  CondaPkg
&lt;/h3&gt;

&lt;p&gt;It might be useful to also cache the downloaded artefacts from CondaPkg&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- name: Cache CondaPkg
  id: cache-condaPkg
  uses: actions/cache@v3
  env:
    cache-name: cache-condapkg
  with:
    path: docs/.CondaPkg
    key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('docs/CondaPkg.toml') }}
    restore-keys: |
      ${{ runner.os }}-${{ env.cache-name }}-
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally we modify the call to run the documentation rendering such that it always runs the rendering. This will only include changed tutorials, since the others are cached due to all the caches above&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- name: "Documenter rendering (including Quarto)"
  run: "docs/make.jl --quarto"
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;While a bit technical with all the caches, this modification of the documentation build run and the documentation GitHub Action allows to automatically build quarto notebooks within the documentation. This way there is no need to commit the (pre-)rendered markdown files in the documentation, which might have led to them being outdated. Since all the caches avoid running the tutorials on every run, the GitHub CI run is still reasonably fast.&lt;/p&gt;

&lt;p&gt;The main files to look at are in summary&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/master/tutorials/_quarto.yml"&gt;&lt;code&gt;tutorials/_quarto.yml&lt;/code&gt;&lt;/a&gt; to configure Quarto, mainly to store the result directly in the &lt;code&gt;docs/src/tutorials/&lt;/code&gt; folder&lt;/li&gt;
&lt;li&gt;the &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/master/docs/make.jl"&gt;&lt;code&gt;docs/make.jl&lt;/code&gt;&lt;/a&gt; file to render the documentation &lt;em&gt;including&lt;/em&gt; running the quarto rendering, but especially also the python dependencies.&lt;/li&gt;
&lt;li&gt;the &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/master/.github/workflows/documenter.yml"&gt;&lt;code&gt;.github/workflows/documenter.yml&lt;/code&gt;&lt;/a&gt; especially with a bit of caches.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Open Problems
&lt;/h2&gt;

&lt;p&gt;Two tutorials are currently still rendered locally, see the &lt;a href="https://github.com/JuliaManifolds/Manopt.jl/blob/master/tutorials/_quarto.yml"&gt;&lt;code&gt;_quarto.yml&lt;/code&gt;&lt;/a&gt;, one since it requires Asymptote for rendering, which is not so easy to get on CI, and the other one since benchmarking might be a bit too slow on CI.&lt;/p&gt;

&lt;p&gt;Since the &lt;code&gt;.md&lt;/code&gt; of the tutorials are not committed to the GitHub repository, but only cached/regenerated on CI before running &lt;code&gt;Documenter.jl&lt;/code&gt;, &lt;code&gt;Edit on GitHub&lt;/code&gt; link is broken for these. It would be nice to add a link here to the &lt;code&gt;.qmd&lt;/code&gt; file in the &lt;code&gt;tutorials/&lt;/code&gt; folder instead.&lt;/p&gt;

</description>
      <category>documenter</category>
      <category>quarto</category>
      <category>github</category>
      <category>ci</category>
    </item>
  </channel>
</rss>
