SlideShare a Scribd company logo
Publishing Alchemy with Markdown and pandoc
Oscar Merida
July 22, 2014
Contents
Alchemy? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Alchemy! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Our Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
What can we do with them? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Genesis of Markdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Markdown Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Markdown Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Flavors of Markdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Markdown plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Markdown Syntax - Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Markdown Syntax - Text Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Markdown Syntax - Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Markdown Syntax - Unordered Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Markdown Syntax - Ordered Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Markdown Syntax - Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Markdown Syntax - Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Markdown Syntax - Simple Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Markdown Syntax - Grid Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Markdown Syntax - Grid Tables, 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Markdown Syntax - Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
A simple markdown example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
A simple markdown example, rendered. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Example, As HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Pandoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Pandoc extensions to markdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Structuring a large document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1
PDF output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
.epub output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
About me . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2
Alchemy?
Figure 1: Alchemist - Joseph Wright
Alchemy!
Alchemy is an influential philosophical tradition whose practitioners have, from antiquity, claimed
it to be the precursor to profound powers.
Our Tools
• Markdown, a plain text format for writing.
• Pandoc, a command line tool for converting from one markup to another.
What can we do with them?
• Prepare technical and other documentation for projects
• Write articles for a blog
• Publish a book
• Create slides for a presentation
3
Genesis of Markdown
Created in 2004 by John Gruber and contributions from Aaron Swartz
“to write using an easy-to-read, easy-to-write plain text format, and optionally convert it to
structurally valid XHTML (or HTML)”
See the release: http://daringfireball.net/projects/markdown/
Markdown Advantages
• Plain text, easier to focus on writing
• Files are easy to version with git, svn, etc
• Much more readable than raw HTML
• Editable in any text editor, and. . .
Markdown Editors
• MarkdownPad for Windows
• Mou, iA Writer on
• ReText for Linux
• Online markdown editors like dillinger.io
• and many others for iOs, Android, etc
Flavors of Markdown
Unfortunately there is not a clearly defined Markdown standard
• Github markdown
– URL autolinking, strikethrough, fenced code blocks, syntax highlighting
• MultiMarkdown
– footnotes, tables, citations, captions
• Markdown Extra
– fenced code blocks, tables, footnotes
• Pandoc Markdown
– tables, syntax highlighting, inline footnotes
Markdown plugins
• For Wordpress, WP-Markdown
• For Drupal, Markdown filter
• PHP, PHP Markdown Extra
• As a service StackEdit
• Javascript Editor EpicEditor
4
Markdown Syntax - Headings
• One or more #
• Provide document structure
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
Markdown Syntax - Text Blocks
• Paragraphs are separated by a new line.
• Block Quotes begin with a >.
I should have used lorem ipsum here as an example of text
> And here is another paragraph
I should have used lorem ipsum here as an example of text
And here is another paragraph
Markdown Syntax - Formatting
*italic* _italic_
**bold**__bold__
‘monospace‘
italic italic
bold bold
monospace
Markdown Syntax - Unordered Lists
• Bullets can be +, -, *
• Nested lists are indented by 4 spaces.
- One
* Sub One
- Two
- Three
5
• One
– Sub One
• Two
• Three
Markdown Syntax - Ordered Lists
• Numbered lists use numbers followed by a period.
• Nested lists are indented by 4 spaces.
1. One
1. Another Level
3. And more
1. Two
1. Something Else
1. One
1. Another Level
2. And more
2. Two
3. Something Else
Markdown Syntax - Links
• Link text is enclosed with square brackets [].
• Alternatively, links in angled brackets <> will show the URL
• URL in Parentheses,
– can use absolute, relative paths too
Read [my blog](http://bytesinthemargin.com/)
<http://bytesinthemargin.com>
Read my blog
http://bytesinthemargin.com
6
Markdown Syntax - Images
• Same format as URL, but starts with !
![Need Work](./images/jobless-cylon.jpg)
7
Markdown Syntax - Simple Tables
• More than one way to specify tables, varies by implementation
• Simple tables
Right Left Center Default
------- ------ ---------- -------
12 12 12 12
123 123 123 123
1 1 1 1
Right Left Center Default
12 12 12 12
123 123 123 123
1 1 1 1
Markdown Syntax - Grid Tables
+---------------+---------------+--------------------+
| Fruit | Price | Advantages |
+===============+===============+====================+
| Bananas | $1.34 | - built-in wrapper |
| | | - bright color |
+---------------+---------------+--------------------+
| Oranges | $2.10 | - cures scurvy |
| | | - tasty |
+---------------+---------------+--------------------+
Markdown Syntax - Grid Tables, 2
Fruit Price Advantages
Bananas $1.34 • built-in wrapper
• bright color
Oranges $2.10 • cures scurvy
• tasty
8
Markdown Syntax - Code Samples
• Original markdown indents code block with four spaces
• Larger code blocks should use fenced code blocks
~~~~{.php}
<?php
echo "Hello World. Today is";
echo date(’Y-m-d H:i’);
~~~~
<?php
echo "Hello World. Today is";
echo date(’Y-m-d H:i’);
9
A simple markdown example.
![USSF Logo](./images/US_Soccer_logo.png)
The United States Men’s national team advanced from Group G
in the 2014 World Cup held in Brazil.
With a win against Ghana, a last minute tie against Brazil,
the team secured 4 points and second place. Final standings
are shown below.
Team W D L
------- --- --- ---
Germany 2 1 0
USA 1 1 1
Portugal 1 1 1
Ghana 0 1 2
Source: [Wikipedia](https://en.wikipedia.org/wiki/2014_FIFA_World_Cup#Group_G)
A simple markdown example, rendered.
Figure 2: USSF Logo
The United States Men’s national team advanced from Group G in the 2014 World Cup held in Brazil.
With a win against Ghana, a last minute tie against Brazil, the team secured 4 points and second place.
Final standings are shown below.
Team W D L
Germany 2 1 0
USA 1 1 1
Portugal 1 1 1
Ghana 0 1 2
Source: Wikipedia
10
Example, As HTML
<h1>A simple markdown example, rendered.</h1>
<div class="figure">
<img src="./images/US_Soccer_logo.png" alt="USSF Logo"><p class="caption">USSF Logo</p>
</div>
<p>The United States Men’s national team advanced from Group G in the 2014 World Cup
held in Brazil.</p>
<p>With a win against Ghana, a last minute tie against Brazil, the team secured 4
points and second place. Final standings are shown below.</p>
<table>
<thead>
<tr class="header">
<th align="left">Team</th>
<th align="left">W</th>
<th align="left">D</th>
<th align="left">L</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">Germany</td>
<td align="left">2</td>
<td align="left">1</td>
<td align="left">0</td>
</tr>
<tr class="even">
<td align="left">USA</td>
<td align="left">1</td>
<td align="left">1</td>
<td align="left">1</td>
</tr>
<tr class="odd">
<td align="left">Portugal</td>
<td align="left">1</td>
<td align="left">1</td>
<td align="left">1</td>
</tr>
<tr class="even">
<td align="left">Ghana</td>
<td align="left">0</td>
<td align="left">1</td>
<td align="left">2</td>
</tr>
</tbody>
</table>
<p>Source: <a href="https://en.wikipedia.org/wiki/2014_FIFA_World_Cup#Group_G">Wikipedia</a></p>
11
Pandoc
• Written in Haskell
• Converts markup in one format to another
• From
– Markdown
– HTML
– LaText, and more
• To
– PDF
– Latex,
– EPUP, and more
• Read the Instructions for Installing Pandoc
– Windows, Mac OS X, Linux, BSD
Pandoc extensions to markdown
Thus, while pandoc allows the embedding of raw HTML, it discourages it, and provides other,
non-HTMLish ways of representing important document elements like definition lists, tables,
mathematics, and footnotes.
• Fancier lists
– Uppercase & lowercase letters, or Roman numerals
• Definition lists
• Inline footnotes
• Built in syntax highlighting
Read the Pandoc Documentation for details.
Structuring a large document
What if you’re writing a book, or long report? What if you have multiple contributors?
• Break up document into multiple files.
– One chapter per file
– Use a naming convention so that listing the files will put them in sequence
∗ 001-introduction.md
∗ chapter-01.md
• Put figures & Images in an images folder
• Use Git or Subversion to commit your changes, update to get other’s changes.
• Use a build script to execute pandoc
12
PDF output
• Requires a LaTeX engine
• --toc --toc-depth=N adds a Table of Contents
• “ to use raw tex commands
• Use pagebreak in your markdown to control Page Breaks
Convert markdown to pdf:
pandoc -s --toc --toc-depth=2 -o alchemy-markdown-pandoc.pdf slides.md
See this presentation a PDF
.epub output
• epub is a free & open e-book standard that uses HTML & CSS.
• Need an xml file for epub metadata.
<dc:title>Publishing Alchemy with Markdown and pandoc</dc:title>
<dc:language>en-US</dc:language>
<dc:creator opf:file-as="Merida, Oscar" opf:role="aut">Oscar Merida</dc:creator>
<dc:date opf:event="publication">2014-07-29</dc:date>
<dc:rights>Copyright c 2014 by Oscar Merida</dc:rights>
Convert markdown to epub
pandoc -s --toc --toc-depth=2 -o alchemy-markdown-pandoc.epub 
--epub-cover-image=images/cover.jpg 
--epub-metadata=book.xml slides.md
See this presentation an epub
Further Reading
• PuppetLabs: How We Automated Our Ebook Builds With Pandoc and KindleGen
• Convert from Word to markdown
• A Markdown Epub Builder
• Convert epub to MOBI with KindleGen
• S5 Html based Slide Shows
• Pandoc and LaTeX
About me
• PHP Developer since PHP3 day
• Drupal since 4.x
• php[architect] monthly magazine
– always looking for contributors
– we do books & training too!
• Follow me @omerida
• php[world] this November http://world.phparch.com
13

More Related Content

What's hot

Parallels Plesk Panel 9 Reseller's Guide
Parallels Plesk Panel 9 Reseller's GuideParallels Plesk Panel 9 Reseller's Guide
Parallels Plesk Panel 9 Reseller's Guidewebhostingguy
 
Chuck Moore Book 2012 01 26
Chuck Moore Book 2012 01 26Chuck Moore Book 2012 01 26
Chuck Moore Book 2012 01 26
JuergenPintaske
 
Flash File Format Specification
Flash File Format SpecificationFlash File Format Specification
Flash File Format Specificationguest0ebe1e
 
Ibm spss custom_tables
Ibm spss custom_tablesIbm spss custom_tables
Ibm spss custom_tables
Dũ Lê Anh
 
Plesk Sitebuilder 4.5 for Linux/Unix Wizard User's Guide
Plesk Sitebuilder 4.5 for Linux/Unix Wizard User's GuidePlesk Sitebuilder 4.5 for Linux/Unix Wizard User's Guide
Plesk Sitebuilder 4.5 for Linux/Unix Wizard User's Guidewebhostingguy
 
Guide hsql
Guide hsqlGuide hsql
Guide hsql
LE DUC HAN
 
Visual Studio 2008 Beginning Asp Net 3 5 In C# 2008 From Novice To Professi...
Visual Studio 2008   Beginning Asp Net 3 5 In C# 2008 From Novice To Professi...Visual Studio 2008   Beginning Asp Net 3 5 In C# 2008 From Novice To Professi...
Visual Studio 2008 Beginning Asp Net 3 5 In C# 2008 From Novice To Professi...guest4c5b8c4
 
P4 perforce
P4 perforceP4 perforce
P4 perforce
Dinesh Vasudevan
 
Swf File Format Spec V10
Swf File Format Spec V10Swf File Format Spec V10
Swf File Format Spec V10
losalamos
 
Python programming
Python programmingPython programming
Python programming
Keshav Gupta
 
The Total Book Developing Solutions With EPiServer 4
The Total Book Developing Solutions With EPiServer 4The Total Book Developing Solutions With EPiServer 4
The Total Book Developing Solutions With EPiServer 4
Martin Edenström MKSE.com
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>tutorialsruby
 
A Gentle Introduction to ROS Jason M. O’Kane ~hmftj
A Gentle Introduction to ROS Jason M. O’Kane  ~hmftjA Gentle Introduction to ROS Jason M. O’Kane  ~hmftj
A Gentle Introduction to ROS Jason M. O’Kane ~hmftj
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
CPanel 1.01 User Guide
CPanel 1.01 User GuideCPanel 1.01 User Guide
CPanel 1.01 User Guidewebhostingguy
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>tutorialsruby
 
html-css-bootstrap-javascript-and-jquery
html-css-bootstrap-javascript-and-jqueryhtml-css-bootstrap-javascript-and-jquery
html-css-bootstrap-javascript-and-jquery
MD. NURUL ISLAM
 

What's hot (19)

Parallels Plesk Panel 9 Reseller's Guide
Parallels Plesk Panel 9 Reseller's GuideParallels Plesk Panel 9 Reseller's Guide
Parallels Plesk Panel 9 Reseller's Guide
 
Chuck Moore Book 2012 01 26
Chuck Moore Book 2012 01 26Chuck Moore Book 2012 01 26
Chuck Moore Book 2012 01 26
 
Begining j2 me
Begining j2 meBegining j2 me
Begining j2 me
 
Ebay News 1998 10 27 Earnings
Ebay News 1998 10 27 EarningsEbay News 1998 10 27 Earnings
Ebay News 1998 10 27 Earnings
 
Flash File Format Specification
Flash File Format SpecificationFlash File Format Specification
Flash File Format Specification
 
Ibm spss custom_tables
Ibm spss custom_tablesIbm spss custom_tables
Ibm spss custom_tables
 
Plesk Sitebuilder 4.5 for Linux/Unix Wizard User's Guide
Plesk Sitebuilder 4.5 for Linux/Unix Wizard User's GuidePlesk Sitebuilder 4.5 for Linux/Unix Wizard User's Guide
Plesk Sitebuilder 4.5 for Linux/Unix Wizard User's Guide
 
Guide hsql
Guide hsqlGuide hsql
Guide hsql
 
Visual Studio 2008 Beginning Asp Net 3 5 In C# 2008 From Novice To Professi...
Visual Studio 2008   Beginning Asp Net 3 5 In C# 2008 From Novice To Professi...Visual Studio 2008   Beginning Asp Net 3 5 In C# 2008 From Novice To Professi...
Visual Studio 2008 Beginning Asp Net 3 5 In C# 2008 From Novice To Professi...
 
P4 perforce
P4 perforceP4 perforce
P4 perforce
 
Swf File Format Spec V10
Swf File Format Spec V10Swf File Format Spec V10
Swf File Format Spec V10
 
Python programming
Python programmingPython programming
Python programming
 
The Total Book Developing Solutions With EPiServer 4
The Total Book Developing Solutions With EPiServer 4The Total Book Developing Solutions With EPiServer 4
The Total Book Developing Solutions With EPiServer 4
 
Step by step power point 2007
Step by step power point 2007Step by step power point 2007
Step by step power point 2007
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
 
A Gentle Introduction to ROS Jason M. O’Kane ~hmftj
A Gentle Introduction to ROS Jason M. O’Kane  ~hmftjA Gentle Introduction to ROS Jason M. O’Kane  ~hmftj
A Gentle Introduction to ROS Jason M. O’Kane ~hmftj
 
CPanel 1.01 User Guide
CPanel 1.01 User GuideCPanel 1.01 User Guide
CPanel 1.01 User Guide
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
 
html-css-bootstrap-javascript-and-jquery
html-css-bootstrap-javascript-and-jqueryhtml-css-bootstrap-javascript-and-jquery
html-css-bootstrap-javascript-and-jquery
 

Similar to Publishing alchemy with markdown and pandoc

R data
R dataR data
JavaScript 设计模式
JavaScript 设计模式JavaScript 设计模式
JavaScript 设计模式
guest97dcac3
 
9780735699236.pdf
9780735699236.pdf9780735699236.pdf
9780735699236.pdf
AshuTosh556892
 
Borland c++ version_3.0_users_guide_1991
Borland c++ version_3.0_users_guide_1991Borland c++ version_3.0_users_guide_1991
Borland c++ version_3.0_users_guide_1991
praveen188668
 
0001
00010001
0001
Kais143
 
RDB Synchronization, Transcoding and LDAP Directory Services ...
RDB Synchronization, Transcoding and LDAP Directory Services ...RDB Synchronization, Transcoding and LDAP Directory Services ...
RDB Synchronization, Transcoding and LDAP Directory Services ...Videoguy
 
Chuck moorebook2012 01_27
Chuck moorebook2012 01_27Chuck moorebook2012 01_27
Chuck moorebook2012 01_27juergenuk
 
Java script tools guide cs6
Java script tools guide cs6Java script tools guide cs6
Java script tools guide cs6Sadiq Momin
 
Performance tuning for ibm tivoli directory server redp4258
Performance tuning for ibm tivoli directory server   redp4258Performance tuning for ibm tivoli directory server   redp4258
Performance tuning for ibm tivoli directory server redp4258Banking at Ho Chi Minh city
 
Perltut
PerltutPerltut
Data source integration guide for HP Performance Agent
Data source integration guide for HP Performance AgentData source integration guide for HP Performance Agent
Data source integration guide for HP Performance Agenthernajes
 
irmpg_3.7_python_202301.pdf
irmpg_3.7_python_202301.pdfirmpg_3.7_python_202301.pdf
irmpg_3.7_python_202301.pdf
FernandoBello39
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1
Federico Campoli
 
manual.pdf
manual.pdfmanual.pdf
Learn matlab primer
Learn matlab primerLearn matlab primer
Learn matlab primer
IndumathyPrabu
 
10. cutipa portillo, edy dany
10. cutipa portillo, edy dany10. cutipa portillo, edy dany
10. cutipa portillo, edy dany
IESTPTECNOTRONIC
 

Similar to Publishing alchemy with markdown and pandoc (20)

R data
R dataR data
R data
 
JavaScript 设计模式
JavaScript 设计模式JavaScript 设计模式
JavaScript 设计模式
 
9780735699236.pdf
9780735699236.pdf9780735699236.pdf
9780735699236.pdf
 
Borland c++ version_3.0_users_guide_1991
Borland c++ version_3.0_users_guide_1991Borland c++ version_3.0_users_guide_1991
Borland c++ version_3.0_users_guide_1991
 
Codeconventions 150003
Codeconventions 150003Codeconventions 150003
Codeconventions 150003
 
R Data
R DataR Data
R Data
 
0001
00010001
0001
 
RDB Synchronization, Transcoding and LDAP Directory Services ...
RDB Synchronization, Transcoding and LDAP Directory Services ...RDB Synchronization, Transcoding and LDAP Directory Services ...
RDB Synchronization, Transcoding and LDAP Directory Services ...
 
Chuck moorebook2012 01_27
Chuck moorebook2012 01_27Chuck moorebook2012 01_27
Chuck moorebook2012 01_27
 
Java script tools guide cs6
Java script tools guide cs6Java script tools guide cs6
Java script tools guide cs6
 
R Ints
R IntsR Ints
R Ints
 
Performance tuning for ibm tivoli directory server redp4258
Performance tuning for ibm tivoli directory server   redp4258Performance tuning for ibm tivoli directory server   redp4258
Performance tuning for ibm tivoli directory server redp4258
 
Perltut
PerltutPerltut
Perltut
 
Data source integration guide for HP Performance Agent
Data source integration guide for HP Performance AgentData source integration guide for HP Performance Agent
Data source integration guide for HP Performance Agent
 
irmpg_3.7_python_202301.pdf
irmpg_3.7_python_202301.pdfirmpg_3.7_python_202301.pdf
irmpg_3.7_python_202301.pdf
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1
 
manual.pdf
manual.pdfmanual.pdf
manual.pdf
 
Learn matlab primer
Learn matlab primerLearn matlab primer
Learn matlab primer
 
cs-2002-01
cs-2002-01cs-2002-01
cs-2002-01
 
10. cutipa portillo, edy dany
10. cutipa portillo, edy dany10. cutipa portillo, edy dany
10. cutipa portillo, edy dany
 

More from Oscar Merida

PHP OOP
PHP OOPPHP OOP
PHP OOP
Oscar Merida
 
Start using PHP 7
Start using PHP 7Start using PHP 7
Start using PHP 7
Oscar Merida
 
Symfony console: build awesome command line scripts with ease
Symfony console: build awesome command line scripts with easeSymfony console: build awesome command line scripts with ease
Symfony console: build awesome command line scripts with ease
Oscar Merida
 
Integration Testing with Behat drupal
Integration Testing with Behat drupalIntegration Testing with Behat drupal
Integration Testing with Behat drupal
Oscar Merida
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
Oscar Merida
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
Oscar Merida
 
Staying Sane with Drupal (A Develper's Survival Guide)
Staying Sane with Drupal (A Develper's Survival Guide)Staying Sane with Drupal (A Develper's Survival Guide)
Staying Sane with Drupal (A Develper's Survival Guide)
Oscar Merida
 
How to Evaluate your Technical Partner
How to Evaluate your Technical PartnerHow to Evaluate your Technical Partner
How to Evaluate your Technical Partner
Oscar Merida
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
Oscar Merida
 
Migrate without migranes
Migrate without migranesMigrate without migranes
Migrate without migranes
Oscar Merida
 
Hitch yourwagon
Hitch yourwagonHitch yourwagon
Hitch yourwagon
Oscar Merida
 

More from Oscar Merida (11)

PHP OOP
PHP OOPPHP OOP
PHP OOP
 
Start using PHP 7
Start using PHP 7Start using PHP 7
Start using PHP 7
 
Symfony console: build awesome command line scripts with ease
Symfony console: build awesome command line scripts with easeSymfony console: build awesome command line scripts with ease
Symfony console: build awesome command line scripts with ease
 
Integration Testing with Behat drupal
Integration Testing with Behat drupalIntegration Testing with Behat drupal
Integration Testing with Behat drupal
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
 
Staying Sane with Drupal (A Develper's Survival Guide)
Staying Sane with Drupal (A Develper's Survival Guide)Staying Sane with Drupal (A Develper's Survival Guide)
Staying Sane with Drupal (A Develper's Survival Guide)
 
How to Evaluate your Technical Partner
How to Evaluate your Technical PartnerHow to Evaluate your Technical Partner
How to Evaluate your Technical Partner
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
 
Migrate without migranes
Migrate without migranesMigrate without migranes
Migrate without migranes
 
Hitch yourwagon
Hitch yourwagonHitch yourwagon
Hitch yourwagon
 

Recently uploaded

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 

Recently uploaded (20)

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 

Publishing alchemy with markdown and pandoc

  • 1. Publishing Alchemy with Markdown and pandoc Oscar Merida July 22, 2014 Contents Alchemy? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Alchemy! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Our Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 What can we do with them? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Genesis of Markdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Markdown Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Markdown Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Flavors of Markdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Markdown plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Markdown Syntax - Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Markdown Syntax - Text Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Markdown Syntax - Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Markdown Syntax - Unordered Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Markdown Syntax - Ordered Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Markdown Syntax - Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Markdown Syntax - Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Markdown Syntax - Simple Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Markdown Syntax - Grid Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Markdown Syntax - Grid Tables, 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Markdown Syntax - Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 A simple markdown example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 A simple markdown example, rendered. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Example, As HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Pandoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Pandoc extensions to markdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Structuring a large document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1
  • 2. PDF output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 .epub output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 About me . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2
  • 3. Alchemy? Figure 1: Alchemist - Joseph Wright Alchemy! Alchemy is an influential philosophical tradition whose practitioners have, from antiquity, claimed it to be the precursor to profound powers. Our Tools • Markdown, a plain text format for writing. • Pandoc, a command line tool for converting from one markup to another. What can we do with them? • Prepare technical and other documentation for projects • Write articles for a blog • Publish a book • Create slides for a presentation 3
  • 4. Genesis of Markdown Created in 2004 by John Gruber and contributions from Aaron Swartz “to write using an easy-to-read, easy-to-write plain text format, and optionally convert it to structurally valid XHTML (or HTML)” See the release: http://daringfireball.net/projects/markdown/ Markdown Advantages • Plain text, easier to focus on writing • Files are easy to version with git, svn, etc • Much more readable than raw HTML • Editable in any text editor, and. . . Markdown Editors • MarkdownPad for Windows • Mou, iA Writer on • ReText for Linux • Online markdown editors like dillinger.io • and many others for iOs, Android, etc Flavors of Markdown Unfortunately there is not a clearly defined Markdown standard • Github markdown – URL autolinking, strikethrough, fenced code blocks, syntax highlighting • MultiMarkdown – footnotes, tables, citations, captions • Markdown Extra – fenced code blocks, tables, footnotes • Pandoc Markdown – tables, syntax highlighting, inline footnotes Markdown plugins • For Wordpress, WP-Markdown • For Drupal, Markdown filter • PHP, PHP Markdown Extra • As a service StackEdit • Javascript Editor EpicEditor 4
  • 5. Markdown Syntax - Headings • One or more # • Provide document structure # Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 <h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> Markdown Syntax - Text Blocks • Paragraphs are separated by a new line. • Block Quotes begin with a >. I should have used lorem ipsum here as an example of text > And here is another paragraph I should have used lorem ipsum here as an example of text And here is another paragraph Markdown Syntax - Formatting *italic* _italic_ **bold**__bold__ ‘monospace‘ italic italic bold bold monospace Markdown Syntax - Unordered Lists • Bullets can be +, -, * • Nested lists are indented by 4 spaces. - One * Sub One - Two - Three 5
  • 6. • One – Sub One • Two • Three Markdown Syntax - Ordered Lists • Numbered lists use numbers followed by a period. • Nested lists are indented by 4 spaces. 1. One 1. Another Level 3. And more 1. Two 1. Something Else 1. One 1. Another Level 2. And more 2. Two 3. Something Else Markdown Syntax - Links • Link text is enclosed with square brackets []. • Alternatively, links in angled brackets <> will show the URL • URL in Parentheses, – can use absolute, relative paths too Read [my blog](http://bytesinthemargin.com/) <http://bytesinthemargin.com> Read my blog http://bytesinthemargin.com 6
  • 7. Markdown Syntax - Images • Same format as URL, but starts with ! ![Need Work](./images/jobless-cylon.jpg) 7
  • 8. Markdown Syntax - Simple Tables • More than one way to specify tables, varies by implementation • Simple tables Right Left Center Default ------- ------ ---------- ------- 12 12 12 12 123 123 123 123 1 1 1 1 Right Left Center Default 12 12 12 12 123 123 123 123 1 1 1 1 Markdown Syntax - Grid Tables +---------------+---------------+--------------------+ | Fruit | Price | Advantages | +===============+===============+====================+ | Bananas | $1.34 | - built-in wrapper | | | | - bright color | +---------------+---------------+--------------------+ | Oranges | $2.10 | - cures scurvy | | | | - tasty | +---------------+---------------+--------------------+ Markdown Syntax - Grid Tables, 2 Fruit Price Advantages Bananas $1.34 • built-in wrapper • bright color Oranges $2.10 • cures scurvy • tasty 8
  • 9. Markdown Syntax - Code Samples • Original markdown indents code block with four spaces • Larger code blocks should use fenced code blocks ~~~~{.php} <?php echo "Hello World. Today is"; echo date(’Y-m-d H:i’); ~~~~ <?php echo "Hello World. Today is"; echo date(’Y-m-d H:i’); 9
  • 10. A simple markdown example. ![USSF Logo](./images/US_Soccer_logo.png) The United States Men’s national team advanced from Group G in the 2014 World Cup held in Brazil. With a win against Ghana, a last minute tie against Brazil, the team secured 4 points and second place. Final standings are shown below. Team W D L ------- --- --- --- Germany 2 1 0 USA 1 1 1 Portugal 1 1 1 Ghana 0 1 2 Source: [Wikipedia](https://en.wikipedia.org/wiki/2014_FIFA_World_Cup#Group_G) A simple markdown example, rendered. Figure 2: USSF Logo The United States Men’s national team advanced from Group G in the 2014 World Cup held in Brazil. With a win against Ghana, a last minute tie against Brazil, the team secured 4 points and second place. Final standings are shown below. Team W D L Germany 2 1 0 USA 1 1 1 Portugal 1 1 1 Ghana 0 1 2 Source: Wikipedia 10
  • 11. Example, As HTML <h1>A simple markdown example, rendered.</h1> <div class="figure"> <img src="./images/US_Soccer_logo.png" alt="USSF Logo"><p class="caption">USSF Logo</p> </div> <p>The United States Men’s national team advanced from Group G in the 2014 World Cup held in Brazil.</p> <p>With a win against Ghana, a last minute tie against Brazil, the team secured 4 points and second place. Final standings are shown below.</p> <table> <thead> <tr class="header"> <th align="left">Team</th> <th align="left">W</th> <th align="left">D</th> <th align="left">L</th> </tr> </thead> <tbody> <tr class="odd"> <td align="left">Germany</td> <td align="left">2</td> <td align="left">1</td> <td align="left">0</td> </tr> <tr class="even"> <td align="left">USA</td> <td align="left">1</td> <td align="left">1</td> <td align="left">1</td> </tr> <tr class="odd"> <td align="left">Portugal</td> <td align="left">1</td> <td align="left">1</td> <td align="left">1</td> </tr> <tr class="even"> <td align="left">Ghana</td> <td align="left">0</td> <td align="left">1</td> <td align="left">2</td> </tr> </tbody> </table> <p>Source: <a href="https://en.wikipedia.org/wiki/2014_FIFA_World_Cup#Group_G">Wikipedia</a></p> 11
  • 12. Pandoc • Written in Haskell • Converts markup in one format to another • From – Markdown – HTML – LaText, and more • To – PDF – Latex, – EPUP, and more • Read the Instructions for Installing Pandoc – Windows, Mac OS X, Linux, BSD Pandoc extensions to markdown Thus, while pandoc allows the embedding of raw HTML, it discourages it, and provides other, non-HTMLish ways of representing important document elements like definition lists, tables, mathematics, and footnotes. • Fancier lists – Uppercase & lowercase letters, or Roman numerals • Definition lists • Inline footnotes • Built in syntax highlighting Read the Pandoc Documentation for details. Structuring a large document What if you’re writing a book, or long report? What if you have multiple contributors? • Break up document into multiple files. – One chapter per file – Use a naming convention so that listing the files will put them in sequence ∗ 001-introduction.md ∗ chapter-01.md • Put figures & Images in an images folder • Use Git or Subversion to commit your changes, update to get other’s changes. • Use a build script to execute pandoc 12
  • 13. PDF output • Requires a LaTeX engine • --toc --toc-depth=N adds a Table of Contents • “ to use raw tex commands • Use pagebreak in your markdown to control Page Breaks Convert markdown to pdf: pandoc -s --toc --toc-depth=2 -o alchemy-markdown-pandoc.pdf slides.md See this presentation a PDF .epub output • epub is a free & open e-book standard that uses HTML & CSS. • Need an xml file for epub metadata. <dc:title>Publishing Alchemy with Markdown and pandoc</dc:title> <dc:language>en-US</dc:language> <dc:creator opf:file-as="Merida, Oscar" opf:role="aut">Oscar Merida</dc:creator> <dc:date opf:event="publication">2014-07-29</dc:date> <dc:rights>Copyright c 2014 by Oscar Merida</dc:rights> Convert markdown to epub pandoc -s --toc --toc-depth=2 -o alchemy-markdown-pandoc.epub --epub-cover-image=images/cover.jpg --epub-metadata=book.xml slides.md See this presentation an epub Further Reading • PuppetLabs: How We Automated Our Ebook Builds With Pandoc and KindleGen • Convert from Word to markdown • A Markdown Epub Builder • Convert epub to MOBI with KindleGen • S5 Html based Slide Shows • Pandoc and LaTeX About me • PHP Developer since PHP3 day • Drupal since 4.x • php[architect] monthly magazine – always looking for contributors – we do books & training too! • Follow me @omerida • php[world] this November http://world.phparch.com 13