Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| info:pandoc [2023/11/21 04:31] – [docx->dokuwiki] radeff | info:pandoc [2026/03/26 05:41] (Version actuelle) – [libreoffice->md] radeff | ||
|---|---|---|---|
| Ligne 27: | Ligne 27: | ||
| http:// | http:// | ||
| + | ===== dokuwiki-> | ||
| + | convertir dokuwiki en markdown | ||
| + | pandoc -s -r dokuwiki dokuwiki.txt -t markdown > dokuwiki.md | ||
| + | |||
| + | ===== libreoffice-> | ||
| + | convertir libreoffice en markdown | ||
| + | pandoc -s -r odt file.odt -t markdown > file.md | ||
| + | |||
| + | ===== docx (word)libreoffice-> | ||
| + | convertir word en markdown | ||
| + | pandoc file.docx -o file.md --wrap=preserve --markdown-headings=atx | ||
| ===== html-> | ===== html-> | ||
| exemple: convertir un export de vos signets firefox au format dokuwiki | exemple: convertir un export de vos signets firefox au format dokuwiki | ||
| pandoc -s -r html bookmarks.html -t dokuwiki > bookmarks.txt | pandoc -s -r html bookmarks.html -t dokuwiki > bookmarks.txt | ||
| + | ===== html->md ===== | ||
| + | exemple: convertir un export de vos signets firefox au format dokuwiki | ||
| + | pandoc -s -r html bookmarks.html -t markdown > bookmarks.md | ||
| ===== docx-> | ===== docx-> | ||
| convertir un fichier word_daube en DW | convertir un fichier word_daube en DW | ||
| pandoc -s -r docx word_daube.docx -t dokuwiki > bookmarks.txt | pandoc -s -r docx word_daube.docx -t dokuwiki > bookmarks.txt | ||
| + | ===== créer une table des matières ===== | ||
| + | ./pandoc -s --toc input.md -o output.md | ||
| ===== markdown-> | ===== markdown-> | ||
| [[https:// | [[https:// | ||
| + | |||
| + | ===== powerpoint ===== | ||
| + | <note important> | ||
| + | |||
| + | je déteste powerpoint et j' | ||
| + | |||
| + | la seule chose à laquelle on parvient facilement est convertir le ppt en pdf puis le pdf en text, il faut ensuite tout faire à la main, ex. de script avec un résultat médiocre au final: | ||
| + | |||
| + | notes: | ||
| + | * il faudrait ajouter une boucle du type find . -name " | ||
| + | * on utilise pdfToText car pandoc sait uniquement générer du pdf, pas le convertir | ||
| + | <code bash> | ||
| + | soffice --headless --convert-to pdf pauvrepoint_MS_daube.pptx | ||
| + | htmltotext -layout pauvrepoint_MS_daube.pdf | ||
| + | </ | ||
| + | ==== aller plus loin? ==== | ||
| + | |||
| + | sur https:// | ||
| + | |||
| + | on peut essayer des outils du genre de https:// | ||
| + | |||
| ===== adoc2odt (Libre Office generation) ===== | ===== adoc2odt (Libre Office generation) ===== | ||
| avant de générer, créer un répertoire | avant de générer, créer un répertoire | ||
| Ligne 72: | Ligne 109: | ||
| source: https:// | source: https:// | ||
| + | ==== Générer du pdf ==== | ||
| + | Il est possible de générer facilement du pdf avec une commande du type | ||
| + | pandoc -o doc.pdf -f markdown -t pdf doc.md | ||
| + | |||
| + | Auparavant, il faut s' | ||
| + | <code bash> | ||
| + | sudo apt-get install texlive-latex-base | ||
| + | sudo apt-get install texlive-fonts-recommended | ||
| + | sudo apt-get install texlive-fonts-extra | ||
| + | sudo apt-get install texlive-latex-extra | ||
| + | </ | ||
| + | |||
| + | <note important> | ||
| + | |||
| + | Alternative moins lourde avec l' | ||
| + | <code bash> | ||
| + | # installer wkhtmltopdf | ||
| + | sudo apt-get install wkhtmltopdf | ||
| + | # créer un doc html (on peut ajouter de la css etc) | ||
| + | pandoc -s -r markdown doc.md -t html > doc.html | ||
| + | # génération du pdf | ||
| + | wkhtmltopdf doc.html doc.pdf | ||
| + | </ | ||
| + | |||
| + | <note tip> | ||
| ==== Utiliser pandoc pour générer du pdf depuis asciidoc ==== | ==== Utiliser pandoc pour générer du pdf depuis asciidoc ==== | ||
| Très pratique si on veut éviter [[: | Très pratique si on veut éviter [[: | ||