Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Entwicklungsportal - ARCHIVED
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
FIT-Connect
Entwicklungsportal - ARCHIVED
Commits
e21cbf88
Commit
e21cbf88
authored
1 year ago
by
Jürgen Voskuhl
Browse files
Options
Downloads
Patches
Plain Diff
Extended markdown parser
parent
2be6b010
No related branches found
No related tags found
1 merge request
!86
planning#1203: Standards
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
shared/use-markdown-parser.ts
+14
-5
14 additions, 5 deletions
shared/use-markdown-parser.ts
types/content/SlugMasterTag.ts
+13
-0
13 additions, 0 deletions
types/content/SlugMasterTag.ts
types/content/index.ts
+2
-0
2 additions, 0 deletions
types/content/index.ts
with
29 additions
and
5 deletions
shared/use-markdown-parser.ts
+
14
−
5
View file @
e21cbf88
...
...
@@ -3,7 +3,7 @@ import fs from 'fs'
import
path
from
'
path
'
import
{
remark
}
from
'
remark
'
import
html
from
'
remark-html
'
import
{
ChildResource
,
LabelTag
,
StatusTag
,
Tag
,
TypeTag
}
from
'
types/content/
'
import
{
ChildResource
,
LabelTag
,
StatusTag
,
SlugMasterTag
,
Tag
,
TypeTag
}
from
'
types/content/
'
export
default
function
loadAndPrepareMarkdown
(
selectedServiceName
:
string
,
folder
:
string
)
{
const
markdownFileContent
:
string
=
loadMarkdown
(
selectedServiceName
,
folder
)
...
...
@@ -68,13 +68,18 @@ function parseMetadata(metadata: string): ServiceContent {
// Convert line into tupel
const
[
key
,
value
]
=
convertLineIntoTuple
(
line
)
//
if
(
parentKey
===
'
childResources
'
)
{
if
(
key
===
'
- name
'
)
{
if
(
key
===
'
- name
'
&&
value
!=
''
)
{
content
.
childResources
.
push
(
new
ChildResource
({
name
:
value
,
slug
:
''
}))
return
}
content
.
childResources
[
content
.
childResources
.
length
-
1
].
slug
=
value
return
else
{
if
(
value
!=
''
&&
startsWithTwoSpaces
(
line
))
{
content
.
childResources
[
content
.
childResources
.
length
-
1
].
slug
=
value
}
return
}
}
// Check for explicit keys
...
...
@@ -98,7 +103,9 @@ function parseMetadata(metadata: string): ServiceContent {
}
// Assign simple key value tuple
content
[
key
]
=
value
if
(
value
!=
''
)
{
content
[
key
]
=
value
}
})
return
new
ServiceContent
(
content
)
}
...
...
@@ -109,6 +116,8 @@ function createTag(key: string, value: string) {
return
new
StatusTag
(
value
)
}
else
if
(
key
.
includes
(
'
label
'
))
{
return
new
LabelTag
(
value
)
}
else
if
(
key
.
includes
(
'
slugMaster
'
))
{
return
new
SlugMasterTag
(
value
)
}
}
function
convertLineIntoTuple
(
lineString
:
string
)
{
...
...
This diff is collapsed.
Click to expand it.
types/content/SlugMasterTag.ts
0 → 100644
+
13
−
0
View file @
e21cbf88
import
{
Tag
}
from
'
./Tag
'
export
class
SlugMasterTag
extends
Tag
{
type
:
string
name
:
string
=
'
slug_master
'
value
:
string
constructor
(
type
:
string
)
{
super
()
this
.
type
=
type
this
.
value
=
type
}
}
This diff is collapsed.
Click to expand it.
types/content/index.ts
+
2
−
0
View file @
e21cbf88
...
...
@@ -4,6 +4,7 @@ import { ContactInformation } from './ContactInformation'
import
{
Developer
}
from
'
./Developer
'
import
{
LabelTag
}
from
'
./LabelTag
'
import
{
StatusTag
}
from
'
./StatusTag
'
import
{
SlugMasterTag
}
from
'
./SlugMasterTag
'
import
{
Tag
}
from
'
./Tag
'
import
{
TypeTag
}
from
'
./TypeTag
'
import
{
Logo
}
from
'
./Logo
'
...
...
@@ -15,6 +16,7 @@ export {
Developer
,
LabelTag
,
ProductOwner
,
SlugMasterTag
,
StatusTag
,
Tag
,
TypeTag
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment