Skip to content

Instantly share code, notes, and snippets.

@outloudvi
Created April 10, 2022 08:02
Show Gist options
  • Save outloudvi/56943375367dc53cb39615d7d01727c3 to your computer and use it in GitHub Desktop.
Save outloudvi/56943375367dc53cb39615d7d01727c3 to your computer and use it in GitHub Desktop.
const toMwTracklist = (title, tracks) =>
`
{{Tracklist
| headline = ${title}
| all_music =
| all_lyrics =
| longnote_column = no
| singer_credits = yes
${tracks
.map(({ title, singer, note }, index) =>
`
|title${index + 1}= ${title}
${singer ? `|singer${index + 1}= ${singer}` : ''}
`.trim()
)
.join('\n')}
}}
`.trim()
const toMwAlbum = ({ title, isEp, publishDate, description, tracks }) =>
`
==${title}==
{{Album Infobox
|專輯名稱=${title}
|image= ${title}.png
|圖片信息= ${isEp ? 'EP封面' : '专辑封面'}
|原名=
|發行=
|發行地區= 日本
|發行日期= ${publishDate}
|商品编号= 不明
|專輯類型= 专辑
|標題顏色= #21abf2
|左欄顏色= #e7f6fe
}}
${description}
;参与歌手:
;收录曲目:
${toMwTracklist(title, tracks)}
{{clear}}
`.trim()
console.log(
toMwAlbum({
title: '-The Things She Left-',
isEp: false,
publishDate: '2019年12月4日',
description: 't7s 原声带 2.0。',
tracks: [
{ title: '怨の念' },
{ title: '仇なす者' },
{ title: '紅い宴~享~' },
{ title: '紅い宴~楽~' },
{ title: '人形たちの嘲笑み' },
{ title: '嵐の窓辺' },
{ title: '隔たる雲' },
{ title: '切れない鎖' },
{ title: '叶わなかった願い' },
{ title: '怨念狂躁曲' },
{ title: '敗者たちの雨' },
{ title: '愛と呼ぶ' },
{ title: 'ハルカゼ -アイの調べ-' },
{ title: '虹を駆ける' },
{ title: 'たったひとりの戰い' },
{ title: '青空まで歩いてきた' },
{ title: 'すべての人の戰い' },
{ title: '初夏の手紙' },
{ title: '夏影' },
],
})
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment