Commit 39c51333 authored by R茅gis Witz's avatar R茅gis Witz
Browse files

馃寪 traduction/adaptation de 3 autres articles

parent 5e5fad0b
......@@ -56,8 +56,8 @@ pygmentCodeFences = true
[[menu.main]]
name = "Blog"
url = ""
name = "Articles"
url = "post/"
weight = 1
[[menu.main]]
......@@ -79,13 +79,13 @@ pygmentCodeFences = true
[[menu.main]]
parent = "samples"
name = "Math茅matiques"
url = "post/2017-03-05-math-sample"
url = "post/maths"
weight = 2
[[menu.main]]
parent = "samples"
name = "Programmation"
url = "post/2016-03-08-code-sample"
url = "post/code-source"
weight = 3
[[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
subtitle: Using KaTeX
date: 2017-03-05
tags: ["example", "math"]
title: Citer des formules math茅matiques
subtitle: En utilisant KaTeX
date: 2021-03-05
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
$$
Formula 2: (same formula, different delimiter)
Seconde m茅thode : (m锚me formule, syntaxe diffrente)
\\[
\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/).
<!--more-->
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).
### 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
......@@ -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} } } }
......@@ -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.
......@@ -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.
$$
### 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
$$
The `"` character can be replaced with `^{\prime\prime}`:
Le caract猫re `"` peut 锚tre remplac茅 par `^{\prime\prime}`:
$$
G^{\prime\prime} = G^\prime - v
......
---
title: Test markdown
subtitle: Each post also has a subtitle
date: 2015-02-20
tags: ["example", "markdown"]
title: Langage Markdown
subtitle: Introduction 脿 la syntaxe
date: 2021-02-20
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:
| Number | Next number | Previous number |
| :------ |:--- | :--- |
| Five | Six | Four |
| Ten | Eleven | Nine |
| Seven | Eight | Six |
| Two | Three | One |
Que diriez vous d'une d茅licieuse cr锚pe ?
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)
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)
```
Supports Markdown
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