Skip to content

Commit e36638f

Browse files
committed
[fix] style, resolve and docs
1 parent 482b2f9 commit e36638f

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

README.md

+14-19
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ $ npm i atool-doc -g
8787

8888
Use `.js` or `.md` files to write demo under the directory specified in `source`
8989

90-
### `.md`
90+
- ### `md`
9191

9292
`.md` is more powerful
9393

@@ -97,7 +97,7 @@ And then write other things you want at other sections, eg:
9797

9898
![image](https://cloud.githubusercontent.com/assets/5318333/14135283/309ee330-f68f-11e5-8d5f-fdd5a09f7fa9.png)
9999

100-
### `.js`
100+
- ### `js`
101101

102102
Without customizing dom, you can also work with the hook dom `div#__exampleDom`, placeholder in default [template file](https://github.com/ant-tool/atool-doc/blob/master/tpl/element.ejs), eg:
103103

@@ -120,22 +120,17 @@ If the templates above can not meet your needs, just try writing a new one!
120120

121121
- write your template file with following variables available **on the context of `file`**
122122

123-
- `meta`: meta info of each example file, `{ name: 'something', someKey: 'someValue' }`
124-
125-
- `link`: link of all demo files, `{ demoName: 'demoPath' }`
126-
127-
- `title`: file-path relative to `source` dir, `examples/basic`
128-
129-
- `filePath`: string of file-path, `examples/basic`
130-
131-
- `resource`: kinds of path for resourceFile, `{ name: 'basicNameAndExt', relativeToCwd: 'relativePathToCwd' }`
132-
133-
- `script`: array of script-path need to insert into the html file, `['../common.js', './basic.js']`
134-
135-
- `html`: string of html element, `<div></div>`
136-
137-
- `style`: string of style by css, `body { color: red; }`
138-
139-
- `desc`: code of demo and other things written by markdown, `<h2>code</h2><div class="highlight"></div>`
123+
|param|decription|format|
124+
|:---:|:--------:|:----:|
125+
|meta|meta info of each example file|`{ name: 'something', someKey: 'someValue' }`|
126+
|link|link of all demo files|`{ demoName: 'demoPath' }`|
127+
|title|file-path relative to `source` dir|`basic`|
128+
|filePath|string of file-path|`examples/basic`|
129+
|resource|kinds of path for resourceFile|`{ name: 'basicNameAndExt', relativeToCwd: 'relativePathToCwd' }`|
130+
|script|array of script-path need to insert into the html file|`['../common.js', './basic.js']`|
131+
|html|string of html element|`<div></div>`|
132+
|style|string of style by css|`body { color: red; }`|
133+
|desc|code of demo and other things written by markdown|`<h2>code</h2><div class="highlight"></div>`|
134+
|alias|alias of each file, generating by meta.title|see [meta config](https://raw.githubusercontent.com/ant-tool/atool-doc/master/examples/customizeName.md)|
140135

141136
*The template file only support syntax of `ejs` currently*

src/getWebpackConfig.js

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export default function (source, asset, dest, cwd, tpl, config) {
131131
params: {
132132
link,
133133
},
134+
title: 'title',
134135
}),
135136
];
136137

src/index-webpack-plugin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { readFileSync, existsSync } from 'fs';
22
import { render } from 'ejs';
33
import { join } from 'path';
4-
import { marked } from 'atool-doc-util';
4+
import { marked } from './utils';
55
import mt from 'mark-twain';
66
const root = join(__dirname, '..');
77

tpl/element.ejs

+3
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@
867867
color: #4078c0;
868868
text-decoration: none;
869869
}
870+
h2 {
871+
text-transform: uppercase;
872+
}
870873
871874
</style>
872875
<style type="text/css">

0 commit comments

Comments
 (0)