Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Markdown + CSS to .doc or .pdf

Been using Markdown using Mou on the Mac alot recently, and would really like to use it in my technical writing - it is much easier than messing around with .doc formats.

The question is what is the best way to convert to a .doc format or a .pdf, i will need elements like repeating headers / footers, but other than that i just need the HTML / CSS to break sensibly accross pages.

Actually i guess what i am asking - is how do i print my styled Markdown output in a sensible fashion to .doc / .pdf in A4 or standard paper sizing.

like image 678
diagonalbatman Avatar asked Jan 14 '12 15:01

diagonalbatman


People also ask

How do I turn a Markdown into a PDF?

Usage. Just focus the window containing your markdown file and use the convert command ( Packages > Markdown to PDF > Convert ) or with the following shortcut ctrl-alt-e . The output PDF will be styled similar to the markdown on github.com .

Can you use CSS in Markdown?

CSS can be written directly into individual Markdown files but they are often created as separate files. If you have a desired stylesheet, it can can be linked to in individual documents.

How do I convert Markdown to PDF in Pandoc?

Generating PDF from Markdown with Pandoc There are actually two steps involved in converting a Markdown file to a PDF file: The Markdown source file is converted to a LaTeX source file. Pandoc invokes the pdflatex or xelatex or other TeX command and converts the . tex source file to a PDF file.

How do I export Markdown from HTML?

To convert Markdown to HTML using Typora, click File —> Export —> HTML. Then save the file in your preferred location. The image below shows that the HTML output looks exactly as how the Markdown is displayed inside Typora.


2 Answers

You can also generate HTML from Markdown and convert it to .pdf or .xls format using DocRaptor. DocRaptor also handles CSS better than competitors do.

Here's a link to DocRaptor

like image 156
illbzo1 Avatar answered Oct 06 '22 19:10

illbzo1


I'm trying this for technical docs as well. The best tool I found to generate PDFs is gimli. In our environment:

  1. Markdown source is stored in a git repository on a central server.
  2. Jenkins polls that git repo for changes on master
  3. The Jenkins job fetches the changes and publishes HTML and PDF versions to the intranet.

Works a treat so far.

like image 21
Connor Doyle Avatar answered Oct 06 '22 18:10

Connor Doyle