Browse Source

update: load book name from metadata

master
Dnomd343 2 years ago
parent
commit
3de5c60d54
  1. 2
      src/release/calibre_html.py
  2. 2
      src/release/gitbook.py

2
src/release/calibre_html.py

@ -8,7 +8,7 @@ from common import releaseInfo
def formatMetadata(metadata: dict) -> str:
return '<h1>栩栩若生</h1>\n' + '\n'.join(
return '<h1>%s</h1>\n' % metadata['name'] + '\n'.join(
['<p>%s</p>' % x for x in metadata['desc']]
)

2
src/release/gitbook.py

@ -37,7 +37,7 @@ def loadChapters(chapters: dict) -> dict:
def loadCover(metadata: dict) -> None:
cover = '---\ndescription: 作者:%s\n---\n\n# 栩栩若生\n\n' % metadata['author']
cover = '---\ndescription: 作者:%s\n---\n\n# %s\n\n' % (metadata['author'], metadata['name'])
cover += '<figure><img src="assets/cover.jpg" alt=""><figcaption><p>栩栩若生</p></figcaption></figure>\n\n'
cover += '\n>\n'.join(['> %s' % x for x in metadata['desc']]) + '\n\n'
cover += '{% embed url="https://github.com/dnomd343/xxrs-crawler.git" %}\n项目地址\n{% endembed %}\n'

Loading…
Cancel
Save