pandoc and markdown in 5 minutes - lightning talk @ open...
TRANSCRIPT
![Page 1: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/1.jpg)
Pandoc and Markdown in 5 Minutes
Lightning Talk @ Open Source Open Mic
Dirk Eddelbuettel
26 October 2017
OSOM Oct 2017 1/17
![Page 2: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/2.jpg)
Outline
OSOM Oct 2017 2/17
![Page 3: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/3.jpg)
Plan for today
• Pandoc• Markdoc• Text processing
OSOM Oct 2017 3/17
![Page 4: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/4.jpg)
Pandoc
OSOM Oct 2017 4/17
![Page 5: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/5.jpg)
Pandoc in a nutshell
• The Swiss army knife for text conversion
• From anything to anything
• Rather widely used
• Well documented, many options
• Written in Haskell (!!) by head of UCBerkeley philosophy dept (!!)
• Very scriptable in the Unix tradition;extensible via pandoc-filters
Source: Pandoc website
OSOM Oct 2017 5/17
![Page 6: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/6.jpg)
Markdown
OSOM Oct 2017 6/17
![Page 7: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/7.jpg)
Key Points
• Invented by John Gruber of Daring Fireball
• Very widely used as an easy markup language
• It is everywhere now (GitHub, StackOverflow, …)
• Might get standardised (commonmark, GitHub-flavored, …)
• Fits with Pandoc like peanut butter and jelly
OSOM Oct 2017 7/17
![Page 8: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/8.jpg)
Example
OSOM Oct 2017 8/17
![Page 9: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/9.jpg)
Integration
OSOM Oct 2017 9/17
![Page 10: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/10.jpg)
RMarkdown
• Integration with R via rmarkdown package• Extensive documentation by RStudio• Integration with R (and Python, SQL, …) code chunks• Dynamic and computable documents that auto-update
OSOM Oct 2017 10/17
![Page 11: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/11.jpg)
RMarkdown
OSOM Oct 2017 11/17
![Page 12: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/12.jpg)
Demo
OSOM Oct 2017 12/17
![Page 13: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/13.jpg)
Our ‘Template’
OSOM Oct 2017 13/17
![Page 14: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/14.jpg)
Our ‘Deployment’
#!/bin/sh
for i in 1 2 3; dormdfile=”demo${i}.Rmd”pdffile=”demo${i}.pdf”echo ${rmdfile}cp -vax demo.Rmd ${rmdfile}Rscript -e 'rmarkdown::render(”'${rmdfile}'”)'test -f ${pdffile} && xdg-open ${pdffile}
done
OSOM Oct 2017 14/17
![Page 15: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/15.jpg)
Result
OSOM Oct 2017 15/17
![Page 16: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/16.jpg)
Summary
Pandoc
• rocks as very versatile to/from anything converter• highly scriptable, widely available
Markdown
• has won the markup languages fight• is literally everywhere, dialects exists though
RMarkdown
• highly customizable• highly expressive
OSOM Oct 2017 16/17
![Page 17: Pandoc and Markdown in 5 Minutes - Lightning Talk @ Open …dirk.eddelbuettel.com/papers/osom-2017-10.pdf · 2017. 10. 27. · GitHub eddelbuettel OSOMOct2017 17/17. Title: Pandoc](https://reader036.vdocuments.net/reader036/viewer/2022071218/605059e3b6fa790c9803d009/html5/thumbnails/17.jpg)
Contact
Websitehttp://dirk.eddelbuettel.com
Twitter@eddelbuettel
GitHubeddelbuettel
OSOM Oct 2017 17/17