title | author | date | website |
---|---|---|---|
HTML tempalte for pandoc |
Emux |
2014-06-16 |
This template provide some useful features as following:
- Pure and fresh layout;
- Powerful TOC(Table Of Conent), powered by Bootstrap;
- UTF-8 encoding(Such as Chinese) for figures generated by Knitr;
- Go-To-Top and Full-Screen button;
- Prism style for Sytax Highlighting;
- Create reference to Table or Figure easily;
Install Pandoc and excute the command to generate HTML file, and access this generated file with your favourite web browser.
$pandoc README.md -o README.html --template template/pandoc --toc
I would like to write under a quiet and clean environment.
I felt a great affinity with Markdown when the first time I met it, It is pure and clean, helps me to focus on writing without any other noise.
I use Pandoc to convert the Markdown to HTML file usually. But when I create figure with R, I will use Knitr.
TODO
TODO
I will write some code in this section.
A simple C code fragment.
#include <stdio.h>
#define PI 3.1415
/**
* @brief The entry of this program
*
* @param argc counts of argument
* @param argv argument variables stored in
*
* @return EXIT_SUCCESS
*/
int main (void)
{
const char *str = "Hello world!";
if (36877)
{
//Print "Hello world!"
printf ("%s\n", str);
}
return EXIT_SUCCESS;
}
This R code will genreate Fig2.
data <- read.csv("analysis.csv", header=TRUE, nrows=200, encoding="utf-8",
fileEncoding="utf-8", stringsAsFactors = FALSE)
#1. Input data
#2. Setup bar width and color
#3. Flip X and Y coordinarate
#4. Intesect axis to origin
data$Done <- rev(data$Done)
data$Description <- rev(data$Description)
ggplot(data, aes(x=factor(Description,
levels=unique(Description)), y=Done)) +
geom_bar(fill=ifelse(data$Done == 100, "#669900", "#0077AA"), width=.3,
stat="identity",
position = position_dodge(width = 0.1)) +
coord_flip() +
scale_y_continuous(limits = c(0, 100), expand = c(0, 0),
breaks=c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)) +
geom_text(aes(label = Done), vjust = 0.3, hjust = -0.3,
colour = "#0077AA", size = 8) +
theme_pandoc()
dev.off()
Tables Are Cool
11 12 13 21 22 33 31 32 33
:Table1 An table example1
11 12 13 1 21 22 33 2 31 32 33 3
:Table2 Another table example
The reference to tables are Table1 and Table2.
On the first section you see Fig1, and it's a simple reference way to use.
And Fig2 is another figure.
This template supports H1 to H6 headers.
Some
Contents
In
This
Section.
This
Section
Is H4 Header
Some
Contents
Too
Ok
Write
Someting
Write
Someting
You
Want
Foo
Bar
Bala
Bala
Yes
Another H5 header
Just
Another
H6 header
Content
Footnotes
-
Just an exmaple. ↩