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
ff02002a
Commit
ff02002a
authored
Oct 09, 2020
by
Rieks Joosten
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'terminology' of
https://gitlab.grnet.gr/essif-lab/framework
into terminology
parents
898d3409
88460d0a
Pipeline
#15686
failed with stage
in 2 minutes and 16 seconds
Changes
1
Pipelines
1
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 @
ff02002a
...
...
@@ -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