🔧 Update docs setup with latest configs and plugins (#11953)

This commit is contained in:
Sebastián Ramírez authored and GitHub committed 2024-08-05 23:48:30 -05:00
1 parent af1a07052a
commit 0cd844d387
643 files changed
+37193 -21694

No files matched your search

+13 -6
View File
@@ -11,9 +11,6 @@ from multiprocessing import Pool
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import mkdocs.commands.build
import mkdocs.commands.serve
import mkdocs.config
import mkdocs.utils
import typer
import yaml
@@ -165,6 +162,13 @@ def generate_readme_content() -> str:
pre_content = content[frontmatter_end:pre_end]
post_content = content[post_start:]
new_content = pre_content + message + post_content
# Remove content between <!-- only-mkdocs --> and <!-- /only-mkdocs -->
new_content = re.sub(
r"<!-- only-mkdocs -->.*?<!-- /only-mkdocs -->",
"",
new_content,
flags=re.DOTALL,
)
return new_content
@@ -258,12 +262,15 @@ def live(
en.
"""
# Enable line numbers during local development to make it easier to highlight
os.environ["LINENUMS"] = "true"
if lang is None:
lang = "en"
lang_path: Path = docs_path / lang
os.chdir(lang_path)
mkdocs.commands.serve.serve(dev_addr="127.0.0.1:8008")
subprocess.run(
["mkdocs", "serve", "--dev-addr", "127.0.0.1:8008", "--dirty"],
env={**os.environ, "LINENUMS": "true"},
cwd=lang_path,
check=True,
)
def get_updated_config_content() -> Dict[str, Any]: