From 139c7b1db3e8105d177c51d5d04799b6386a4f4e Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 16 Mar 2023 19:32:28 +0800 Subject: [PATCH] update: online directory structure --- src/release/release.py | 10 +++++----- src/release/utils/release.py | 4 ++-- src/release/utils/sequence.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/release/release.py b/src/release/release.py index 93962a2..e369a8a 100755 --- a/src/release/release.py +++ b/src/release/release.py @@ -11,8 +11,8 @@ from utils import gitbookRelease metadata, content = loadBook('rc-5') -# txtRelease(metadata, content) -# jsonRelease(metadata, content) -# htmlRelease(metadata, content) -staticRelease(metadata, content) -# gitbookRelease(metadata, content) +txtRelease(metadata, content) +jsonRelease(metadata, content) +htmlRelease(metadata, content) +# staticRelease(metadata, content) +gitbookRelease(metadata, content) diff --git a/src/release/utils/release.py b/src/release/utils/release.py index 96672ff..4552f7d 100644 --- a/src/release/utils/release.py +++ b/src/release/utils/release.py @@ -38,7 +38,7 @@ def htmlRelease(metadata: dict, content: dict) -> None: def gitbookRelease(metadata: dict, content: dict) -> None: createFolder(releaseInfo['gitbook']) createFolder(os.path.join(releaseInfo['gitbook'], './assets/')) - createFolder(os.path.join(releaseInfo['gitbook'], './content/')) + createFolder(os.path.join(releaseInfo['gitbook'], './chapter/')) cover = gitbookMetadata(metadata) for (resName, resUrls) in resourceInfo.items(): @@ -59,7 +59,7 @@ def gitbookRelease(metadata: dict, content: dict) -> None: def staticDepends(workDir: str, metadata: dict, content: dict) -> None: createFolder(os.path.join(workDir, './assets/')) - createFolder(os.path.join(workDir, './content/')) + createFolder(os.path.join(workDir, './chapter/')) cover = gitbookMetadata(metadata) + '
\n' for (resName, resUrls) in resourceInfo.items(): diff --git a/src/release/utils/sequence.py b/src/release/utils/sequence.py index dc2c63f..0b7094b 100644 --- a/src/release/utils/sequence.py +++ b/src/release/utils/sequence.py @@ -68,7 +68,7 @@ def gitbookMetadata(metadata: dict) -> str: def gitbookChapterPath(caption: str) -> str: chapterNum = re.search(r'^第(\d+)章', caption)[1] # match chapter number chapterNum = '0' * (3 - len(chapterNum)) + chapterNum # add `0` prefix - return os.path.join('content', 'chapter-%s.md' % chapterNum) + return os.path.join('chapter', '%s.md' % chapterNum) def gitbookSummary(chapters: dict) -> str: