From 8d52bf4af9cb412b028c72afe0bf74275f215262 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 29 Dec 2022 21:53:22 +0800 Subject: [PATCH] remove: markdown format --- src/release/to_markdown.py | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/release/to_markdown.py diff --git a/src/release/to_markdown.py b/src/release/to_markdown.py deleted file mode 100644 index 31f632b..0000000 --- a/src/release/to_markdown.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import sys -from common import loadData - - -def formatMetadata(metadata: dict) -> str: - return '# %s\n\n+ 作者:%s\n\n> %s' % ( - metadata['name'], - metadata['author'], - '\n> '.join(metadata['desc']), - ) - - -def formatChapter(caption: str, content: list) -> str: - return '## %s\n\n%s' % (caption, '\n\n'.join(content)) - - -def markdownRelease(metadata: dict, content: dict) -> str: - result = [formatMetadata(metadata)] - for (title, chapter) in content.items(): - result.append( - formatChapter(title, chapter) - ) - return '\n\n'.join(result) - - -if __name__ == '__main__': - data = loadData(sys.argv[1]) - print(markdownRelease(data['metadata'], data['content']))