Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
dwb1994 committed Nov 9, 2018
1 parent 409f5c8 commit be9f41c
Show file tree
Hide file tree
Showing 107 changed files with 11,549 additions and 209 deletions.
46 changes: 18 additions & 28 deletions _site/documents/hooks.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,36 @@ <h4>全局钩子</h4>
<tr>
<th>名称</th>
<th>描述</th>
<th>参数</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>init</code></td>
<td>在生成文档站点前触发.</td>
<td></td>
</tr>
<tr>
<td><code>finish</code></td>
<td>在生成文档站点完成后触发.</td>
<td></td>
</tr>
<tr>
<td><code>nav</code></td>
<td>在解析导航 nav.md 后和解析文档前触发</td>
<td></td>
</tr>
<tr>
<td><code>assets</code></td>
<td>引用插件静态文件</td>
<td></td>
<td><code>book:before</code></td>
<td>加载 book 页面之前调用</td>
</tr>
</tbody>
</table>
<h4>页面钩子</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>描述</th>
<th>参数</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>page:before</code></td>
<td>在创建 html 页面之前调用</td>
<td>Page Object</td>
<td>加载 page 文件之前调用</td>
</tr>
<tr>
<td><code>page</code></td>
<td>生成 html 页面后调用</td>
<td>Page Object</td>
<td>加载 page 文件之后调用</td>
</tr>
<tr>
<td><code>book</code></td>
<td>加载 book 页面之后调用</td>
</tr>
<tr>
<td><code>finish</code></td>
<td>在生成文档站点完成后触发.</td>
</tr>
</tbody>
</table>
Expand All @@ -70,7 +55,12 @@ <h4>模板钩子</h4>
<tbody>
<tr>
<td><code>tpl:header</code></td>
<td>在页面导航添加自定义的 html</td>
<td>在页面 header 中添加自定义的 html</td>
<td></td>
</tr>
<tr>
<td><code>tpl:mask</code></td>
<td>用于添加遮罩层</td>
<td></td>
</tr>
</tbody>
Expand Down
96 changes: 48 additions & 48 deletions _site/documents/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,47 @@
</thead>
<tbody>
<tr>
<td>Content.jsx</td>
<td><code>Content.jsx</code></td>
<td>文档页内容</td>
</tr>
<tr>
<td>Footer.jsx (用户自定义组件)</td>
<td><code>Footer.jsx</code> (用户自定义组件)</td>
<td>Footer 信息</td>
</tr>
<tr>
<td>Head.jsx</td>
<td><code>Head.jsx</code></td>
<td>html 文件中 <head> 部分的内容</head></td>
</tr>
<tr>
<td>Header.jsx</td>
<td><code>Header.jsx</code></td>
<td>顶部导航</td>
</tr>
<tr>
<td>Homepage.jsx (用户自定义组件)</td>
<td><code>Homepage.jsx</code> (用户自定义组件)</td>
<td>文档站首页</td>
</tr>
<tr>
<td>Hook.jsx</td>
<td><code>Hook.jsx</code></td>
<td>钩子,用于自定义插件</td>
</tr>
<tr>
<td>Icon.jsx</td>
<td><code>Icon.jsx</code></td>
<td>favicon 图片</td>
</tr>
<tr>
<td>Layout.jsx</td>
<td><code>Layout.jsx</code></td>
<td>html 文件,其他组件的入口</td>
</tr>
<tr>
<td>Logo.jsx</td>
<td><code>Logo.jsx</code></td>
<td>配置网站的 logo</td>
</tr>
<tr>
<td>Scripts.jsx</td>
<td><code>Scripts.jsx</code></td>
<td>script 脚本</td>
</tr>
<tr>
<td>Summary.jsx</td>
<td><code>Summary.jsx</code></td>
<td>侧栏目录</td>
</tr>
</tbody>
Expand All @@ -70,39 +70,39 @@ <h3 id="变量-content.jsx(文档页内容)">Content.jsx(文档页内容
</thead>
<tbody>
<tr>
<td>props.distPath</td>
<td><code>props.distPath</code></td>
<td>当前页面路径</td>
</tr>
<tr>
<td>props.type</td>
<td><code>props.type</code></td>
<td>内容类型, markdown 页面为 'md'</td>
</tr>
<tr>
<td>props.content</td>
<td><code>props.content</code></td>
<td>页面内容,一段 html</td>
</tr>
<tr>
<td>props.prev</td>
<td><code>props.prev</code></td>
<td>上一页信息</td>
</tr>
<tr>
<td>props.prev.distPath</td>
<td><code>props.prev.distPath</code></td>
<td>上一页的相对路径</td>
</tr>
<tr>
<td>props.prev.title</td>
<td><code>props.prev.title</code></td>
<td>上一页的页面标题</td>
</tr>
<tr>
<td>props.next</td>
<td><code>props.next</code></td>
<td>下一页信息</td>
</tr>
<tr>
<td>props.next.distPath</td>
<td><code>props.next.distPath</code></td>
<td>下一页的相对路径</td>
</tr>
<tr>
<td>props.next.title</td>
<td><code>props.next.title</code></td>
<td>下一页的页面标题</td>
</tr>
</tbody>
Expand All @@ -117,27 +117,27 @@ <h3 id="变量-head.jsx(html-文件中-部分的内容)">Head.jsx(html 文
</thead>
<tbody>
<tr>
<td>props.distPath</td>
<td><code>props.distPath</code></td>
<td>当前页面路径</td>
</tr>
<tr>
<td>props.title</td>
<td><code>props.title</code></td>
<td>当前页面标题</td>
</tr>
<tr>
<td>props.config.author</td>
<td><code>props.config.author</code></td>
<td>网站作者</td>
</tr>
<tr>
<td>props.config.keywords</td>
<td><code>props.config.keywords</code></td>
<td>网站关键字</td>
</tr>
<tr>
<td>props.config.description</td>
<td><code>props.config.description</code></td>
<td>网站描述</td>
</tr>
<tr>
<td>props.assets.css</td>
<td><code>props.assets.css</code></td>
<td>钩子中的 css 路径</td>
</tr>
</tbody>
Expand All @@ -152,35 +152,35 @@ <h3 id="变量-header.jsx(顶部导航)">Header.jsx(顶部导航)</h3>
</thead>
<tbody>
<tr>
<td>props.distPath</td>
<td><code>props.distPath</code></td>
<td>当前页面路径</td>
</tr>
<tr>
<td>props.title</td>
<td><code>props.title</code></td>
<td>当前页面标题</td>
</tr>
<tr>
<td>props.config.author</td>
<td><code>props.config.author</code></td>
<td>网站作者</td>
</tr>
<tr>
<td>props.config.keywords</td>
<td><code>props.config.keywords</code></td>
<td>网站关键字</td>
</tr>
<tr>
<td>props.config.description</td>
<td><code>props.config.description</code></td>
<td>网站描述</td>
</tr>
<tr>
<td>props.assets.css</td>
<td><code>props.assets.css</code></td>
<td>钩子中的 css 路径</td>
</tr>
<tr>
<td>props.ydoc</td>
<td><code>props.ydoc</code></td>
<td>顶级 props</td>
</tr>
<tr>
<td>props.ydoc.bookpath</td>
<td><code>props.ydoc.bookpath</code></td>
<td>book 路径</td>
</tr>
</tbody>
Expand All @@ -195,7 +195,7 @@ <h3 id="变量-icon.jsx">Icon.jsx</h3>
</thead>
<tbody>
<tr>
<td>props.distPath</td>
<td><code>props.distPath</code></td>
<td>当前页面路径</td>
</tr>
</tbody>
Expand All @@ -210,27 +210,27 @@ <h3 id="变量-layout.jsx">Layout.jsx</h3>
</thead>
<tbody>
<tr>
<td>props.distPath</td>
<td><code>props.distPath</code></td>
<td>当前页面路径</td>
</tr>
<tr>
<td>props.summary</td>
<td><code>props.summary</code></td>
<td>侧栏目录配置</td>
</tr>
<tr>
<td>props.config</td>
<td><code>props.config</code></td>
<td>配置信息(ydoc 配置)</td>
</tr>
<tr>
<td>props.assets</td>
<td><code>props.assets</code></td>
<td>钩子中的 assets 配置</td>
</tr>
<tr>
<td>props.title</td>
<td><code>props.title</code></td>
<td>当前页面标题</td>
</tr>
<tr>
<td>props.page</td>
<td><code>props.page</code></td>
<td>页面信息</td>
</tr>
</tbody>
Expand All @@ -245,19 +245,19 @@ <h3 id="变量-logo.jsx">Logo.jsx</h3>
</thead>
<tbody>
<tr>
<td>props.distPath</td>
<td><code>props.distPath</code></td>
<td>当前页面路径</td>
</tr>
<tr>
<td>props.nav</td>
<td><code>props.nav</code></td>
<td>顶部导航信息(配置在 NAV.md 中)</td>
</tr>
<tr>
<td>props.nav.logo</td>
<td><code>props.nav.logo</code></td>
<td>logo</td>
</tr>
<tr>
<td>props.nav.title</td>
<td><code>props.nav.title</code></td>
<td>logo 旁的标题</td>
</tr>
</tbody>
Expand All @@ -272,7 +272,7 @@ <h3 id="变量-scripts.jsx">Scripts.jsx</h3>
</thead>
<tbody>
<tr>
<td>props.page.distPath</td>
<td><code>props.page.distPath</code></td>
<td>当前页面路径</td>
</tr>
</tbody>
Expand All @@ -287,11 +287,11 @@ <h3 id="变量-summary.jsx">Summary.jsx</h3>
</thead>
<tbody>
<tr>
<td>props.summary</td>
<td><code>props.summary</code></td>
<td>侧栏目录</td>
</tr>
<tr>
<td>props.releativePath</td>
<td><code>props.releativePath</code></td>
<td>目录项的相对路径</td>
</tr>
</tbody>
Expand Down
19 changes: 19 additions & 0 deletions _site/examples/homepage/about/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html><html lang="zh-CN"><head><meta charSet="UTF-8"/><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-status-bar-style" content="black"/><link rel="apple-touch-icon" sizes="180x180" href="../ydoc/images/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="../ydoc/images/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="../ydoc/images/favicon-16x16.png"/><link rel="manifest" href="../ydoc/images/manifest.json"/><link rel="mask-icon" href="../ydoc/images/safari-pinned-tab.svg" color="#5bbad5"/><meta name="theme-color" content="#ffffff"/><meta http-equiv="Cache-Control" content="no-transform"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>about</title><link rel="stylesheet" href="../ydoc/styles/style.css"/><meta name="author" content="ymfe"/><meta name="keywords"/><meta name="description" content="website description"/><meta id="releativePath" content=".."/><link rel="stylesheet" href="../ydoc/ydoc-plugin-search/search.css"/></head><body><div class="g-doc"><div class="m-main" id="js-panel"><header class="m-header" id="js-header"><div class="m-header-title js-logo"><a href="../index.html" target="_self"><img class="logo" width="36" src="../ydoc/images/[email protected]"/><h6 class="name">YDoc</h6></a></div><div><div class="m-search">
<div class="icon">&#xf0fd;</div>
<input type="text" class="input js-input" placeholder="搜索" />
<div class="m-search-result js-search-result"></div>
</div></div><nav class="m-header-nav js-nav"><ul class="m-header-items"><li class="item "><a class="href" href="../documents/index.html">documents</a></li><li class="item active"><a class="href" href="">about</a></li></ul></nav><div id="js-nav-btn" class="m-header-btn ui-font-ydoc"></div></header><div class="m-content" id="js-content"><h1>About</h1>
<p>
...
</p></div></div></div><div></div><script>
var $content = document.getElementById('js-content');
var $summaryItems = Array.prototype.slice.call(document.querySelectorAll('#js-menu .href'));
var $menu = document.getElementById('js-menu');
if ($menu && sessionStorage.menuScrollTop) {
$menu.scrollTop = sessionStorage.menuScrollTop;
}
// 刷新页面但不切换 pathname 的时候,内容区恢复到记忆的高度
if ($content && sessionStorage.contentScrollTop && window.location.pathname == sessionStorage.locationPathname) {
$content.scrollTop = sessionStorage.contentScrollTop;
}
sessionStorage.setItem('locationPathname', window.location.pathname);</script><script src="../ydoc/scripts/plugins/dollar.min.js"></script><script src="../ydoc/scripts/plugins/responsive-nav.min.js"></script><script src="../ydoc/scripts/plugins/slideout.min.js"></script><script src="../ydoc/scripts/app.js"></script><script src="../ydoc/ydoc-plugin-search/core.js"></script><script src="../ydoc/ydoc-plugin-search/search.js"></script><script src="../search_json.js"></script></body></html>
22 changes: 22 additions & 0 deletions _site/examples/homepage/documents/env.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html><html lang="zh-CN"><head><meta charSet="UTF-8"/><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-status-bar-style" content="black"/><link rel="apple-touch-icon" sizes="180x180" href="../ydoc/images/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="../ydoc/images/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="../ydoc/images/favicon-16x16.png"/><link rel="manifest" href="../ydoc/images/manifest.json"/><link rel="mask-icon" href="../ydoc/images/safari-pinned-tab.svg" color="#5bbad5"/><meta name="theme-color" content="#ffffff"/><meta http-equiv="Cache-Control" content="no-transform"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>env-documents</title><link rel="stylesheet" href="../ydoc/styles/style.css"/><meta name="author" content="ymfe"/><meta name="keywords"/><meta name="description" content="website description"/><meta id="releativePath" content=".."/><link rel="stylesheet" href="../ydoc/ydoc-plugin-search/search.css"/></head><body><div class="g-doc"><div class="m-aside"><div class="m-summary" id="js-menu"><div class="m-summary-content" id="js-menu-content"><div class="m-summary-block"><ul class="m-summary-list"><li class="item"><a href="installation.html" class="href">Installation</a></li></ul></div><div class="m-summary-block"><div class="m-summary-title">Getting Started</div><ul class="m-summary-list indent"><li class="item"><div class="m-summary-block"><a href="intro.html#" class="href">Introduction</a><ul class="m-summary-list indent"><li class="item"><a href="" class="href">env</a></li></ul></div></li></ul></div></div></div><div class="m-summary-switch" id="js-summary-switch"><svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="15" height="15" class="bottom"><g transform="translate(904.92214,-879.1482)"><path d="m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,-55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,-174.6858 c 96.079,-96.07721 175.253196,-174.68583 175.942696,-174.68583 0.6895,0 26.281,25.03215 56.8701,55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864-231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688,-104.0616 -231.873,-231.248 z" fill="#fff"></path></g></svg><svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="15" height="15" class="top"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="aaa" fill="#fff" fill-rule="nonzero"><path d="M231.2455,342.502 L0,111.25397 L55.6165,55.62697 C86.2056,25.03212 111.7971,-2.99999998e-05 112.4866,-2.99999998e-05 C113.176,-2.99999998e-05 192.3503,78.60859 288.4293,174.6858 L463.1185,349.3716 L637.8077,174.6858 C733.8867,78.60859 813.060896,-2.99999997e-05 813.750396,-2.99999997e-05 C814.439896,-2.99999997e-05 840.031396,25.03212 870.620496,55.62697 L926.236996,111.25397 L694.9915,342.502 C567.8065,469.6884 463.4636,573.75 463.1185,573.75 C462.7734,573.75 358.4305,469.6884 231.2455,342.502 Z" id="Shape" transform="translate(463.118498, 286.874985) scale(1, -1) translate(-463.118498, -286.874985) "></path></g></g></svg></div></div><div class="m-main" id="js-panel"><header class="m-header" id="js-header"><div class="m-header-title js-logo"><a href="../index.html" target="_self"><img class="logo" width="36" src="../ydoc/images/[email protected]"/><h6 class="name">YDoc</h6></a></div><div><div class="m-search">
<div class="icon">&#xf0fd;</div>
<input type="text" class="input js-input" placeholder="搜索" />
<div class="m-search-result js-search-result"></div>
</div></div><nav class="m-header-nav js-nav"><ul class="m-header-items"><li class="item active"><a class="href" href="index.html">documents</a></li><li class="item "><a class="href" href="../about/index.html">about</a></li></ul></nav><div id="js-nav-btn" class="m-header-btn ui-font-ydoc"></div></header><div class="m-content" id="js-content"><div id="markdown-body" class="m-content-container markdown-body"><h1>env</h1>
<p>env</p>
<h2 id="title">title</h2>
<p>content</p>
<h3 id="title-sub-title">sub-title</h3>
<p>content</p>
</div><div class="m-content-container m-paging"><div class="m-paging-prev m-paging-item"><a href="intro.html" class="href"><span class="ui-font-ydoc"></span>Introduction</a></div></div></div></div></div><div></div><script>
var $content = document.getElementById('js-content');
var $summaryItems = Array.prototype.slice.call(document.querySelectorAll('#js-menu .href'));
var $menu = document.getElementById('js-menu');
if ($menu && sessionStorage.menuScrollTop) {
$menu.scrollTop = sessionStorage.menuScrollTop;
}
// 刷新页面但不切换 pathname 的时候,内容区恢复到记忆的高度
if ($content && sessionStorage.contentScrollTop && window.location.pathname == sessionStorage.locationPathname) {
$content.scrollTop = sessionStorage.contentScrollTop;
}
sessionStorage.setItem('locationPathname', window.location.pathname);</script><script src="../ydoc/scripts/plugins/dollar.min.js"></script><script src="../ydoc/scripts/plugins/responsive-nav.min.js"></script><script src="../ydoc/scripts/plugins/slideout.min.js"></script><script src="../ydoc/scripts/app.js"></script><script src="../ydoc/ydoc-plugin-search/core.js"></script><script src="../ydoc/ydoc-plugin-search/search.js"></script><script src="../search_json.js"></script></body></html>
Loading

0 comments on commit be9f41c

Please sign in to comment.