Skip to content
Snippets Groups Projects
Commit 39c51333 authored by Régis Witz's avatar Régis Witz
Browse files

:globe_with_meridians: traduction/adaptation de 3 autres articles

parent 5e5fad0b
Branches
No related merge requests found
...@@ -56,8 +56,8 @@ pygmentCodeFences = true ...@@ -56,8 +56,8 @@ pygmentCodeFences = true
[[menu.main]] [[menu.main]]
name = "Blog" name = "Articles"
url = "" url = "post/"
weight = 1 weight = 1
[[menu.main]] [[menu.main]]
...@@ -79,13 +79,13 @@ pygmentCodeFences = true ...@@ -79,13 +79,13 @@ pygmentCodeFences = true
[[menu.main]] [[menu.main]]
parent = "samples" parent = "samples"
name = "Mathématiques" name = "Mathématiques"
url = "post/2017-03-05-math-sample" url = "post/maths"
weight = 2 weight = 2
[[menu.main]] [[menu.main]]
parent = "samples" parent = "samples"
name = "Programmation" name = "Programmation"
url = "post/2016-03-08-code-sample" url = "post/code-source"
weight = 3 weight = 3
[[menu.main]] [[menu.main]]
......
---
title: Code Sample
subtitle: Using Hugo or Pygments
date: 2016-03-08
tags: ["example", "code"]
---
The following are two code samples using syntax highlighting.
<!--more-->
The following is a code sample using triple backticks ( ``` ) code fencing provided in Hugo. This is client side highlighting and does not require any special installation.
```javascript
var num1, num2, sum
num1 = prompt("Enter first number")
num2 = prompt("Enter second number")
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
alert("Sum = " + sum) // "+" means combine into a string
```
The following is a code sample using the "highlight" shortcode provided in Hugo. This is server side highlighting and requires Python and Pygments to be installed.
{{< highlight javascript >}}
var num1, num2, sum
num1 = prompt("Enter first number")
num2 = prompt("Enter second number")
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
alert("Sum = " + sum) // "+" means combine into a string
{{</ highlight >}}
And here is the same code with line numbers:
{{< highlight javascript "linenos=inline">}}
var num1, num2, sum
num1 = prompt("Enter first number")
num2 = prompt("Enter second number")
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
alert("Sum = " + sum) // "+" means combine into a string
{{</ highlight >}}
---
title: Citer du code machine
subtitle: En utilisant Hugo ou Pygments
date: 2021-03-08
tags: ["exemple", "code"]
---
Vous pouvez aussi citer du code machine, par exemple du [Python](https://fr.wikipedia.org/wiki/Python_(langage)) ou du [R](https://fr.wikipedia.org/wiki/R_(langage)).
Ci-dessous, un extrait de code en langage R, cité en le délimitant avec ` ``` `.
```r
mafonction <- function(arg1, arg2) {
# ... ici un peu de code ...
return(object)
}
sommedescarres <- function(x) {
return(sum(x^2)) # Renvoie la somme des carrés des éléments de x
}
```
Ci-dessous, le même code, cité en utilisant le shortcode `highlight`.
{{< highlight r >}}
mafonction <- function(arg1, arg2) {
# ... ici un peu de code ...
return(object)
}
sommedescarres <- function(x) {
return(sum(x^2)) # Renvoie la somme des carrés des éléments de x
}
{{</ highlight >}}
Ci-dessous, la même chose avec des numéros de ligne, et en langage Python :
{{< highlight python "linenos=inline">}}
def mafonction(arg1, arg2):
# ... ici un peu de code ...
return o
def sommedescarres(x):
return sum(x^2) # Renvoie la somme des carrés des éléments de x
{{</ highlight >}}
--- ---
title: Math Sample title: Citer des formules mathématiques
subtitle: Using KaTeX subtitle: En utilisant KaTeX
date: 2017-03-05 date: 2021-03-05
tags: ["example", "math"] tags: ["exemple", "math"]
--- ---
KaTeX can be used to generate complex math formulas. It supports in-line math using the `\\( ... \\)` delimiters, like this: \\( E = mc^2 \\). By default, it does *not* support in-line delimiters `$...$` because those occur too commonly in typical webpages. It supports displayed math using the `$$` or `\\[...\\]` delimiters, like this: Des formules mathématiques complexes peuvent être affichées en utilisant le module KaTeX.
Vous pouvez insérer une formule directement dans le texte, en utilisant la syntaxe `\\( ... \\)`, comme ceci : \\( E = mc^2 \\).
Vous pouvez afficher des formules plus volumineuses en les encadrant de `$$` ou de `\\[...\\]`, comme ceci :
Formula 1: Première méthode :
$$ $$
\phi = \frac{(1+\sqrt{5})}{2} = 1.6180339887\cdots \phi = \frac{(1+\sqrt{5})}{2} = 1.6180339887\cdots
$$ $$
Formula 2: (same formula, different delimiter) Seconde méthode : (me formule, syntaxe différente)
\\[ \\[
\phi = \frac{(1+\sqrt{5})}{2} = 1.6180339887\cdots \phi = \frac{(1+\sqrt{5})}{2} = 1.6180339887\cdots
\\] \\]
Additional details can be found on [GitHub](https://github.com/Khan/KaTeX) or on the [Wiki](http://tiddlywiki.com/plugins/tiddlywiki/katex/). Pour en savoir plus, consultez [ce wiki](http://tiddlywiki.com/plugins/tiddlywiki/katex/), ou directement [le dépôt de KaTeX](https://github.com/Khan/KaTeX).
<!--more-->
### Example 1
If the text between $$ contains newlines it will rendered in display mode: ### Exemple 1
``` ```
$$ $$
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
...@@ -33,7 +34,8 @@ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi ...@@ -33,7 +34,8 @@ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
$$ $$
### Example 2 ### Exemple 2
``` ```
$$ $$
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } } \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
...@@ -44,7 +46,8 @@ $$ ...@@ -44,7 +46,8 @@ $$
$$ $$
### Example 3 ### Exemple 3
``` ```
$$ $$
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1. 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.
...@@ -54,17 +57,20 @@ $$ ...@@ -54,17 +57,20 @@ $$
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1. 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.
$$ $$
### Example 4
Remember, certain characters are rendered by markdown, so you may need to workaround those issues. You can find the complete list of KaTeX supported functions here: [https://khan.github.io/KaTeX/docs/supported.html](https://khan.github.io/KaTeX/docs/supported.html) ### Exemple 4
[Rappelez-vous]({{< ref "syntaxe-markdown.md" >}} "Article sur la syntaxe Markdown") que certains caractères ont une signification bien précise en Markdown.
En conséquence, il est nécessaire d'utiliser des alternatives.
Vous pouvez utilisr la syntaxe complète de KaTeX [sur cette page](https://khan.github.io/KaTeX/docs/supported.html).
For example, the `'` character can be replaced with `^\prime`: Par exemple, le caractère `'` peut être remplacé par `^\prime`:
$$ $$
G^\prime = G - u G^\prime = G - u
$$ $$
The `"` character can be replaced with `^{\prime\prime}`: Le caractère `"` peut être remplacé par `^{\prime\prime}`:
$$ $$
G^{\prime\prime} = G^\prime - v G^{\prime\prime} = G^\prime - v
......
--- ---
title: Test markdown title: Langage Markdown
subtitle: Each post also has a subtitle subtitle: Introduction à la syntaxe
date: 2015-02-20 date: 2021-02-20
tags: ["example", "markdown"] tags: ["exemple", "markdown"]
--- ---
You can write regular [markdown](http://markdowntutorial.com/) here and Jekyll will automatically convert it to a nice webpage. I strongly encourage you to [take 5 minutes to learn how to write in markdown](http://markdowntutorial.com/) - it'll teach you how to transform regular text into bold/italics/headings/tables/etc. Vous pouvez écrire directement du [Markdown](https://fr.wikipedia.org/wiki/Markdown), et il sera automatiquement converti en une page web. N'hésitez pas à [prendre 5 minutes pour apprendre la syntaxe du langage Markdown](http://markdowntutorial.com/fr/) ; cela vous apprendra comment mettre du texte *en italiques* ou **en gras**, comment définir des titres de différents niveaux, comment construire des tables, et ainsi de suite.
**Here is some bold text** **Ceci est du texte en gras**
## Here is a secondary heading ## Voilà un titre secondaire
Here's a useless table: Que diriez vous d'une délicieuse crêpe ?
| Number | Next number | Previous number |
| :------ |:--- | :--- |
| Five | Six | Four |
| Ten | Eleven | Nine |
| Seven | Eight | Six |
| Two | Three | One |
How about a yummy crepe? <!-- ceci est un commentaire, pour préciser que c'est trop bon les crêpes ! -->
![Crepe](http://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg) ![Crepe](http://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg)
Here's a code chunk with syntax highlighting: Et pourquoi pas une table pour manger autour ?
| Colonne | Autre colonne | Et une autre |
| :------ |:------------- | :----------- |
| Cinq | Six | Quatre |
| Dix | ʕᵔᴥᵔʔ | Neuf |
| Sept | Huit | ◖(。◕‿◕。)◗ ♪♫ |
| Deux | Trois | Deux mille vingt deux |
```javascript
var foo = function(x) {
return(x + 5);
}
foo(3)
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment