blog/content/tips/emails-md-fr.md

86 lines
4.3 KiB
Markdown
Raw Normal View History

2019-04-24 04:54:21 +00:00
---
Title: Écrire son courriel en markdown avec vim
Date: 2019-04-22 19:00
Modified: 2019-04-24 09:35
Author: Fabrice
2019-04-24 05:56:23 +00:00
Category: astuces
2019-04-24 04:54:21 +00:00
Tags: emails, pandoc, Vim
Slug: vim-md-emails
Header_Cover: ../images/covers/amsterdam.jpg
2019-04-24 06:34:03 +00:00
Summary: Un exemple dutilisation combinée de vim et dautres outils pour utiliser facilement des modèles de-mails en markdown.
2019-04-24 04:54:21 +00:00
Lang: fr
---
Si comme moi vous naimez pas passer du temps dans des éditeurs <abbr title="What You See Is What You Get">WYSIWYG</abbr> pour formater vos textes, vous serez possiblement intéressés par cette petite astuce.
2019-04-24 06:34:03 +00:00
Malgré ça, jutilise quand même [thunderbird](https://www.thunderbird.net/) comme client mail sur mon ordinateur.
Et on peut remarquer que lorsquon copie-colle depuis une page web (par exemple depuis [firefox](https://www.mozilla.org/fr/firefox/), le style de texte est aussi copié (ce qui peut parfois causer des incohérences dans le style de texte sans que ce soit visible à lédition, mais cest un autre problème).
En utilisant cette remarque, on peut directement exporter de lhtml dans le presse-papier et le coller dans thunderbird pour avoir le formatage désiré.
2019-04-24 04:54:21 +00:00
2019-04-24 06:34:03 +00:00
Pour ce faire, cest aussi simple que ça:
2019-04-24 04:54:21 +00:00
```sh
pandoc -t html5 -s <fichier> | xclip -selection clipboard
```
2019-04-24 06:34:03 +00:00
Ainsi, en ajoutant ce raccourci dans votre fichier de configuration pour les markdown dans vim (pour ma part il est dans `ftplugin/pandoc.vim`):
2019-04-24 04:54:21 +00:00
```vim
map <raccourcis> :w !pandoc -t html5 -s \| xclip -selection clipboard<cr>
```
on peut alors directement coller le contenu du *buffer* courant formatée par [pandoc](https://pandoc.org/) dans thunderbird.
2019-04-24 06:34:03 +00:00
Bien entendu, vous pouvez décorer cette commande à laide de vos options favorites.
Par exemple, jutilise `--base-header-level=4` puisque dans mes emails je nutilise que rarement le premier niveau de titre.
2019-04-24 04:54:21 +00:00
Pour aller encore plus loin, il est possible de rajouter une feuille de style [simple](https://perfectmotherfuckingwebsite.com/) pour améliorer un poil plus la présentation, par exemple pour des [infolettres](https://fr.wikipedia.org/wiki/Lettre_d%27information).
2019-04-24 06:34:03 +00:00
**Note:** jutilise les plugins vim [vim-pandoc](https://github.com/vim-pandoc/vim-pandoc) et [vim-pandoc-syntax](https://github.com/vim-pandoc/vim-pandoc-syntax).
2019-04-24 04:54:21 +00:00
Un exemple de modèle de lettres préformatés et facilement modifiables: un e-mail RGPD directement inspiré de celui d[aeris'](https://gist.github.com/aeris/675ffd5755f7570469448bb8b890f759).
```md
Dear Sir or Madam,
My personal data, such as my e-mail address, are protected under the
GDPR law since May 2016:\
<https://www.privacy-regulation.eu/en/>
As per article 3, all GDPR applies to you as I am an EU citizen, even
if you are outside EU:\
<https://www.privacy-regulation.eu/en/3.htm>
As per article 15, I request you to provide me all personal data you
have about myself, the purpose of the processing, why and **how** you
collect them, if you share my data with others people or countries,
and all other informations that are mentioned in the following:\
<https://www.privacy-regulation.eu/en/15.htm>
As per article 7, I request you to **prove** my **explicit** and
**positive** consent fr my personnal data to be collected and
processed:\
<https://www.privacy-regulation.eu/en/7.htm>
As per article 17, I also request all my personal data to be erased
from your databases (including backups), with a proof of erasure,
**but only once you provided me with all the aforementioned
information**:\
<https://www.privacy-regulation.eu/en/17.htm>
As per article 12, these requests have to be fulfilled within **a
month** from Today (April 4th 2019). Should this not be the case,
I will open a case with EU regulator:\
<https://www.privacy-regulation.eu/en/12.htm>
As per article 19, I have the same request to **all your partners** to
whom my personal data have been transfered to. These have to be
accompanied by an attestation of erasure from these partners as
well:\
<https://www.privacy-regulation.eu/en/19.htm>
This e-mail is signed under the GPG key
[`0x2C5033B228CFE4E7`](https://fmouhart.epheme.re/documents/pubkey.asc)
that also appears in the above website, which suffices to prove my
identity as the rightful owner of these personal data.
If you require further information to fulfill my requests, feel free
to contact me on this e-mail address.
Sincerely yours,
```