Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ESSIF-Lab
eSSIF-Lab framework
Commits
88460d0a
Commit
88460d0a
authored
Oct 09, 2020
by
Thanasis Katsadas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort alphabetically glossary case insensitive
parent
1a7f735f
Pipeline
#15692
passed with stage
in 2 minutes and 18 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
plugins/terminology-parser/index.js
plugins/terminology-parser/index.js
+8
-6
No files found.
plugins/terminology-parser/index.js
View file @
88460d0a
...
...
@@ -121,11 +121,13 @@ async function getGlossaryTerms(files) {
//gather all metadata
let
{
metadata
}
=
parseMD
(
content
)
//keep only the required keys
arr
.
push
({
title
:
metadata
.
title
,
hoverText
:
metadata
.
hoverText
,
filepath
:
filepath
.
slice
(
1
,
-
3
),
});
if
(
metadata
.
title
)
{
arr
.
push
({
title
:
metadata
.
title
,
hoverText
:
metadata
.
hoverText
,
filepath
:
filepath
.
slice
(
1
,
-
3
),
});
}
}
return
arr
;
}
...
...
@@ -162,7 +164,7 @@ async function parseGlossary(err, files) {
//get all terms in an array of objects
const
data
=
await
getGlossaryTerms
(
files
);
//sort them alphabeteically
data
.
sort
((
a
,
b
)
=>
(
a
.
title
>
b
.
title
)
?
1
:
((
b
.
title
>
a
.
title
)
?
-
1
:
0
));
data
.
sort
((
a
,
b
)
=>
(
a
.
title
.
toLowerCase
()
>
b
.
title
.
toLowerCase
())
?
1
:
((
b
.
title
.
toLowerCase
()
>
a
.
title
.
toLowerCase
()
)
?
-
1
:
0
));
//write the glossary.md file
generateGlossary
(
data
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment