Skip to content

Commit

Permalink
create tour/doc/download pages
Browse files Browse the repository at this point in the history
  • Loading branch information
farthinker committed Apr 4, 2014
1 parent be3fdfd commit 149f832
Show file tree
Hide file tree
Showing 44 changed files with 605 additions and 207 deletions.
43 changes: 23 additions & 20 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -48,43 +48,46 @@ module.exports = (grunt) ->
bundleExec: true
files:
'styles/simditor.css': 'styles/simditor.scss'
docs:
site:
options:
style: 'expanded'
bundleExec: true
files:
'docs/assets/styles/app.css': 'docs/assets/_sass/app.scss'
'site/assets/styles/app.css': 'site/assets/_sass/app.scss'

coffee:
simditor:
files:
'lib/module.js': 'externals/simple-module/src/module.coffee'
'lib/uploader.js': 'externals/simple-uploader/src/uploader.coffee'
'lib/simditor.js': 'src/simditor.coffee'
docs:
files:
'docs/assets/scripts/page-demo.js': 'docs/assets/_coffee/page-demo.coffee'
site:
expand: true
flatten: true
src: 'site/assets/_coffee/*.coffee'
dest: 'site/assets/scripts/'
ext: '.js'

copy:
vendor:
files: [{
src: 'externals/jquery-2.1.0.min.js',
dest: 'docs/assets/scripts/jquery-2.1.0.min.js'
dest: 'site/assets/scripts/jquery-2.1.0.min.js'
}, {
src: 'externals/font-awesome/font-awesome.css',
dest: 'docs/assets/styles/font-awesome.css'
dest: 'site/assets/styles/font-awesome.css'
}, {
expand: true,
flatten: true,
src: 'externals/font-awesome/fonts/*',
dest: 'docs/assets/fonts/'
dest: 'site/assets/fonts/'
}]
styles:
src: 'styles/simditor.css',
dest: 'docs/assets/styles/simditor.css'
dest: 'site/assets/styles/simditor.css'
scripts:
src: 'lib/simditor-all.js',
dest: 'docs/assets/scripts/simditor-all.js'
dest: 'site/assets/scripts/simditor-all.js'
package:
files: [{
expand: true,
Expand Down Expand Up @@ -116,7 +119,7 @@ module.exports = (grunt) ->
}, {
expand: true,
flatten: true
src: 'docs/assets/images/*',
src: 'site/assets/images/*',
dest: 'package/images/'
}]

Expand All @@ -127,14 +130,14 @@ module.exports = (grunt) ->
scripts:
files: ['src/*.coffee', 'src/buttons/*.coffee']
tasks: ['concat:simditor', 'coffee:simditor', 'concat:all', 'copy:scripts', 'shell']
docStyles:
files: ['docs/assets/_sass/*.scss']
tasks: ['sass:docs', 'shell']
docScripts:
files: ['docs/assets/_coffee/*.coffee']
tasks: ['coffee:docs', 'shell']
siteStyles:
files: ['site/assets/_sass/*.scss']
tasks: ['sass:site', 'shell']
siteScripts:
files: ['site/assets/_coffee/*.coffee']
tasks: ['coffee:site', 'shell']
jekyll:
files: ['docs/**/*.html']
files: ['site/**/*.html', 'site/**/*.md']
tasks: ['shell']

shell:
Expand Down Expand Up @@ -175,7 +178,7 @@ module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-express'
grunt.loadNpmTasks 'grunt-shell'

grunt.registerTask 'default', ['docs', 'express', 'watch']
grunt.registerTask 'docs', ['sass', 'concat:simditor', 'coffee', 'concat:all', 'copy:vendor', 'copy:styles', 'copy:scripts', 'shell']
grunt.registerTask 'default', ['site', 'express', 'watch']
grunt.registerTask 'site', ['sass', 'concat:simditor', 'coffee', 'concat:all', 'copy:vendor', 'copy:styles', 'copy:scripts', 'shell']
grunt.registerTask 'package', ['copy:package', 'uglify', 'compress']

2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
encoding: utf-8
name: Simditor
markdown: redcarpet
source: docs
source: site
11 changes: 0 additions & 11 deletions docs/_includes/header.html

