提交 b0349e4b 编写于 作者: Y Yu Yang

Refine current front page of book.

* Seperate convert_jinja2_into_html into different repo.
  * It seems a bug of pre-commit tools
上级 3a5ab5d9
deprecated
*~
pandoc.template
.DS_Store
\ No newline at end of file
.DS_Store
.idea
py_env*
......@@ -24,6 +24,10 @@
files: \.md$
- id: remove-tabs
files: \.md$
- repo: git://github.com/reyoung/pre-commit-hooks-jinja-compile.git
sha: 85ad800cbc9c60a64230d60971aa9576fd57e508
hooks:
- id: convert-jinja2-into-html
- repo: local
hooks:
- id: convert-markdown-into-html
......@@ -31,4 +35,5 @@
description: "Convert README.md into index.html and README.en.md into index.en.html"
entry: python pre-commit-hooks/convert_markdown_into_html.py
language: system
files: \.md$
files: .+README(\.en)?\.md$
......@@ -15,7 +15,7 @@ addons:
- python-pip
- python2.7-dev
before_install:
- pip install virtualenv pre-commit
- pip install -U virtualenv pre-commit pip
script:
- travis/precommit.sh
notifications:
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSsymbols.js", "TeX/AMSmath.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'] ],
displayMath: [ ['$$','$$'] ],
processEscapes: true
},
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" async></script>
<script type="text/javascript" src="../.tmpl/marked.js">
</script>
<link href="http://cdn.bootcss.com/highlight.js/9.9.0/styles/darcula.min.css" rel="stylesheet">
<script src="http://cdn.bootcss.com/highlight.js/9.9.0/highlight.min.js"></script>
<link href="http://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/perfect-scrollbar/0.6.14/css/perfect-scrollbar.min.css" rel="stylesheet">
<link href="../.tmpl/github-markdown.css" rel='stylesheet'>
</head>
<style type="text/css" >
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
<meta charset="UTF-8">
<title>深度学习入门</title>
<link href="http://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet">
<script src="http://cdn.bootcss.com/tether/1.4.0/js/tether.js"></script>
<script src="http://cdn.bootcss.com/jquery/3.1.0/jquery.slim.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
<style>
.left-panel {
background: #ecedee;
}
</style>
<body>
<div id="context" class="container markdown-body">
</div>
.left-panel .card-header {
background: #ecedee;
}
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
<div id="markdown" style='display:none'>
# 深度学习入门
.left-panel .card-header a {
font-size: 13px;
font-weight: bolder;
}
1. 新手入门 [[fit_a_line](fit_a_line/)] [[html](http://book.paddlepaddle.org/fit_a_line)]
1. 识别数字 [[recognize_digits](recognize_digits/)] [[html](http://book.paddlepaddle.org/recognize_digits)]
1. 图像分类 [[image_classification](image_classification/)] [[html](http://book.paddlepaddle.org/image_classification)]
1. 词向量 [[word2vec](word2vec/)] [[html](http://book.paddlepaddle.org/word2vec)]
1. 情感分析 [[understand_sentiment](understand_sentiment/)] [[html](http://book.paddlepaddle.org/understand_sentiment)]
1. 语义角色标注 [[label_semantic_roles](label_semantic_roles/)] [[html](http://book.paddlepaddle.org/label_semantic_roles)]
1. 机器翻译 [[machine_translation](machine_translation/)] [[html](http://book.paddlepaddle.org/machine_translation)]
1. 个性化推荐 [[recommender_system](recommender_system/)] [[html](http://book.paddlepaddle.org/recommender_system)]
.left-panel .card-block a {
border-radius: 0px;
font-size: 13px;
padding-left: 40px;
background: #e4e6e9;
border: 1px solid rgba(0,0,0,.125);
}
<br/>
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="知识共享许可协议" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" property="dct:title" rel="dct:type">本教程</span><a xmlns:cc="http://creativecommons.org/ns#" href="http://book.paddlepaddle.org" property="cc:attributionName" rel="cc:attributionURL">PaddlePaddle</a> 创作,采用 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">知识共享 署名-非商业性使用-相同方式共享 4.0 国际 许可协议</a>进行许可。
.left-panel .card-block a.active_color {
font-color: rgb(70, 74, 76);
font-weight: bolder;
}
</div>
<!-- You can change the lines below now. -->
</style>
</head>
<body>
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse">
<a class="navbar-brand mr-auto" href="#">
<img alt="PaddlePaddle" src="./.theme/PP_w.png">
</a>
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="nav-link" href="http://paddlepaddle.org">首页</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="#">深度学习入门<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">English</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/PaddlePaddle/book/">Fork on Github</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-3 pl-1 pr-1 left-panel">
<div id="accordion" role="tablist" aria-multiselectable="true">
<div class="card">
<div class="card-header" role="tab" id="headingOne">
<h5 class="mb-0">
<a aria-expanded="true" aria-controls="collapseOne">
深度学习入门
</a>
</h5>
</div>
<div id="collapseOne" class="rounded-0 collapse show" role="tabpanel" aria-labelledby="headingOne">
<div class="card-block pl-0 pr-0 pt-0 pb-0">
<div class="list-group ">
<a href="./fit_a_line/index.html" target="content_iframe" class="list-group-item list-group-item-action">
新手入门
</a>
<a href="./recognize_digits/index.html" target="content_iframe" class="list-group-item list-group-item-action">
识别数字
</a>
<a href="./image_classification/index.html" target="content_iframe" class="list-group-item list-group-item-action">
图像分类
</a>
<a href="./word2vec/index.html" target="content_iframe" class="list-group-item list-group-item-action">
词向量
</a>
<a href="./understand_sentiment/index.html" target="content_iframe" class="list-group-item list-group-item-action">
情感分析
</a>
<a href="./label_semantic_roles/index.html" target="content_iframe" class="list-group-item list-group-item-action">
语义角色标注
</a>
<a href="./machine_translation/index.html" target="content_iframe" class="list-group-item list-group-item-action">
机器翻译
</a>
<a href="./recommender_system/index.html" target="content_iframe" class="list-group-item list-group-item-action">
个性化推荐
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<iframe src="./fit_a_line/index.html" style="border: none;" width="100%" height="100%" name="content_iframe" id="content_iframe">
<script type="text/javascript">
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
breaks: false,
smartypants: true,
highlight: function(code, lang) {
code = code.replace(/&amp;/g, "&")
code = code.replace(/&gt;/g, ">")
code = code.replace(/&lt;/g, "<")
code = code.replace(/&nbsp;/g, " ")
return hljs.highlightAuto(code, [lang]).value;
}
});
document.getElementById("context").innerHTML = marked(
document.getElementById("markdown").innerHTML)
</script>
</iframe>
</div>
</div>
</div>
<script>
$('#content_iframe').on('load', function(){
$("#content_iframe").height(200) // trick code to shrink iframe size
$("#content_iframe").height($('#content_iframe').contents().find("body").height()+20)
});
</script>
</body>
</html>
\ No newline at end of file
{
"chapters": [
{
"name": "新手入门",
"link": "./fit_a_line/index.html"
},
{
"name": "识别数字",
"link": "./recognize_digits/index.html"
},
{
"name": "图像分类",
"link": "./image_classification/index.html"
},
{
"name": "词向量",
"link": "./word2vec/index.html"
},
{
"name": "情感分析",
"link": "./understand_sentiment/index.html"
},
{
"name": "语义角色标注",
"link": "./label_semantic_roles/index.html"
},
{
"name": "机器翻译",
"link": "./machine_translation/index.html"
},
{
"name": "个性化推荐",
"link": "./recommender_system/index.html"
}
]
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>深度学习入门</title>
<link href="http://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet">
<script src="http://cdn.bootcss.com/tether/1.4.0/js/tether.js"></script>
<script src="http://cdn.bootcss.com/jquery/3.1.0/jquery.slim.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
<style>
.left-panel {
background: #ecedee;
}
.left-panel .card-header {
background: #ecedee;
}
.left-panel .card-header a {
font-size: 13px;
font-weight: bolder;
}
.left-panel .card-block a {
border-radius: 0px;
font-size: 13px;
padding-left: 40px;
background: #e4e6e9;
border: 1px solid rgba(0,0,0,.125);
}
.left-panel .card-block a.active_color {
font-color: rgb(70, 74, 76);
font-weight: bolder;
}
</style>
</head>
<body>
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse">
<a class="navbar-brand mr-auto" href="#">
<img alt="PaddlePaddle" src="./.theme/PP_w.png">
</a>
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="nav-link" href="http://paddlepaddle.org">首页</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="#">深度学习入门<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">English</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/PaddlePaddle/book/">Fork on Github</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-3 pl-1 pr-1 left-panel">
<div id="accordion" role="tablist" aria-multiselectable="true">
<div class="card">
<div class="card-header" role="tab" id="headingOne">
<h5 class="mb-0">
<a aria-expanded="true" aria-controls="collapseOne">
深度学习入门
</a>
</h5>
</div>
<div id="collapseOne" class="rounded-0 collapse show" role="tabpanel" aria-labelledby="headingOne">
<div class="card-block pl-0 pr-0 pt-0 pb-0">
<div class="list-group ">
{% for chapter in chapters %}
<a href="{{ chapter.link }}" target="content_iframe" class="list-group-item list-group-item-action">
{{ chapter.name }}
</a>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<iframe src="./fit_a_line/index.html" style="border: none;" width="100%" height="100%" name="content_iframe" id="content_iframe">
</iframe>
</div>
</div>
</div>
<script>
$('#content_iframe').on('load', function(){
$("#content_iframe").height(200) // trick code to shrink iframe size
$("#content_iframe").height($('#content_iframe').contents().find("body").height()+20)
});
</script>
</body>
</html>
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -39,7 +39,7 @@ HEAD = """
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -13,7 +13,9 @@ export PATH=/usr/bin:$PATH
pre-commit install
if ! pre-commit run -a ; then
ls -lh
git diff --exit-code
exit 1
fi
trap : 0
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
......@@ -35,7 +35,7 @@
<body>
<div id="context" class="container markdown-body">
<div id="context" class="container-fluid markdown-body">
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册