issue142:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue142:c_c [2019/02/24 10:28] – créée auntiee | issue142:c_c [2019/03/06 17:55] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | A few months ago, I wrote an article on using LaTeX to easily manage and track a CV. I ended up using LaTeX instead of my first choice (Markdown + HTML Stylesheets), | + | **A few months ago, I wrote an article on using LaTeX to easily manage and track a CV. I ended up using LaTeX instead of my first choice (Markdown + HTML Stylesheets), |
- | The Path | + | Il y a quelques mois, j'ai écrit un article sur l' |
+ | |||
+ | **The Path | ||
Shortly after writing the article mentioned above, I heard about Adam Wathan typesetting the book “Refactoring UI” in Markdown and generating PDFs from those files. He informed me on Twitter that he was using Prince XML to compile the PDF files. Looking into it, I decided it was way too expensive for the occasional (commercial) use that I was planning. It did, however, indicate to me that this was possible. If you’re looking for a free tool for personal use, Prince does allow it, and only adds a small logo on the first page. | Shortly after writing the article mentioned above, I heard about Adam Wathan typesetting the book “Refactoring UI” in Markdown and generating PDFs from those files. He informed me on Twitter that he was using Prince XML to compile the PDF files. Looking into it, I decided it was way too expensive for the occasional (commercial) use that I was planning. It did, however, indicate to me that this was possible. If you’re looking for a free tool for personal use, Prince does allow it, and only adds a small logo on the first page. | ||
- | Instead, I then headed to alternativeto.net and had a look at the alternatives to Prince XML. There were 3 options listed - wkhtmltopdf, | + | Instead, I then headed to alternativeto.net and had a look at the alternatives to Prince XML. There were 3 options listed - wkhtmltopdf, |
+ | |||
+ | Le cheminement | ||
+ | |||
+ | Peu de temps après avoir écrit l' | ||
+ | |||
+ | À la place, j'ai filé ensuite sur alternativeto.net et cherché des alternatives à Prince XML. Trois options étaient proposées : wkhtmltopdf, | ||
+ | |||
+ | **WeasyPrint | ||
+ | |||
+ | My first look was WeasyPrint, as it looked the most similar to Prince XML. It takes a website, and turns it into a wonderful PDF. If you need to make brochures, or documents with images/ | ||
WeasyPrint | WeasyPrint | ||
- | My first look was WeasyPrint, | + | Mon premier regard a été pour WeasyPrint, |
+ | |||
+ | **wkhtmltopdf | ||
+ | |||
+ | This engine can be used with Pandoc (which I have previously used to turn .docx files into Markdown), and can take Markdown files directly, and, with one command, generate the HTML and then the PDF. You can include CSS files and many other options. Admittedly, I haven’t found too many easy-to-follow guides, and I find their documentation to be confusing when you have little experience with pandoc. As a side note, pandoc also supports weasyprint.** | ||
wkhtmltopdf | wkhtmltopdf | ||
- | This engine can be used with Pandoc (which I have previously used to turn .docx files into Markdown), and can take Markdown files directly, and, with one command, generate the HTML and then the PDF. You can include | + | Ce moteur peut être utilisé avec Pandoc (que j'ai déjà utilisé pour transformer des fichiers |
- | Reddit to the Rescue | + | **Reddit to the Rescue |
While I had done a few tests, I didn’t have the time to invest in creating decent styles for either tool, especially since that was where I ran into the most issues originally. Instead, I put it on the back burner and continued working on my various other projects. That is, until the first week of February, where a user had posted on Reddit’s /r/unixporn subreddit. His setup included a very nice PDF generated from a very normal-looking Markdown file. Hunting through the comments, I found someone who had already asked the question of “how?”. | While I had done a few tests, I didn’t have the time to invest in creating decent styles for either tool, especially since that was where I ran into the most issues originally. Instead, I put it on the back burner and continued working on my various other projects. That is, until the first week of February, where a user had posted on Reddit’s /r/unixporn subreddit. His setup included a very nice PDF generated from a very normal-looking Markdown file. Hunting through the comments, I found someone who had already asked the question of “how?”. | ||
- | Well...it turns out to have been pandoc + wkhtmltopdf. Following the dialog (and the recommendation of tufte-css), I have successfully compiled a few easy Markdown files into usable, readable PDFs. | + | Well...it turns out to have been pandoc + wkhtmltopdf. Following the dialog (and the recommendation of tufte-css), I have successfully compiled a few easy Markdown files into usable, readable PDFs.** |
- | Why? | + | Reddit à la rescousse |
+ | |||
+ | Comme je n'ai fait que quelques tests rapides, je n'ai pas eu le temps de m' | ||
+ | |||
+ | Eh bien..., il s' | ||
+ | |||
+ | **Why? | ||
I’ve heard this question a lot when it comes to things I spend my time investigating. The answer for this one is also pretty standard - efficiency. As a developer, I often have to write documentation or make notes about some process or another. When I expect to have upwards of 5 pages of documentation (especially with images, an index, etc), I stick with Sphinx. This is extra useful, as I can output to LaTeX, PDF, ePub, or HTML (among other things). Depending on the needs of my client, I can then compile the same files into any combination of formats they might need. | I’ve heard this question a lot when it comes to things I spend my time investigating. The answer for this one is also pretty standard - efficiency. As a developer, I often have to write documentation or make notes about some process or another. When I expect to have upwards of 5 pages of documentation (especially with images, an index, etc), I stick with Sphinx. This is extra useful, as I can output to LaTeX, PDF, ePub, or HTML (among other things). Depending on the needs of my client, I can then compile the same files into any combination of formats they might need. | ||
- | However, if I’m looking at maybe a single page of documentation, | + | However, if I’m looking at maybe a single page of documentation, |
- | I also find Markdown much faster to type and format than anything like Google Drive, Microsoft Word, or Pages documents, since formatting is taken care of with just a few characters, instead of memorizing ever-changing (between the various applications) shortcuts, or having to use the mouse to select individual styles and settings. Best of all, Markdown is repeatable. I can write a dozen documents, and format them all the same way at the same time with one CSS file. | + | Pourquoi ? |
- | How? | + | J'ai beaucoup entendu cette question à propos des sujets que je passe mon temps à investiguer. La réponse à celle-ci est aussi très ordinaire : l' |
+ | |||
+ | Cependant, si je n' | ||
+ | |||
+ | **I also find Markdown much faster to type and format than anything like Google Drive, Microsoft Word, or Pages documents, since formatting is taken care of with just a few characters, instead of memorizing ever-changing (between the various applications) shortcuts, or having to use the mouse to select individual styles and settings. Best of all, Markdown is repeatable. I can write a dozen documents, and format them all the same way at the same time with one CSS file.** | ||
+ | |||
+ | Je trouve aussi que le MarkDown est beaucoup plus rapide à saisir et à formater que d' | ||
+ | |||
+ | **How? | ||
This is surprisingly simple. Using the links in the Further Reading section, make sure you’ve downloaded the Tufte CSS file and fonts (or any CSS file you’d like to use), and save them somewhere. After that, make yourself a Markdown file you’d like to convert. Then use the command below: | This is surprisingly simple. Using the links in the Further Reading section, make sure you’ve downloaded the Tufte CSS file and fonts (or any CSS file you’d like to use), and save them somewhere. After that, make yourself a Markdown file you’d like to convert. Then use the command below: | ||
Ligne 36: | Ligne 67: | ||
The options are pretty self-explanatory - f for the input format (“from”), | The options are pretty self-explanatory - f for the input format (“from”), | ||
- | You can also get fancier by creating a script to watch a specific file, or a bash alias to speed up the process of compiling a file. Either way, this should get you started! | + | You can also get fancier by creating a script to watch a specific file, or a bash alias to speed up the process of compiling a file. Either way, this should get you started!** |
+ | Comment ? | ||
- | Future | + | C'est surprenant de simplicité. En utilisant les liens de la section « Pour aller plus loin », assurez-vous que vous avez téléchargé le fichier Tufte CSS et les polices (ou n' |
- | Now that I have the Markdown | + | pandoc |
- | Conclusion | + | Les options se comprennent facilement : -f pour le format d' |
- | While Pandoc can do an almost overwhelming amount of things, starting with a few simple (but powerful) options seems best. From there, you can move on to creating reveal.js slideshows, or any number of other formats. Have you ever used this? Or are you inspired to do so now? Feel free to share any awesome use-cases with me via email. Or reach out to me at lswest34+fcm@gmail.com with any recommendations, | + | Vous pouvez aussi faire plus compliqué en créant un script pour viser un fichier particulier, ou un alias bash pour accélérer le processus de compilation de fichier. Quoi qu'il en soit, ceci vous permettra de démarrer ! |
+ | **Future | ||
+ | Now that I have the Markdown -> PDF workflow working, I will see about using pandoc to convert Markdown into Doc formats. This way, I can start writing Markdown files for articles, and host them internally as a website for easy searching, instead of hunting through a folder of Word and google documents.** | ||
+ | L' | ||
+ | Maintenant que je dispose d'une enchaînement du MarkDown vers le PDF qui fonctionne, j' | ||
+ | **Conclusion | ||
- | Further Reading | + | While Pandoc can do an almost overwhelming amount of things, starting with a few simple (but powerful) options seems best. From there, you can move on to creating |
+ | |||
+ | Conclusion | ||
+ | |||
+ | Bien que Pandoc puisse faire une énorme quantité de choses, un début avec quelques options simples (mais puissantes) semblent le mieux. De là, vous pouvez passer à la création de diaporamas en reveal.js, ou un grand nombre d' | ||
+ | |||
+ | **Further Reading | ||
https:// | https:// | ||
Ligne 60: | Ligne 103: | ||
https:// | https:// | ||
- | https:// | + | https:// |
+ | |||
+ | Pour aller plus loin | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// |
issue142/c_c.1551000501.txt.gz · Dernière modification : 2019/02/24 10:28 de auntiee