Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 3288225b
authored
Jan 21, 2020
by
Pedro Augusto de Paula Barbosa
Committed by
Sushant
Jan 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(docs): catch some mistakes (#11851)
1 parent
e1fef557
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
10 deletions
docs/esdoc-config.js
docs/manual-utils.js
docs/esdoc-config.js
View file @
3288225
'use strict'
;
'use strict'
;
const
_
=
require
(
'lodash
'
);
const
{
getDeclaredManuals
,
checkManuals
}
=
require
(
'./manual-utils
'
);
const
manualGroups
=
require
(
'./manual-groups.json'
);
checkManuals
();
const
manual
=
{
index
:
'./docs/index.md'
,
globalIndex
:
true
,
asset
:
'./docs/images'
,
files
:
_
.
flatten
(
_
.
values
(
manualGroups
)).
map
(
file
=>
`./docs/manual/
${
file
}
`
)
};
module
.
exports
=
{
module
.
exports
=
{
source
:
'./lib'
,
source
:
'./lib'
,
...
@@ -45,7 +38,12 @@ module.exports = {
...
@@ -45,7 +38,12 @@ module.exports = {
repository
:
'https://github.com/sequelize/sequelize'
,
repository
:
'https://github.com/sequelize/sequelize'
,
site
:
'https://sequelize.org/master/'
site
:
'https://sequelize.org/master/'
},
},
manual
manual
:
{
index
:
'./docs/index.md'
,
globalIndex
:
true
,
asset
:
'./docs/images'
,
files
:
getDeclaredManuals
()
}
}
}
}
}
]
]
...
...
docs/manual-utils.js
0 → 100644
View file @
3288225
'use strict'
;
const
_
=
require
(
'lodash'
);
const
jetpack
=
require
(
'fs-jetpack'
);
const
{
normalize
}
=
require
(
'path'
);
const
assert
=
require
(
'assert'
);
function
getDeclaredManuals
()
{
const
declaredManualGroups
=
require
(
'./manual-groups.json'
);
return
_
.
flatten
(
_
.
values
(
declaredManualGroups
)).
map
(
file
=>
{
return
normalize
(
`./docs/manual/
${
file
}
`
);
});
}
function
getAllManuals
()
{
return
jetpack
.
find
(
'./docs/manual/'
,
{
matching
:
'*.md'
}).
map
(
m
=>
{
return
normalize
(
`./
${
m
}
`
);
});
}
function
checkManuals
()
{
// First we check that declared manuals and all manuals are the same
const
declared
=
getDeclaredManuals
().
sort
();
const
all
=
getAllManuals
().
sort
();
assert
.
deepStrictEqual
(
declared
,
all
);
// Then we check that every manual begins with a single `#`. This is
// important for ESDoc to render the left menu correctly.
for
(
const
manualRelativePath
of
all
)
{
assert
(
/^#
[^
#
]
/
.
test
(
jetpack
.
read
(
manualRelativePath
)),
`Manual '
${
manualRelativePath
}
' must begin with a single '#'`
);
}
}
module
.
exports
=
{
getDeclaredManuals
,
getAllManuals
,
checkManuals
};
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment