File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 39
39
"eslint" : " ^1.3.0" ,
40
40
"eslint-plugin-markdown" : " git://github.com/eslint/eslint-plugin-markdown.git" ,
41
41
"espower-babel" : " ^3.3.0" ,
42
- "gitbook-cli" : " ^1.0.0 " ,
42
+ "gitbook-cli" : " ^0.3.6 " ,
43
43
"gitbook-plugin-edit-link" : " ^1.4.1" ,
44
44
"gitbook-plugin-ga" : " ^0.2.1" ,
45
45
"gitbook-plugin-github-buttons" : " ^1.2.2" ,
48
48
"gitbook-plugin-richquotes" : " 0.0.5" ,
49
49
"gitbook-summary-to-path" : " ^1.0.1" ,
50
50
"jsdom" : " ^6.3.0" ,
51
+ "mdast" : " ^2.1.0" ,
51
52
"mocha" : " ^2.2.5" ,
52
53
"node-fetch" : " ^1.3.2" ,
53
54
"npm-run-all" : " ^1.2.8" ,
57
58
"textlint-rule-max-ten" : " ^1.1.0" ,
58
59
"textlint-rule-no-mix-dearu-desumasu" : " ^1.1.0" ,
59
60
"textlint-rule-no-start-duplicated-conjunction" : " ^1.0.3" ,
61
+ "unist-util-select" : " ^1.0.0" ,
60
62
"textlint-rule-prh" : " ^2.0.0" ,
61
63
"textlint-rule-spellcheck-tech-word" : " ^4.0.1"
62
64
},
65
67
"estraverse" : " ^4.1.0" ,
66
68
"gulp" : " ^3.9.0" ,
67
69
"gulp-util" : " ^3.0.6" ,
68
- "jquery" : " ^2.1.4"
70
+ "jquery" : " ^2.1.4" ,
71
+ "stemming-x-keywords" : " ^1.0.3"
69
72
}
70
73
}
Original file line number Diff line number Diff line change 3
3
import { getFilePathListAsync } from "gitbook-summary-to-path" ;
4
4
import path from "path" ;
5
5
import fs from "fs" ;
6
+ import mdast from "mdast" ;
7
+ var select = require ( 'unist-util-select' ) ;
6
8
const rootDir = path . join ( __dirname , ".." ) ;
7
9
const keywordInfo = require ( "./keywords.json" ) ;
8
-
10
+ const Org = fs . readFileSync ( __dirname + "/../ORGANIZATION.md" , "utf-8" ) ;
9
11
function getKeywords ( matchPath ) {
10
12
return getFilePathListAsync ( __dirname + "/../SUMMARY.md" ) . then ( fileList => {
11
13
let filteredList = fileList . filter ( filePath => {
@@ -32,6 +34,8 @@ function isNotContain(content, keywords) {
32
34
// キーワードが書くコンテンツに含まれているかをテストする
33
35
describe ( "keywords" , function ( ) {
34
36
it ( "Each chapter contain the keyword" , function ( done ) {
37
+ let ast = mdast . parse ( Org ) ;
38
+ let headingPrs = select ( ast , "heading, heading + paragraph" ) ;
35
39
let promises = Object . keys ( keywordInfo ) . map ( key => {
36
40
return getKeywords ( key ) . then ( ( { filePath, content, keywords} ) => {
37
41
let unusedKeywords = isNotContain ( content , keywords ) ;
You can’t perform that action at this time.
0 commit comments