Generated with Hugo using the docuapi theme.
The theme uses Hugo modules so instead of having a themes folder I refer to the theme as module in config.toml
.
Here is what I did to be able to serve the site locally:
-
I installed Go.
-
I ran
hugo mod init ugly-dummy
(I could have chosen another name).
For Netlify,
-
I used docuapi's own Netlify config as a guide.
-
I ran
npm init
to create thepackage.json
Netlify needs to install dependencies.
I wanted to display R code and its output as well as Shell code (curl&jq) and their output.
For that I tweaked the docuapi theme, and added two knitr hooks, see content/maintainers.Rmd and its results in content/maintainers.md.
-
Code chunks with no shell option are rendered in R code fences (output included)
-
Code chunks with results="asis" (for shell code) have the shell part of their source rendered in shell code fences and the pretty output in JSON code fences or XML code fences. These three languages (shell, JSON, XML) are rendered in the Shell tab.
-
From code chunks with results="asis", headers are rendered in YAML code fences that are displayed in a header tab.
When editing an Rmd, knit it to md using rmarkdown::render()
.
When editing several Rmd, source make.R
.
There is a GitHub Action workflow that renders all Rmd
- If a commit to master contains the string "[docs]" (inspired by Jenny Bryan's googledrive pkgdown workflow)
- Once a week, at 12:30 UTC on Mondays.