Commit 8293ca08 authored by Arnaud Legrand's avatar Arnaud Legrand

Translation

parent 590ed533
# -*- mode: org -*- # -*- mode: org -*-
#+TITLE: FIXME Introduction à Markdown #+TITLE: Introduction to Markdown
#+DATE: June, 2018 #+DATE: June, 2018
#+LANG: fr #+LANG: fr
#+STARTUP: overview indent #+STARTUP: overview indent
#+OPTIONS: num:nil toc:t #+OPTIONS: num:nil toc:t
This document presents a brief overview of the Markdown syntax and
Voici un aperçu rapide de la syntaxe Markdown repris d'une builds on a [[https://guides.github.com/features/mastering-markdown/][presentation from the Github team]] and [[http://csrgxtu.github.io/2015/03/20/Writing-Mathematic-Fomulars-in-Markdown/][blog post from
[[https://guides.github.com/features/mastering-markdown/][présentation de Github]] ainsi que de celles d'[[http://csrgxtu.github.io/2015/03/20/Writing-Mathematic-Fomulars-in-Markdown/][Archer Reilly]]. Archer Reilly]].
* Table des matières :TOC: * Table of Contents :TOC:
- [[#syntaxe][Syntaxe]] - [[#syntax][Syntax]]
- [[#headers][Headers]] - [[#headers][Headers]]
- [[#emphasis][Emphasis]] - [[#emphasis][Emphasis]]
- [[#lists][Lists]] - [[#lists][Lists]]
...@@ -17,16 +17,16 @@ Voici un aperçu rapide de la syntaxe Markdown repris d'une ...@@ -17,16 +17,16 @@ Voici un aperçu rapide de la syntaxe Markdown repris d'une
- [[#links][Links]] - [[#links][Links]]
- [[#blockquotes][Blockquotes]] - [[#blockquotes][Blockquotes]]
- [[#inline-code][Inline code]] - [[#inline-code][Inline code]]
- [[#écrire-des-maths][Écrire des Maths]] - [[#writing-math][Writing Math]]
- [[#lettres-grecques][Lettres grecques]] - [[#greek-letters][Greek Letters]]
- [[#fonctions-et-opérateurs][Fonctions et opérateurs]] - [[#usual-functions-and-operators][Usual functions and operators]]
- [[#exposants-et-indices][Exposants et indices]] - [[#exponents-and-indices][Exponents and indices]]
- [[#fractions-coefficients-binomiaux-racines-][Fractions, coefficients binomiaux, racines, ...]] - [[#fractions-binomial-coefficients-square-roots-][Fractions, binomial coefficients, square roots, ...]]
- [[#sommes-et-intégrales][Sommes et intégrales]] - [[#summations-and-integrals][Summations and integrals]]
- [[#déguisements][Déguisements]] - [[#outfits-smiley][Outfits \smiley]]
- [[#autour-de-markdown][Autour de =markdown=]] - [[#about-markdown][About =markdown=]]
* Syntaxe * Syntax
** Headers ** Headers
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
# This is an <h1> tag # This is an <h1> tag
...@@ -85,75 +85,74 @@ To print some text with python, you should use the `print()` function. ...@@ -85,75 +85,74 @@ To print some text with python, you should use the `print()` function.
print("Hello world!") print("Hello world!")
``` ```
#+END_EXAMPLE #+END_EXAMPLE
* Écrire des Maths * Writing Math
Il est possible d'écrire des formules en Markdown, soit en mode *inline* Math formulas are easy to write using Markdown, either using the
soit en mode *displayed formulas*. Dans le premier cas, les formules *inline* mode or the *displayed formulas* mode. With the inline mode,
sont inclues directement à l'intérieur du paragraphe courant alors formulas are inlined in the current paragraph whereas with the
que dans le second, elles apparaissent centrées et mises en exergue. displayed mode, they appear as centered and emphasized.
Le formatage de la formule est légèrement différent dans les deux cas The formatting generally slightly differs in both cases since, to
car pour qu'une formule s'affiche joliment sur une seule ligne, il display nicely on a single line, it is generally required to pack them
faut la "tasser" un peu plus que lorsqu'elle est mise en valeur. a bit more than when they are emphasized.
Pour écrire une formule en mode *inline*, il faut la délimiter par un =$= To write formulas using the *inline* mode, they should be surrounded by
(du coup, pour écrire le symbole dollar, il faut le préfixer par un a single =$= (as a consequence, whenever you need to use the original
backslash, comme ceci: =\$=) alors que pour écrire en mode *displayed*, il dollar symbol, you should prefix it with a backslash: =\$=). To write
faut la délimiter par un =$$=. Un petit exemple valant mieux qu'un long formulas using the *displayed* mode, they should be surrounded by a =$$=. Here are a few examples:
discours, voici concrètement comment cela fonctionne:
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
Cette expression $\sum_{i=1}^n X_i$ est inlinée. This expression $\sum_{i=1}^n X_i$ is inlined.
#+END_EXAMPLE #+END_EXAMPLE
Cette expression $\sum_{i=1}^n X_i$ est inlinée. This expression $\sum_{i=1}^n X_i$ is inlined.
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
Cette expression est mise en valeur: This expression is emphasized:
$$\sum_{i=1}^n X_i$$ $$\sum_{i=1}^n X_i$$
#+END_EXAMPLE #+END_EXAMPLE
Cette expression est mise en valeur: This expression is emphasized:
$$\sum_{i=1}^n X_i$$ $$\sum_{i=1}^n X_i$$
Nous vous présentons par la suite une sélection de symboles et de In the rest of this section we present a brief selection of common
commandes courantes. En fait, à peu près tout ce qui est classique symbols and commands. Actually, almost any classical LaTeX command
dans le langage LaTeX peut être utilisé pourvu que vous délimitiez can used as such in Markdown, provided it is surrounded by a =$=. For
bien avec un =$=. Pour d'autres exemples plus complets jetez un coup more complete examples, please have a look at these ces [[http://www.statpower.net/Content/310/R%2520Stuff/SampleMarkdown.html][examples by
d'œil à ces [[http://www.statpower.net/Content/310/R%2520Stuff/SampleMarkdown.html][exemples de James H. Steiger]]. James H. Steiger]].
** Lettres grecques ** Greek Letters
| Symbole | Commande | | Symbol | Command |
|---------+----------| |--------+---------|
| $\alpha$ | =$\alpha$= | | $\alpha$ | =$\alpha$= |
| $\beta$ | =$\beta$= | | $\beta$ | =$\beta$= |
| $\gamma$ | =$\gamma$= | | $\gamma$ | =$\gamma$= |
| $\Gamma$ | =$\Gamma$= | | $\Gamma$ | =$\Gamma$= |
| $\pi$ | =$\pi$= | | $\pi$ | =$\pi$= |
** Fonctions et opérateurs ** Usual functions and operators
| Symbole | Commande | | Symbol | Command |
|---------+----------| |--------+---------|
| $\cos$ | =$\cos$= | | $\cos$ | =$\cos$= |
| $\sin$ | =$\sin$= | | $\sin$ | =$\sin$= |
| $\lim$ | =$\lim$= | | $\lim$ | =$\lim$= |
| $\exp$ | =$\exp$= | | $\exp$ | =$\exp$= |
| $\to$ | =$\to$= | | $\to$ | =$\to$= |
| $\in$ | =$\in$= | | $\in$ | =$\in$= |
| $\forall$ | =$\forall$= | | $\forall$ | =$\forall$= |
| $\exists$ | =$\exists$= | | $\exists$ | =$\exists$= |
| $\equiv$ | =$\equiv$= | | $\equiv$ | =$\equiv$= |
| $\sim$ | =$\sim$= | | $\sim$ | =$\sim$= |
| $\approx$ | =$\approx$= | | $\approx$ | =$\approx$= |
| $\times$ | =$\times$= | | $\times$ | =$\times$= |
| $\le$ | =$\le$= | | $\le$ | =$\le$= |
| $\ge$ | =$\ge$= | | $\ge$ | =$\ge$= |
** Exposants et indices ** Exponents and indices
| Symbole | Commande | | Symbol | Command |
|---------+-----------| |---------+-----------|
| $k_{n+1}$ | =$k_{n+1}$= | | $k_{n+1}$ | =$k_{n+1}$= |
| $n^2$ | =$n^2$= | | $n^2$ | =$n^2$= |
| $k_n^2$ | =$k_n^2$= | | $k_n^2$ | =$k_n^2$= |
** Fractions, coefficients binomiaux, racines, ... ** Fractions, binomial coefficients, square roots, ...
| Symbole | Commande | | Symbol | Command |
|-----------------------------+-----------------------------| |-----------------------------+-----------------------------|
| $\frac{4z^3}{16}$ | =$\frac{4z^3}{16}$= | | $\frac{4z^3}{16}$ | =$\frac{4z^3}{16}$= |
| $\frac{n!}{k!(n-k)!}$ | =$\frac{n!}{k!(n-k)!}$= | | $\frac{n!}{k!(n-k)!}$ | =$\frac{n!}{k!(n-k)!}$= |
...@@ -162,13 +161,13 @@ d'œil à ces [[http://www.statpower.net/Content/310/R%2520Stuff/SampleMarkdown. ...@@ -162,13 +161,13 @@ d'œil à ces [[http://www.statpower.net/Content/310/R%2520Stuff/SampleMarkdown.
| $^3/_7$ | =$^3/_7$= | | $^3/_7$ | =$^3/_7$= |
| $\sqrt{k}$ | =$\sqrt{k}$= | | $\sqrt{k}$ | =$\sqrt{k}$= |
| $\sqrt[n]{k}$ | =$\sqrt[n]{k}$= | | $\sqrt[n]{k}$ | =$\sqrt[n]{k}$= |
** Sommes et intégrales ** Summations and integrals
| Symbole | Commande | | Symbol | Command |
|---------------------------------+--------------------------------------| |---------------------------------+--------------------------------------|
| $\sum_{i=1}^{10} t_i$ | =$\sum_{i=1}^{10} t_i$= | | $\sum_{i=1}^{10} t_i$ | =$\sum_{i=1}^{10} t_i$= |
| $\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x$ | =$\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x$= | | $\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x$ | =$\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x$= |
** Déguisements ** Outfits \smiley
| Symbole | Commande | | Symbol | Command |
|-----------------------+-----------------------| |-----------------------+-----------------------|
| $\hat{a}$ | =$\hat{a}$= | | $\hat{a}$ | =$\hat{a}$= |
| $\bar{a}$ | =$\bar{a}$= | | $\bar{a}$ | =$\bar{a}$= |
...@@ -176,22 +175,22 @@ d'œil à ces [[http://www.statpower.net/Content/310/R%2520Stuff/SampleMarkdown. ...@@ -176,22 +175,22 @@ d'œil à ces [[http://www.statpower.net/Content/310/R%2520Stuff/SampleMarkdown.
| $\ddot{a}$ | =$\ddot{a}$= | | $\ddot{a}$ | =$\ddot{a}$= |
| $\overrightarrow{AB}$ | =$\overrightarrow{AB}$= | | $\overrightarrow{AB}$ | =$\overrightarrow{AB}$= |
* Autour de =markdown= * About =markdown=
Tout d'abord, pour aller plus loin avec =markdown= et ses extensions / ramifications : First of all, to know more about =markdown= and its extensions, you may want to read:
- Le didacticiel « [[https://enacit1.epfl.ch/markdown-pandoc/][Élaboration et conversion de documents avec Markdown et Pandoc]] » de Jean-Daniel Bonjour (EPFL), précis, complet, concis, en français ; un vrai bonheur ! - The « [[https://enacit1.epfl.ch/markdown-pandoc/][Élaboration et conversion de documents avec Markdown et Pandoc]] » tutorial by Jean-Daniel Bonjour (EPFL). A must-read in French...
- L'article [[https://en.wikipedia.org/wiki/Markdown#Example][Markdown]] de wikipedia en anglais contient un bon pense-bête sur la syntaxe =markdown=. - The wikipedia article on [[https://en.wikipedia.org/wiki/Markdown#Example][Markdown]] provides a good overview of the =markdown= syntax.
- Github propose un court et efficace didacticiel (en anglais) : [[https://guides.github.com/features/mastering-markdown/][Mastering Markdown]]. - Github proposes a short and efficient introduction: [[https://guides.github.com/features/mastering-markdown/][Mastering Markdown]].
Comme nous l'illustrons dans la « film d'écran » (/screencast/), l'éditeur de texte des dépôts =github= et =gitlab= permet d'interpréter / transformer à la demande un fichier =mardown= en un fichier =html=. C'est à la fois agréable et pratique, mais ce n'est pas une solution pour une utilisation quotidienne de =markdown=, pour cela, il est plus efficace d'éditer son texte, avec un éditeur de texte, sur son ordinateur, avant de « l'exporter » dans un format comme =html=, =pdf=, =docx=, =epub=, etc. Il existe des éditeurs plus ou moins spécialisés pour =markdown=, certains sont indiqués sur la page [[https://github.com/jgm/pandoc/wiki/Pandoc-Extras#editors][Editors]] du site de =pandoc=, mais nous préconisons clairement l'emploi d'un éditeur de texte « généraliste » capable de reconnaître la syntaxe =markdown=. Nous en avons indiqué en début de séquence et on pourra trouver des informations complémentaires dans la section [[https://enacit1.epfl.ch/markdown-pandoc/#editeurs_markdown][Quelques éditeurs adaptés à l'édition Markdown]] du didacticiel de Jean-Daniel Bonjour. As we explain in the video, =github= and =gitlab= allow you to easily edit =mardown= documents and to render them in =html=. This is quite convenient but may be a bit cumbersome for a daily use. You may prefer to edit these documents with a real editor and later to export them in whichever format you may like (=html=, =pdf=, =docx=, =epub=, etc). There are a few editors specifically designed for =markdown= (see for example the [[https://github.com/jgm/pandoc/wiki/Pandoc-Extras#editors][Editors]] page of the =pandoc= website) but we rather advise you to use a general-purpose editor that is capable of handling the =markdown= syntax. A few ones were mentioned in the beginning of the video and additional information are available in the [[https://enacit1.epfl.ch/markdown-pandoc/#editeurs_markdown]["Quelques éditeurs adaptés à l'édition Markdown"]] section of Jean-Daniel Bonjour's tutorial.
Pour convertir un fichier =markdown= en un format « arbitraire », la solution à ce jour la plus complète est [[http://pandoc.org/][Pandoc]], logiciel développé par John MacFarlane, un philosophe de Berkeley (le site [[https://github.com/jgm/pandoc][github]]). En plus du site de =Pandoc=, le didacticiel de J.-D. Bonjour donne de nombreuses explications sur comment installer et utiliser =pandoc= dans la section [[https://enacit1.epfl.ch/markdown-pandoc/#commande_pandoc][Utilisation du convertisseur Pandoc]]. Comme =pandoc= -- écrit en Haskell -- peut être parfois un peu difficile à installer, nous indiquons maintenant quelques solutions alternatives : To convert =markdown= in an "arbitrary" other format, the best solution today is [[http://pandoc.org/][Pandoc]], a software developed by John MacFarlane, a philosopher from de Berkeley, and whose [[https://github.com/jgm/pandoc][main page is on github]]. J.-D. Bonjour's tutorial provides many explanations on how to install and use =pandoc= in the [[https://enacit1.epfl.ch/markdown-pandoc/#commande_pandoc][Utilisation du convertisseur Pandoc]] section. =pandoc= is written in Haskell and may be a bit cumbersome to install. Therefore, we provide here a few alternative solutions:
- Des sites comme [[http://www.markdowntopdf.com/]] et [[http://markdown2pdf.com/]] permettent de convertir en ligne un fichier =markdown= en un fichier =pdf=. - Some websites like [[http://www.markdowntopdf.com/]] or [[http://markdown2pdf.com/]] allow you to convert online =markdown= files into =pdf= files without having to install anything on your computer.
- Le projet [[http://commonmark.org/][CommonMark]] propose, en plus d'une spécifications plus rigoureuse de la syntaxe =markdown=, des convertisseurs =markdown= → =html= / =LaTeX= (et plus) écris en =C= et en =JavaScript= ([[https://github.com/CommonMark/CommonMark]]). - The [[http://commonmark.org/][CommonMark]] project proposes a rigorous specification of the =markdown= syntax and converters =markdown= → =html= / =LaTeX= written in =C= and =JavaScript= ([[https://github.com/CommonMark/CommonMark]]).
- Le site de [[https://daringfireball.net/projects/markdown/][John Gruber]], le créateur de =markdown=, fournit un convertisseur =markdown= → =html= écrit en =perl=. - You will find on the website of [[https://daringfireball.net/projects/markdown/][John Gruber]], the creator of =markdown=, a =markdown= → =html= converter written in =perl=.
- [[http://fletcherpenney.net/multimarkdown/][MultiMarkdown]] est une autre extension de =markdown= qui vient avec son convertisseur =markdown= → =html= écrit en =C=. - [[http://fletcherpenney.net/multimarkdown/][MultiMarkdown]] is another =markdown= extension that provides its own =markdown= → =html= converter written in =C=.
- [[https://github.com/joeyespo/grip][grip]] est un serveur écrit en =python= qui permet de convertir et visualiser à la volée des fichiers =markdown= avec son navigateur (très utile pour éviter d'avoir à faire des « commits » en grande quantité lorsqu'on écrit de tels fichiers pour un dépôt =github= ou =gitlab=). - [[https://github.com/joeyespo/grip][grip]] is a =python=-based server that allows you to convert on the fly =markdown= documents and to preview them with your favorite browser (this is quite useful to avoid useless commits just for the sake of previewing when using =github= ou =gitlab=).
La conversion en =pdf= passe toujours par [[https://fr.wikipedia.org/wiki/LaTeX][LaTeX]] ce qui nécessite d'avoir une version complète et à jour de ce logiciel sur sa machine. The =pdf= conversion always relies on [[https://fr.wikipedia.org/wiki/LaTeX][LaTeX]], which requires a full-fledged and running LaTeX installation on your computer.
Dans la petite démonstration, nous montrons comment générer un fichier =docx= à partir d'un fichier =md= avec =Pandoc= et nous soulignons qu'il est alors possible d'utiliser un traitement de texte comme =LibreOffice= pour modifier le fichier obtenu. Il est clair que si des modifications sont apportées au =docx= elle en seront pas (automatiquement) propagées au =md=. Il faudra utiliser =Pandoc= pour cela et effectuer une conversion de =docx= vers =md= (et seules les éléments du format =docx= qui existent en =md= seront conservés). In the demo, we show how to generate a =docx= from a =markdown= document with =Pandoc= and we explain that it is then possible to use a word processor like =LibreOffice= to edit the resulting file. Obviously the modifications will not be back-propagated to the original =markdown= document. You may however want to use =Pandoc= again to convert your new =docx= document to a new =markdown= document.
Une stratégie qui est souvent employée et qui fonctionne bien en pratique consiste à faire le gros du travail de rédaction d'un article ou d'un mémoire en =Markdown=. La rédaction terminée, le fichier est exporté au format =docx= (ou =LaTeX=) et des ajustements de mise en page sont alors effectués avec un logiciel de traitement de texte (ou un éditeur =LaTeX=). Another common strategy consists in doing most of the editing of an article/report in =Markdown= and to export it into a =docx= (or =LaTeX=) only in the end so as to prepare it for a camera-ready version with a standard word processing environment (or a =LaTeX= editor).
Markdown is supported
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