Add initial MarkMark spec and integrate my own links.mark.md file
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
26
src/markmark/types.ts
Normal file
26
src/markmark/types.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import {hasOwnProperty} from '@extollo/lib'
|
||||
|
||||
export type MarkMark = {
|
||||
frontmatter: FrontMatter,
|
||||
sections: Section[],
|
||||
}
|
||||
|
||||
export type FrontMatter = {
|
||||
syntax: 'v1',
|
||||
authorName?: string,
|
||||
authorEmail?: string,
|
||||
authorHref?: string,
|
||||
}
|
||||
|
||||
export type AnonymousSection = { links: Link[] }
|
||||
export type NamedSection = { title: string, description?: string, links: Link[] }
|
||||
export type Section = AnonymousSection | NamedSection
|
||||
|
||||
export const isNamedSection = (what: Section): what is NamedSection =>
|
||||
hasOwnProperty(what, 'title') && (typeof what.title === 'string')
|
||||
|
||||
export type Link = {
|
||||
title: string,
|
||||
tags: string[],
|
||||
urls: string[],
|
||||
}
|
||||
Reference in New Issue
Block a user