diff options
| author | nsfisis <nsfisis@gmail.com> | 2023-09-20 19:56:52 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2023-09-20 19:56:57 +0900 |
| commit | a84908b7e8a0e2423afd6b836eccf27a420270b4 (patch) | |
| tree | 00204b62358f8c57fcb36f601db360626484cc1a /vhosts/blog/nuldoc-src/commands/new.ts | |
| parent | 0b488f85380f964c40b0b9aae69c6611bc7978bc (diff) | |
| download | nsfisis.dev-a84908b7e8a0e2423afd6b836eccf27a420270b4.tar.gz nsfisis.dev-a84908b7e8a0e2423afd6b836eccf27a420270b4.tar.zst nsfisis.dev-a84908b7e8a0e2423afd6b836eccf27a420270b4.zip | |
feat(blog/nuldoc): change content format from DocBook to NulDoc
Diffstat (limited to 'vhosts/blog/nuldoc-src/commands/new.ts')
| -rw-r--r-- | vhosts/blog/nuldoc-src/commands/new.ts | 72 |
1 files changed, 29 insertions, 43 deletions
diff --git a/vhosts/blog/nuldoc-src/commands/new.ts b/vhosts/blog/nuldoc-src/commands/new.ts index 22329972..36125755 100644 --- a/vhosts/blog/nuldoc-src/commands/new.ts +++ b/vhosts/blog/nuldoc-src/commands/new.ts @@ -21,7 +21,7 @@ export async function runNewCommand(config: Config) { config.locations.contentDir, getDirPath(type), ymd, - "TODO.xml", + "TODO.ndoc", ); await ensureDir(dirname(destFilePath)); @@ -39,54 +39,40 @@ function getDirPath(type: "post" | "slide"): string { function getTemplate(type: "post" | "slide", date: string): string { if (type === "post") { - return `<?xml version="1.0" encoding="UTF-8"?> -<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0"> - <info> - <title>TODO</title> - <abstract> - TODO - </abstract> - <keywordset> - <keyword>TODO</keyword> - </keywordset> - <revhistory> - <revision> - <date>${date}</date> - <revremark>公開</revremark> - </revision> - </revhistory> - </info> - <section xml:id="TODO"> + return `--- +[article] +title = "TODO" +description = "TODO" +tags = [ + "TODO", +] + +[[article.revisions]] +date = "${date}" +remark = "公開" +--- +<article> + <section id="TODO"> <title>TODO</title> - <para> + <p> TODO - </para> + </p> </section> </article> `; } else { - return `<?xml version="1.0" encoding="UTF-8"?> -<slide> - <info> - <title>TODO</title> - <event> - TODO - </event> - <talktype> - TODO - </talktype> - <link>TODO</link> - <keywordset> - <keyword>TODO</keyword> - </keywordset> - <revhistory> - <revision> - <date>${date}</date> - <revremark>登壇</revremark> - </revision> - </revhistory> - </info> -</slide> + return `[slide] +title = "TODO" +event = "TODO" +talkType = "TODO" +link = "TODO" +tags = [ + "TODO", +] + +[[slide.revisions]] +date = "${date}" +remark = "登壇" `; } } |
