提交 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 deprecated
*~ *~
pandoc.template pandoc.template
.DS_Store .DS_Store
\ No newline at end of file .idea
py_env*
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
files: \.md$ files: \.md$
- id: remove-tabs - id: remove-tabs
files: \.md$ files: \.md$
- repo: git://github.com/reyoung/pre-commit-hooks-jinja-compile.git
sha: 85ad800cbc9c60a64230d60971aa9576fd57e508
hooks:
- id: convert-jinja2-into-html
- repo: local - repo: local
hooks: hooks:
- id: convert-markdown-into-html - id: convert-markdown-into-html
...@@ -31,4 +35,5 @@ ...@@ -31,4 +35,5 @@
description: "Convert README.md into index.html and README.en.md into index.en.html" 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 entry: python pre-commit-hooks/convert_markdown_into_html.py
language: system language: system
files: \.md$ files: .+README(\.en)?\.md$
...@@ -15,7 +15,7 @@ addons: ...@@ -15,7 +15,7 @@ addons:
- python-pip - python-pip
- python2.7-dev - python2.7-dev
before_install: before_install:
- pip install virtualenv pre-commit - pip install -U virtualenv pre-commit pip
script: script:
- travis/precommit.sh - travis/precommit.sh
notifications: notifications:
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
<!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<script type="text/x-mathjax-config"> <meta charset="UTF-8">
MathJax.Hub.Config({ <title>深度学习入门</title>
extensions: ["tex2jax.js", "TeX/AMSsymbols.js", "TeX/AMSmath.js"], <link href="http://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet">
jax: ["input/TeX", "output/HTML-CSS"], <script src="http://cdn.bootcss.com/tether/1.4.0/js/tether.js"></script>
tex2jax: { <script src="http://cdn.bootcss.com/jquery/3.1.0/jquery.slim.js"></script>
inlineMath: [ ['$','$'] ], <script src="http://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
displayMath: [ ['$$','$$'] ], <style>
processEscapes: true .left-panel {
}, background: #ecedee;
"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;
} }
</style>
<body> .left-panel .card-header {
background: #ecedee;
<div id="context" class="container markdown-body"> }
</div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> .left-panel .card-header a {
<div id="markdown" style='display:none'> font-size: 13px;
# 深度学习入门 font-weight: bolder;
}
1. 新手入门 [[fit_a_line](fit_a_line/)] [[html](http://book.paddlepaddle.org/fit_a_line)] .left-panel .card-block a {
1. 识别数字 [[recognize_digits](recognize_digits/)] [[html](http://book.paddlepaddle.org/recognize_digits)] border-radius: 0px;
1. 图像分类 [[image_classification](image_classification/)] [[html](http://book.paddlepaddle.org/image_classification)] font-size: 13px;
1. 词向量 [[word2vec](word2vec/)] [[html](http://book.paddlepaddle.org/word2vec)] padding-left: 40px;
1. 情感分析 [[understand_sentiment](understand_sentiment/)] [[html](http://book.paddlepaddle.org/understand_sentiment)] background: #e4e6e9;
1. 语义角色标注 [[label_semantic_roles](label_semantic_roles/)] [[html](http://book.paddlepaddle.org/label_semantic_roles)] border: 1px solid rgba(0,0,0,.125);
1. 机器翻译 [[machine_translation](machine_translation/)] [[html](http://book.paddlepaddle.org/machine_translation)] }
1. 个性化推荐 [[recommender_system](recommender_system/)] [[html](http://book.paddlepaddle.org/recommender_system)]
<br/> .left-panel .card-block a.active_color {
<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>进行许可。 font-color: rgb(70, 74, 76);
font-weight: bolder;
}
</div> </style>
<!-- You can change the lines below now. --> </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"> </iframe>
marked.setOptions({ </div>
renderer: new marked.Renderer(), </div>
gfm: true, </div>
breaks: false, <script>
smartypants: true, $('#content_iframe').on('load', function(){
highlight: function(code, lang) { $("#content_iframe").height(200) // trick code to shrink iframe size
code = code.replace(/&amp;/g, "&") $("#content_iframe").height($('#content_iframe').contents().find("body").height()+20)
code = code.replace(/&gt;/g, ">") });
code = code.replace(/&lt;/g, "<") </script>
code = code.replace(/&nbsp;/g, " ")
return hljs.highlightAuto(code, [lang]).value;
}
});
document.getElementById("context").innerHTML = marked(
document.getElementById("markdown").innerHTML)
</script>
</body> </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 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -39,7 +39,7 @@ HEAD = """ ...@@ -39,7 +39,7 @@ HEAD = """
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- 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 ...@@ -13,7 +13,9 @@ export PATH=/usr/bin:$PATH
pre-commit install pre-commit install
if ! pre-commit run -a ; then if ! pre-commit run -a ; then
ls -lh
git diff --exit-code git diff --exit-code
exit 1
fi fi
trap : 0 trap : 0
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- This block will be replaced by each markdown file content. Please do not change lines below.-->
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<body> <body>
<div id="context" class="container markdown-body"> <div id="context" class="container-fluid markdown-body">
</div> </div>
<!-- This block will be replaced by each markdown file content. Please do not change lines below.--> <!-- 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.
先完成此消息的编辑!
想要评论请 注册