forked from yejq/note-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="generator" content="pandoc"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> | ||
<title></title> | ||
<style type="text/css">code{white-space: pre;}</style> | ||
<!--[if lt IE 9]> | ||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | ||
<![endif]--> | ||
<link rel="stylesheet" href="css/manual.css"> | ||
</head> | ||
<body> | ||
<nav id="TOC"> | ||
<ul> | ||
<li><a href="#markdownpandocmarkdownpad2github-打造传世笔记模板">Markdown+Pandoc+MarkdownPad2+Github 打造传世笔记模板</a><ul> | ||
<li><a href="#工具">工具</a></li> | ||
<li><a href="#使用步骤">使用步骤</a><ul> | ||
<li><a href="#附java代码着色例子">附java代码着色例子</a></li> | ||
<li><a href="#图片例子">图片例子</a></li> | ||
</ul></li> | ||
</ul></li> | ||
</ul> | ||
</nav> | ||
<h1 id="markdownpandocmarkdownpad2github-打造传世笔记模板">Markdown+Pandoc+MarkdownPad2+Github 打造传世笔记模板</h1> | ||
<p>决定不用word写笔记之后,用的是Windows7,找了许多高手做笔记的相关文章,用到的相关技术有DocBook、reStructuredText、MarkDown、Sphinx、Pandoc。</p> | ||
<p>reStructuredText+Sphinx的组合是不错的选择,可惜reStructuredText没有令人满意的编辑器,eclipse有插件ReST,但是不好用,样式不好看,代码提示时好时坏;Sphinx是Python的帮助文档生成工具,很强大,试用了下的确很强大,可惜还是不太适合我,虽然有强大的BootStrap theme可以用,但是生成pdf很麻烦的说。-_-</p> | ||
<p>折腾了N天,最终选择了<code>Markdown+Pandoc+MarkdownPad2+Github</code>的组合。</p> | ||
<ul> | ||
<li>Git的强大自不必说;</li> | ||
<li>Markdown的语法简洁容易上手;</li> | ||
<li>Pandoc功能强大,N多格式转换,支持自定义模板、footer、css,于是代码着色用了prism;</li> | ||
<li>MarkdownPad2实在是太好用的一款编辑器,尤其是导出pdf,还带标签哦,word导出不带标签的问题没有了,至于唯一的缺点就是Pro版收费,对于土(diao)豪(si)来说这都不是事,当然是购(po)买(jie)了。</li> | ||
<li>本人还集成了小火箭哦,很酷炫。</li> | ||
</ul> | ||
<h2 id="工具">工具</h2> | ||
<ul> | ||
<li>安装pandoc,<a href="http://johnmacfarlane.net/pandoc/installing.html" title="http://johnmacfarlane.net/pandoc/installing.html">http://johnmacfarlane.net/pandoc/installing.html</a>,安装好之后设置环境变量,WIN7下目录是C:{username},设置到Path中,重启电脑;</li> | ||
<li>安装MarkdownPad2,找到一个绿色破解版(放到我的网盘上了,<a href="http://yunpan.cn/QhPuD6RU9QCpP" title="http://yunpan.cn/QhPuD6RU9QCpP">http://yunpan.cn/QhPuD6RU9QCpP</a>,提取码:82b7),会报毒,不过貌似用着也没事(个人感觉)。解压到任意目录,启动程序,注册随便输入邮箱和key都可以,一定要设置不更新程序(选项-高级-自动更新频率设置为从不),如果不小心更新了,重新覆盖所有文件就可以了。</li> | ||
</ul> | ||
<h2 id="使用步骤">使用步骤</h2> | ||
<ol style="list-style-type: decimal"> | ||
<li>解压note-demo.rar,这是原版demo的完整压缩包;</li> | ||
<li>源码在source包里边,笔记写到index.md就可以,用MarkdownPad2打开它编辑,图片就放在images里边;</li> | ||
<li>index.md编辑完之后,双击build.bat,即可完成html格式的输出,放在build/html/index.html;</li> | ||
<li>pdf格式直接用MarkdownPad2导出就可以了;</li> | ||
</ol> | ||
<p>好了,done。</p> | ||
<h3 id="附java代码着色例子">附java代码着色例子</h3> | ||
<p><code>~~~~ {.language-java}</code>表示加上样式class=language-java:</p> | ||
<pre class="language-java"><code> | ||
package org.example.config; | ||
|
||
@Configuration | ||
public class AppConfig { | ||
private @Value("#{jdbcProperties.url}") String jdbcUrl; | ||
private @Value("#{jdbcProperties.username}") String username; | ||
private @Value("#{jdbcProperties.password}") String password; | ||
|
||
@Bean | ||
public FooService fooService() { | ||
return new FooServiceImpl(fooRepository()); | ||
} | ||
|
||
@Bean | ||
public FooRepository fooRepository() { | ||
return new HibernateFooRepository(sessionFactory()); | ||
} | ||
|
||
@Bean | ||
public SessionFactory sessionFactory() { | ||
// wire up a session factory | ||
AnnotationSessionFactoryBean asFactoryBean = | ||
new AnnotationSessionFactoryBean(); | ||
asFactoryBean.setDataSource(dataSource()); | ||
// additional config | ||
return asFactoryBean.getObject(); | ||
} | ||
|
||
@Bean | ||
public DataSource dataSource() { | ||
return new DriverManagerDataSource(jdbcUrl, username, password); | ||
} | ||
} | ||
</code></pre> | ||
<h3 id="图片例子">图片例子</h3> | ||
<p><img src="images/bd315c6034a85edf5f6d00ae49540923dc54755e.jpg" /> <img src="images/20130816114129.jpg" /></p> | ||
<div style="display: none;" id="rocket-to-top"> | ||
<div style="opacity:0;display: block;" class="level-2"></div> | ||
<div class="level-3"></div> | ||
</div> | ||
<div class="footer"> | ||
© 版权所有 2014, yejq([email protected]).转载请上缴会费! | ||
</div> | ||
<script type="text/javascript" src="js/prism.js"></script> | ||
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script> | ||
<script type="text/javascript" src="js/sucaijiayuan.js"></script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Markdown+Pandoc+MarkdownPad2+Github 打造传世笔记模板 # | ||
决定不用word写笔记之后,用的是Windows7,找了许多高手做笔记的相关文章,用到的相关技术有DocBook、reStructuredText、MarkDown、Sphinx、Pandoc。 | ||
|
||
reStructuredText+Sphinx的组合是不错的选择,可惜reStructuredText没有令人满意的编辑器,eclipse有插件ReST,但是不好用,样式不好看,代码提示时好时坏;Sphinx是Python的帮助文档生成工具,很强大,试用了下的确很强大,可惜还是不太适合我,虽然有强大的BootStrap theme可以用,但是生成pdf很麻烦的说。-_- | ||
|
||
折腾了N天,最终选择了`Markdown+Pandoc+MarkdownPad2+Github`的组合。 | ||
|
||
- Git的强大自不必说; | ||
- Markdown的语法简洁容易上手; | ||
- Pandoc功能强大,N多格式转换,支持自定义模板、footer、css,于是代码着色用了prism; | ||
- MarkdownPad2实在是太好用的一款编辑器,尤其是导出pdf,还带标签哦,word导出不带标签的问题没有了,至于唯一的缺点就是Pro版收费,对于土(diao)豪(si)来说这都不是事,当然是购(po)买(jie)了。 | ||
- 本人还集成了小火箭哦,很酷炫。 | ||
|
||
## 工具 ## | ||
- 安装pandoc,[http://johnmacfarlane.net/pandoc/installing.html](http://johnmacfarlane.net/pandoc/installing.html "http://johnmacfarlane.net/pandoc/installing.html"),安装好之后设置环境变量,WIN7下目录是C:\Users\{username}\AppData\Local\Pandoc,设置到Path中,重启电脑; | ||
- 安装MarkdownPad2,找到一个绿色破解版(放到我的网盘上了,[http://yunpan.cn/QhPuD6RU9QCpP](http://yunpan.cn/QhPuD6RU9QCpP "http://yunpan.cn/QhPuD6RU9QCpP"),提取码:82b7),会报毒,不过貌似用着也没事(个人感觉)。解压到任意目录,启动程序,注册随便输入邮箱和key都可以,一定要设置不更新程序(选项-高级-自动更新频率设置为从不),如果不小心更新了,重新覆盖所有文件就可以了。 | ||
|
||
## 使用步骤 ## | ||
1. 解压note-demo.rar,这是原版demo的完整压缩包; | ||
2. 源码在source包里边,笔记写到index.md就可以,用MarkdownPad2打开它编辑,图片就放在images里边; | ||
3. index.md编辑完之后,双击build.bat,即可完成html格式的输出,放在build/html/index.html; | ||
4. pdf格式直接用MarkdownPad2导出就可以了; | ||
|
||
好了,done。 | ||
|
||
### 附java代码着色例子 ### | ||
`~~~~ {.language-java}`表示加上样式class=language-java: | ||
|
||
~~~~ {.language-java} | ||
package org.example.config; | ||
@Configuration | ||
public class AppConfig { | ||
private @Value("#{jdbcProperties.url}") String jdbcUrl; | ||
private @Value("#{jdbcProperties.username}") String username; | ||
private @Value("#{jdbcProperties.password}") String password; | ||
@Bean | ||
public FooService fooService() { | ||
return new FooServiceImpl(fooRepository()); | ||
} | ||
@Bean | ||
public FooRepository fooRepository() { | ||
return new HibernateFooRepository(sessionFactory()); | ||
} | ||
@Bean | ||
public SessionFactory sessionFactory() { | ||
// wire up a session factory | ||
AnnotationSessionFactoryBean asFactoryBean = | ||
new AnnotationSessionFactoryBean(); | ||
asFactoryBean.setDataSource(dataSource()); | ||
// additional config | ||
return asFactoryBean.getObject(); | ||
} | ||
@Bean | ||
public DataSource dataSource() { | ||
return new DriverManagerDataSource(jdbcUrl, username, password); | ||
} | ||
} | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
### 图片例子 ### | ||
![](images/bd315c6034a85edf5f6d00ae49540923dc54755e.jpg) | ||
![](images/20130816114129.jpg) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.