Skip to content

Commit

Permalink
删除弃用文件
Browse files Browse the repository at this point in the history
  • Loading branch information
dwb1994 committed Jun 12, 2017
1 parent 8e76fa5 commit 7f973eb
Show file tree
Hide file tree
Showing 33 changed files with 52 additions and 1,904 deletions.
2 changes: 1 addition & 1 deletion _docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h4 class="subject" id="使用Grunt的方式">使用Grunt的方式 <a class="has
grunt<span class="token punctuation">.</span><span class="token function">loadNpmTasks</span><span class="token punctuation">(</span><span class="token string">'ydoc'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<h2 class="subject" id="开发者">开发者 <a class="hashlink" href="#开发者">#</a></h2><ul>
<li>林洋 <a href="&#109;&#x61;&#105;&#x6c;&#x74;&#x6f;&#58;&#97;&#x64;&#x77;&#111;&#110;&#x2e;&#108;&#105;&#110;&#x40;&#x71;&#117;&#x6e;&#x61;&#x72;&#46;&#x63;&#x6f;&#109;">&#97;&#x64;&#x77;&#111;&#110;&#x2e;&#108;&#105;&#110;&#x40;&#x71;&#117;&#x6e;&#x61;&#x72;&#46;&#x63;&#x6f;&#109;</a> | <a href="&#109;&#x61;&#105;&#108;&#116;&#111;&#x3a;&#x65;&#100;&#119;&#111;&#x6e;&#46;&#108;&#105;&#109;&#x40;&#103;&#109;&#x61;&#105;&#x6c;&#46;&#x63;&#111;&#x6d;">&#x65;&#100;&#119;&#111;&#x6e;&#46;&#108;&#105;&#109;&#x40;&#103;&#109;&#x61;&#105;&#x6c;&#46;&#x63;&#111;&#x6d;</a></li><li>王丽丽 <a href="&#x6d;&#97;&#x69;&#x6c;&#116;&#111;&#x3a;&#108;&#x65;&#105;&#x6c;&#x61;&#46;&#x77;&#97;&#x6e;&#103;&#64;&#113;&#117;&#x6e;&#x61;&#114;&#x2e;&#99;&#111;&#x6d;">&#108;&#x65;&#105;&#x6c;&#x61;&#46;&#x77;&#97;&#x6e;&#103;&#64;&#113;&#117;&#x6e;&#x61;&#114;&#x2e;&#99;&#111;&#x6d;</a></li><li>董文博 <a href="&#x6d;&#x61;&#x69;&#108;&#116;&#x6f;&#x3a;&#119;&#x65;&#x6e;&#x62;&#111;&#46;&#100;&#x6f;&#x6e;&#x67;&#64;&#x71;&#x75;&#110;&#97;&#x72;&#46;&#99;&#111;&#x6d;">&#119;&#x65;&#x6e;&#x62;&#111;&#46;&#100;&#x6f;&#x6e;&#x67;&#64;&#x71;&#x75;&#110;&#97;&#x72;&#46;&#99;&#111;&#x6d;</a></li></ul>
<li>林洋 <a href="&#109;&#97;&#x69;&#x6c;&#x74;&#111;&#x3a;&#x61;&#100;&#119;&#x6f;&#110;&#x2e;&#x6c;&#105;&#110;&#64;&#113;&#117;&#110;&#97;&#114;&#46;&#99;&#x6f;&#x6d;">&#x61;&#100;&#119;&#x6f;&#110;&#x2e;&#x6c;&#105;&#110;&#64;&#113;&#117;&#110;&#97;&#114;&#46;&#99;&#x6f;&#x6d;</a> | <a href="&#x6d;&#x61;&#105;&#108;&#x74;&#111;&#x3a;&#101;&#x64;&#119;&#111;&#x6e;&#46;&#108;&#x69;&#x6d;&#x40;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#x6d;">&#101;&#x64;&#119;&#111;&#x6e;&#46;&#108;&#x69;&#x6d;&#x40;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#x6d;</a></li><li>王丽丽 <a href="&#x6d;&#97;&#105;&#x6c;&#x74;&#111;&#58;&#108;&#x65;&#105;&#x6c;&#x61;&#x2e;&#x77;&#97;&#x6e;&#x67;&#64;&#x71;&#117;&#110;&#x61;&#x72;&#46;&#x63;&#x6f;&#109;">&#108;&#x65;&#105;&#x6c;&#x61;&#x2e;&#x77;&#97;&#x6e;&#x67;&#64;&#x71;&#117;&#110;&#x61;&#x72;&#46;&#x63;&#x6f;&#109;</a></li><li>董文博 <a href="&#x6d;&#97;&#105;&#x6c;&#x74;&#x6f;&#58;&#119;&#x65;&#x6e;&#98;&#111;&#46;&#x64;&#x6f;&#110;&#103;&#64;&#113;&#x75;&#x6e;&#97;&#x72;&#x2e;&#99;&#x6f;&#x6d;">&#119;&#x65;&#x6e;&#98;&#111;&#46;&#x64;&#x6f;&#110;&#103;&#64;&#113;&#x75;&#x6e;&#97;&#x72;&#x2e;&#99;&#x6f;&#x6d;</a></li></ul>

</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion _docs/source/code.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _docs/source/main.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _docs/theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h1 >YDoc</h1>
<!-- <li > -->
<li >

<a href="#安装">安装</a>
<a href="#安装2">安装</a>
</li>

<ul class="nav docs-sidenav-extend" >
Expand Down Expand Up @@ -140,7 +140,7 @@ <h1 >YDoc</h1>

<div class="content-right markdown-body " role="main">

<h2 class="subject" id="安装5">安装 <a class="hashlink" href="#安装5">#</a></h2><p><code>3.0.0</code> 版本开始支持,包括 <code>prerelease</code> 版本。</p>
<h2 class="subject" id="安装2">安装 <a class="hashlink" href="#安装2">#</a></h2><p><code>3.0.0</code> 版本开始支持,包括 <code>prerelease</code> 版本。</p>
<h3 class="subject" id="下载">下载 <a class="hashlink" href="#下载">#</a></h3><p>从 NPM 中安装</p>
<blockquote>
<p>npm install ydoc-theme-[name] --save</p>
Expand Down
2 changes: 1 addition & 1 deletion _docs/usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h1 >YDoc</h1>
<!-- <li > -->
<li >

<a href="#安装">安装</a>
<a href="#安装1">安装</a>
</li>

<!-- <li > -->
Expand Down
6 changes: 6 additions & 0 deletions sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ sup,sub{vertical-align:baseline}
font-size: .2rem;
font-weight: bold;
}
.home-btn:hover{
text-decoration: none;
border-color: #ff503f;
background-color: #ff503f;
color: #fff;
}
.home-version{
display: block;
margin-top: .15rem;
Expand Down
30 changes: 25 additions & 5 deletions src/actions/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ var Prism = require('prismjs');
var globby = require('globby');

var parsers = require('../parsers');
var reJS = /^javascript|js$/i;

var reJS = /^javascript|js$/i,
arr = [],
sum = 1;
// 目录id名相同时给予不同id
function addNumberWhileSameName(id) {
if(arr.indexOf(id) !== -1){
id += sum;
sum++;
}
arr.push(id);
return id;
}
// 代码高亮处理language
var parseAliases = function(lang) {
if (reJS.test(lang)) {
return 'javascript';
Expand Down Expand Up @@ -307,23 +320,30 @@ module.exports = function(cwd, conf) {
} else {
var navs = [],
blocks = [];
// article.type == 'block'
page.content.blocks.forEach(function(block) {
// 一级标题:block.name
if (block.name) {
var realText = block.name;
var text = addNumberWhileSameName(block.name);
navs.push({
name: block.name,
name: realText,
index: block.index,
tag: "#" + block.name.replace(/[\.\:\s\@\/]/g, '-'),
tag: "#" + text.replace(/[\.\:\s\@\/]/g, '-'),
sub: block.sub || false
});
}
if (typeof block.content == 'string') {
var ret = doParser(cwd, block.content, block.ignore, block.compile, block.options, conf, codeRender);
if (block.name && !block.sub && ret.menus) {
ret.menus.forEach(function(item) {
var realText = item.name;
var text = addNumberWhileSameName(item.name);
// 二级标题:item
if (!item.sub) {
navs.push({
name: item.name,
tag: "#" + item.name.replace(/[\.\:\s\@\/]/g, '-'),
name: realText,
tag: "#" + text.replace(/[\.\:\s\@\/]/g, '-'),
sub: true
});
}
Expand Down
16 changes: 6 additions & 10 deletions src/parsers/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ function parser(contents, options) {
menus = [];
renderer.heading = function(text, level) {
var realText = text;
var text = addNumberWhileSameName(text);
if (level == menuLevel) {
var text = addNumberWhileSameName(text);
menus.push({
name: realText,
href: text
});
}
if (level == subMenuLevel) {
}else if (level == subMenuLevel) {
var text = addNumberWhileSameName(text);
menus.push({
name: realText,
href: text,
Expand All @@ -40,20 +40,16 @@ function parser(contents, options) {

};
renderer.listitem = function(text) {
var realText = text;
var text = addNumberWhileSameName(text);
if (/^\s*\[[x ]\]\s*/.test(text)) {
text = text
.replace(/^\s*\[ \]\s*/, '<i class="empty checkbox">&#xf35f;</i> ')
.replace(/^\s*\[x\]\s*/, '<i class="checked checkbox">&#xf35e;</i> ');
return '<li class="task-list">' + realText + '</li>';
return '<li class="task-list">' + text + '</li>';
} else {
return '<li>' + realText + '</li>';
return '<li>' + text + '</li>';
}
};
renderer.link = function(href, title, text) {
var realText = text;
var text = addNumberWhileSameName(text);
if (this.options.sanitize) {
try {
var prot = decodeURIComponent(unescape(href))
Expand All @@ -75,7 +71,7 @@ function parser(contents, options) {
if (title) {
out += ' title="' + title + '"';
}
out += '>' + realText + '</a>';
out += '>' + text + '</a>';
return out;
}
return {
Expand Down
5 changes: 5 additions & 0 deletions template/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ sup, sub {
color: #ff503f;
font-size: .2rem;
font-weight: bold; }
.ydoc .ydoc-banner-home .home-btn:hover {
text-decoration: none;
border-color: #ff503f;
background-color: #ff503f;
color: #fff; }
.ydoc .ydoc-banner-home .home-version {
display: block;
margin-top: .15rem;
Expand Down
2 changes: 1 addition & 1 deletion template/source/code.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion template/source/main.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions template/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h1 {{if homepage}}class="home-title"{{/if}}>{{banner.title}}</h1>
<a class="ydoc-banner-button home-btn" href="{{homepage.button.href}}">{{homepage.button.name}}</a>
{{/if}}
{{if homepage.version}}
<p class="home-version"> ddd </p>
<p class="home-version">当前版本:{{homepage.version}}</p>
{{/if}}
{{/if}}
</div>
Expand Down Expand Up @@ -102,7 +102,7 @@ <h1 {{if homepage}}class="home-title"{{/if}}>{{banner.title}}</h1>
<li {{if article.name==m .name}} class="active" {{/if}}>
{{if m.blank == true}}
<a href="javascript:void(0);">{{m.name}}</a> {{else}}
<a href="{{ m.tag || m.url || ('#' + m.name)}}">{{m.name}}</a> {{/if}}
<a href="{{ m.tag || m.url || ('#' + m.href)}}">{{m.name}}</a> {{/if}}
</li>
{{/if}} {{/each}}
</ul>
Expand Down
Loading

0 comments on commit 7f973eb

Please sign in to comment.