Skip to content

Commit

Permalink
Merge pull request #35 from Laserlicht/changelog
Browse files Browse the repository at this point in the history
add changelog
  • Loading branch information
dydzio0614 authored May 14, 2024
2 parents b038b7d + d908389 commit 7203866
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ nav:
- Home: index.md
- Blog: blog/index.md
- Download: download.md
- Changelog: ChangeLog.md
- Mod Repository: Mod Repository
- FAQ: faq.md
- About: about.md
Expand Down
10 changes: 8 additions & 2 deletions src/build_extract_main_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io
import os
import shutil
import re

def build_extract_main_repo(data):
with tempfile.TemporaryDirectory() as tempdirname:
Expand All @@ -12,11 +13,16 @@ def build_extract_main_repo(data):
shutil.move(os.path.join(tempdirname, 'vcmi-develop/docs'), 'docs')
shutil.copytree('additional/docs', 'docs', dirs_exist_ok=True)

# TODO replace all Readme.md in to index in all files from repo

os.makedirs("docs/assets", exist_ok=True)
shutil.copy(os.path.join(tempdirname, 'vcmi-develop/client/icons/vcmiclient.svg'), 'docs/assets/logo.svg')
shutil.copy(os.path.join(tempdirname, 'vcmi-develop/client/icons/vcmiclient.svg'), 'docs/assets/logo2.svg')
shutil.copy(os.path.join(tempdirname, 'vcmi-develop/client/icons/vcmiclient.16x16.png'), 'docs/assets/favicon.png')

shutil.copy(os.path.join(tempdirname, 'vcmi-develop/ChangeLog.md'), 'docs/ChangeLog.md')
with open('docs/ChangeLog.md', "r") as file:
tmp = file.read()
tmp = re.sub(r"(# [\d])", r"#\1", tmp)
with open('docs/ChangeLog.md', "w") as file:
file.write("---\nhide:\n - navigation\n---\n\n# Changelog\n" + tmp)

shutil.copytree('static', 'docs', dirs_exist_ok=True)

0 comments on commit 7203866

Please sign in to comment.