This file was deleted.

25 changes: 0 additions & 25 deletions docs/_layouts/default.html

This file was deleted.

108 changes: 0 additions & 108 deletions docs/assets/_sass/app.scss

This file was deleted.

12 changes: 0 additions & 12 deletions docs/docs.html

This file was deleted.

13 changes: 0 additions & 13 deletions docs/download.html

This file was deleted.

11 changes: 0 additions & 11 deletions docs/tour.html

This file was deleted.

9 changes: 9 additions & 0 deletions site/_includes/doc-sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<aside>
<ul>
<li{% if page.name == 'doc-config' %} class="active"{% endif %}><a href="{{ page.root }}docs/doc-config.html">配置</a></li>
<li{% if page.name == 'doc-method' %} class="active"{% endif %}><a href="{{ page.root }}docs/doc-method.html">方法</a></li>
<li{% if page.name == 'doc-event' %} class="active"{% endif %}><a href="{{ page.root }}docs/doc-event.html">事件</a></li>
</ul>
</aside>


File renamed without changes.
11 changes: 11 additions & 0 deletions site/_includes/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<header>
<h1>Simditor</h1>
<p class="desc">简单快速的富文本编辑器</p>
</header>
<nav>
<a href="{{ page.root }}."{% if page.name == 'demo' %} class="active"{% endif %}>Demo</a>
<a href="{{ page.root }}tours/tour-usage.html"{% if page.name contains 'tour' %} class="active"{% endif %}>教程</a>
<a href="{{ page.root }}docs/doc-config.html"{% if page.name contains 'doc' %} class="active"{% endif %}>文档</a>
<a href="{{ page.root }}download.html"{% if page.name == 'download' %} class="active"{% endif %}>下载</a>
</nav>
8 changes: 8 additions & 0 deletions site/_includes/tour-sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<aside>
<ul>
<li{% if page.name == 'tour-usage' %} class="active"{% endif %}><a href="{{ page.root }}tours/tour-usage.html">使用方法</a></li>
<li{% if page.name == 'tour-dev-env' %} class="active"{% endif %}><a href="{{ page.root }}tours/tour-dev-env.html">搭建环境</a></li>
<li{% if page.name == 'tour-plugin' %} class="active"{% endif %}><a href="{{ page.root }}tours/tour-plugin.html">编写扩展</a></li>
</ul>
</aside>

25 changes: 25 additions & 0 deletions site/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{ page.title }}</title>
<meta name="viewport" content="width=device-width">

<link media="all" rel="stylesheet" type="text/css" href="{{ page.root }}assets/styles/app.css" />
<link media="all" rel="stylesheet" type="text/css" href="{{ page.root }}assets/styles/font-awesome.css" />
<link media="all" rel="stylesheet" type="text/css" href="{{ page.root }}assets/styles/simditor.css" />

<script type="text/javascript" src="{{ page.root }}assets/scripts/jquery-2.1.0.min.js"></script>
</head>
<body>

<div class="wrapper">
{% include header.html %}
{{ content }}
{% include footer.html %}
</div>

</body>
</html>

17 changes: 17 additions & 0 deletions site/_layouts/doc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
layout: default
root: ../
---

<section class="page-doc page-sidebar" id="page-{{ page.name }}">
{% include doc-sidebar.html %}
<article class="editor-style">
{{ content }}
</article>
</section>






16 changes: 16 additions & 0 deletions site/_layouts/tour.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: default
root: ../
---

<section class="page-tour page-sidebar" id="page-{{ page.name }}">
{% include tour-sidebar.html %}
<article class="editor-style">
{{ content }}
</article>
</section>





File renamed without changes.
12 changes: 12 additions & 0 deletions site/assets/_coffee/page-download.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

$ ->
$page = $('#page-download')

$page.on 'mousedown', '.version .title', (e) ->
$versionEl = $(@).closest('.version')
expanded = $versionEl.hasClass 'expand'
$versionEl.toggleClass 'expand', !expanded
$versionEl.find('.icon')
.toggleClass('fa-caret-down', !expanded)
.toggleClass('fa-caret-right', expanded)

Loading

0 comments on commit 149f832

Please sign in to comment.