Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/docs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import shutil
from http.server import HTTPServer, SimpleHTTPRequestHandler
from multiprocessing import Pool
from pathlib import Path
from typing import Dict, Optional, Tuple

Expand Down Expand Up @@ -207,10 +208,15 @@ def build_all():
typer.echo(f"Building docs for: en")
mkdocs.commands.build.build(mkdocs.config.load_config(site_dir=str(site_path)))
os.chdir(current_dir)

langs = []
for lang in get_lang_paths():
if lang == en_build_path or not lang.is_dir():
continue
build_lang(lang.name)
langs.append(lang.name)
cpu_count = os.cpu_count() or 1
with Pool(cpu_count * 2) as p:
p.map(build_lang, langs)
typer.echo("Copying en index.md to README.md")
en_index = en_build_path / "docs" / "index.md"
shutil.copyfile(en_index, "README.md")
Expand Down