This is a Quarto-template for authoring longer, web-based documents at Statistics Norway that are not hosted by SSBs official website. When rendered, the book looks like this:
To use this template you need to have Quarto installed. Then you can copy down the relevant files from this repo by running the following command in your terminal:
quarto use template skars82/ssb-quarto-book
After running the above command the user will be prompted to trust the owner of this repo, and asked what the new folder should be named. After answering this prompt you can preview the example-files by running the following command in your terminal1:
quarto preview input-files
Alternatively, you can replace preview
with render
to render the entire book into html-files. The generated html-files will then be located in a folder called ./docs/
in the root of the project.
If you are using this template in SSBs new data platform, Dapla, it is recommended to create a ssb-project
before you run the above commands:
- Log in to Dapla.
- Open up a new terminal in your folder of choice.
- Create a ssb-project2.
- Delete the folder called
./src/
in the root of the project. - Run the commands from the chapter on Basic usage in your terminal.
Now you template is not at the root of the project. If you want this you have to move it. It is probably easier to have the folder input-files
at the root of the project. To get this you can just move the files and the delete the existing directory.
After previewing the example-files you can start to edit the files in the input-files
-folder. Some guidelines are provided in the example-book, else have a look at Quarto's documentation.
Footnotes
-
In your terminal you should run these commands from the root of the project. If you are in the root of the project you should see a folder called
/input-files/
when you run the commandls
in your terminal. If you do not see this file you are not in the root of the project. ↩ -
You can create a
ssb-project
with or without a corresponding GitHub-repo. Typically, when building a book, you would want to host it on GitHub Pages. If so, just creat a ssb-project with a GitHub-repo. ↩