You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: template-computo-python.qmd
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -48,34 +48,34 @@ jupyter: python3
48
48
49
49
## About this document
50
50
51
-
This document, accompanied with the [hopefully finely tuned git repos](https://github.com/computorg/template-computo-python/), provides a template for writing contributions to **Computo**[@computo]. We show how `Python` code can be included and how the repository can be set up for triggering github actions for rendering the document, with dependencies handled by `venv/pip`.
51
+
This document, accompanied by the [customized GitHub repository](https://github.com/computorg/template-computo-python/), provides a template for writing contributions to **Computo**[@computo]. We show how `Python` code can be included and how the repository can be set up for triggering GitHub actions for rendering the document, with dependencies handled by `venv` and `pip`.
52
52
53
-
## Setup a github repository for preparing your submission
53
+
## Setup a GitHub repository for preparing your submission
54
54
55
-
You can start by clicking the "use this template" button, on the top of the page of the [github repository associated to this document](https://github.com/computorg/template-computo-python/). Of course, you can set your repository private during the preparation of your manuscript.
55
+
You can start by clicking the "use this template" button, on the top of the page of the [github repository associated with this document](https://github.com/computorg/template-computo-python/). Of course, you can set your repository private during the preparation of your manuscript.
56
56
57
57
## Quarto
58
58
59
-
You need [quarto](https://quarto.org/) installed on your system and the [Computo extension](https://github.com/computorg/computo-quarto-extension) to prepare your document. For the latter, once quarto is installed, run the following to install the extension in the current directory (it creates a`_extension` directory which is ignored by git thanks to `.gitignore` by default):
59
+
You need [quarto](https://quarto.org/docs/get-started/) installed on your system and the [Computo extension](https://github.com/computorg/computo-quarto-extension) to prepare your document. For the latter, once quarto is installed, run the following to install the extension in the current directory (it creates an`_extension` directory which is ignored by git thanks to `.gitignore` by default):
60
60
61
61
```.bash
62
62
quarto add computorg/computo-quarto-extension
63
63
```
64
64
65
65
# Formatting
66
66
67
-
This section covers basic formatting guidelines for [Quarto](https://quarto.org/), a versatile formatting system for authoring document integrating markdown, LaTeX and various code block interpreted either via Jupyter or Knitr (and thus dealing with Python, R or Julia). It relies on the [Pandoc](https://pandoc.org/MANUAL.html) document converter.
67
+
This section covers basic formatting guidelines for [Quarto](https://quarto.org/), a versatile formatting system for authoring documents integrating markdown, LaTeX and code blocks interpreted either via Jupyter or Knitr (thus supporting Python, R or Julia). It relies on the [Pandoc](https://pandoc.org/MANUAL.html) document converter.
68
68
69
69
To render a document, run `quarto render`. By default, both PDF and HTML documents are generated:
70
70
71
71
```.bash
72
-
quarto render template-computo-python.qmd #will render both to html and PDF
72
+
quarto render template-computo-python.qmd #renders both HTML and PDF
73
73
```
74
74
75
75
::: {.callout-tip}
76
76
## Note
77
77
78
-
To check the syntax of the formatting below, you can use the `</> source` button at the top left of this document.
78
+
To check the syntax of the formatting below, you can use the `</> source` button at the top right of this document.
79
79
:::
80
80
81
81
## Basic markdown formatting
@@ -135,7 +135,7 @@ See @thm-slln.
135
135
136
136
## Python Code
137
137
138
-
Quarto uses either Jupyter or knitr to render code chunks. This can be triggered in the yaml header. In this tutorial, we use `Jupyter`, (`Python` and `Jupyter` must be installed on your computer)
138
+
Quarto uses either Jupyter or knitr to render code chunks. This can be triggered in the yaml header. In this tutorial, we use `Jupyter` (`Python` and `Jupyter` must be installed on your computer).
139
139
140
140
```yaml
141
141
---
@@ -237,7 +237,7 @@ To make your work reproducible, you need to fix the packages and environment use
237
237
python3 -m venv my_env
238
238
```
239
239
240
-
and activate it
240
+
and activate it
241
241
242
242
```.bash
243
243
source my_env/bin/activate
@@ -249,7 +249,7 @@ Then installed the packages required to perform your analysis. Here,
249
249
python3 -m pip install jupyter matplotlib numpy
250
250
```
251
251
252
-
Once you are all set up, you need to save your working environment into a file so that anyone can reproduce your analysis on his/her side:
252
+
Once you are all set up, you need to save your working environment into a file so that anyone can reproduce your analysis on their side:
253
253
254
254
```.bash
255
255
python3 -m pip freeze > requirements.txt
@@ -265,19 +265,19 @@ numpy
265
265
266
266
::: {.callout-important}
267
267
`requirements.txt` is the only file that needs to be versioned by git.
268
-
:::
268
+
:::
269
269
270
270
More details for using `venv` and `pip` can be found on the [quarto page dedicated to environments](https://quarto.org/docs/projects/virtual-environments.html#using-venv).
271
271
272
272
### What about `conda`?
273
273
274
-
For `conda`user, it is also possible to follow the same path with your favorite version of `conda`. There is a [quarto page dedicated to the conda environments](https://quarto.org/docs/projects/virtual-environments.html#using-conda).
274
+
For `conda`users, it is also possible to follow the same path with your favorite version of `conda`. There is a [quarto page dedicated to the conda environments](https://quarto.org/docs/projects/virtual-environments.html#using-conda).
275
275
276
276
## Continuous integration
277
277
278
-
The repository associated with this template is pre-configure to trigger an action on push that performs the following:
278
+
The repository associated with this template is pre-configured to trigger an action on push that performs the following:
279
279
280
-
1. Check out repository on the`ubuntu-latest` machine
280
+
1. Check out the repository on an`ubuntu-latest` machine
281
281
2. Install quarto and dependencies, including the Computo extension
282
282
3. Install Python (3.10) and dependencies with `venv`, using your `requirements.txt` file
283
283
4. Render your .qmd file and Publish the results on a gh-page (both HTML and PDF)
@@ -294,7 +294,7 @@ quarto publish gh-pages
294
294
```
295
295
296
296
Then, set the branch `gh-page` as the source of your github page, and trigger the action to check that everything works fine.
0 commit comments