Add MarkMark links to links.mark.md and additional resources to /markmark
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
2023-11-20 23:10:15 -06:00
parent 575a253651
commit 56da99740c
4 changed files with 22 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
import * as marked from 'marked'
import {isNamedSection, MarkMark} from './types'
export class HtmlRenderer {
@@ -9,9 +10,9 @@ export class HtmlRenderer {
// if this section has a title/description, write those out
if ( isNamedSection(section) ) {
mmLines.push(`<h1 class="markmark section-title">${section.title}</h1>`)
mmLines.push(`<h1 class="markmark section-title">${marked.marked.parse(section.title)}</h1>`)
if ( section.description ) {
mmLines.push(`<p class="markmark section-description">${section.description}</p>`)
mmLines.push(`<p class="markmark section-description">${marked.marked.parse(section.description)}</p>`)
}
}
@@ -23,7 +24,7 @@ export class HtmlRenderer {
linkTitle += ` <span class="markmark link-tags">${link.tags.map(x => '<span class="markmark link-tag">#' + x + '</span>').join(' ')}</span>`
}
mmLines.push(`<li class="markmark link-title">${linkTitle}<ul class="markmark url-list">`)
mmLines.push(`<li class="markmark link-title">${marked.marked.parse(linkTitle)}<ul class="markmark url-list">`)
for ( const url of link.urls ) {
mmLines.push(`<li class="markmark link-url"><a href="${url}" target="_blank">${url}</a></li>`)