diff options
| author | nsfisis <nsfisis@gmail.com> | 2023-03-18 17:17:11 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2023-03-18 17:17:11 +0900 |
| commit | b98d324fe7eb37e7004926843feede7e636c3301 (patch) | |
| tree | 2a0fe6e6f449eea9cf68022748581862d2b80303 /nuldoc-src/templates/tag.ts | |
| parent | 0fb528619a4c08e38f3fdd5a8ebbe9c628c236d9 (diff) | |
| download | blog.nsfisis.dev-b98d324fe7eb37e7004926843feede7e636c3301.tar.gz blog.nsfisis.dev-b98d324fe7eb37e7004926843feede7e636c3301.tar.zst blog.nsfisis.dev-b98d324fe7eb37e7004926843feede7e636c3301.zip | |
refactor: move shared codes to templates/utils.ts
Diffstat (limited to 'nuldoc-src/templates/tag.ts')
| -rw-r--r-- | nuldoc-src/templates/tag.ts | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/nuldoc-src/templates/tag.ts b/nuldoc-src/templates/tag.ts index 1cbc2c5..8aeac58 100644 --- a/nuldoc-src/templates/tag.ts +++ b/nuldoc-src/templates/tag.ts @@ -1,19 +1,12 @@ -import { Element } from "../dom.ts"; import { Document } from "../docbook/document.ts"; import { Config } from "../config.ts"; -import { el, stylesheetLinkElement, text } from "./utils.ts"; - -function metaElement(attrs: [string, string][]): Element { - return el("meta", attrs); -} - -function linkElement(rel: string, href: string, type: string | null): Element { - const attrs: [string, string][] = [["rel", rel], ["href", href]]; - if (type !== null) { - attrs.push(["type", type]); - } - return el("link", attrs); -} +import { + el, + linkElement, + metaElement, + stylesheetLinkElement, + text, +} from "./utils.ts"; export default async function convertTag( tag: string, |
