SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
webhostingguy
 
Flash File Format Specification
Flash File Format SpecificationFlash File Format Specification
Flash File Format Specification
guest0ebe1e
 
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
webhostingguy
 
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
 
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
 
CPanel 1.01 User Guide
CPanel 1.01 User GuideCPanel 1.01 User Guide
CPanel 1.01 User Guide
webhostingguy
 
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
 

Was ist angesagt? (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
 

Ähnlich wie Publishing alchemy with markdown and pandoc

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_27
juergenuk
 
Java script tools guide cs6
Java script tools guide cs6Java script tools guide cs6
Java script tools guide cs6
Sadiq 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 redp4258
Banking at Ho Chi Minh city
 
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
hernajes
 

Ähnlich wie 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
 

Mehr von Oscar Merida

Mehr von 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
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

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