Skip to content

Commit

Permalink
Fix issues with scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
fflorent committed Feb 23, 2024
1 parent dfd12af commit 983bc87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@

app = typer.Typer()

alternate_langs_config_name = "mkdocs-alternate-langs.yml"
mkdocs_config_name = "mkdocs.yml"

docs_folder_name = "help"
docs_path = Path("help")
en_docs_path = Path("help/en")
alternate_langs_config_path: Path = Path(alternate_langs_config_name)
alternate_langs_config_path: Path = Path("mkdocs-alternate-langs.yml")
site_path = Path("site").absolute()
build_site_path = Path("site_build").absolute()

Expand Down Expand Up @@ -88,7 +88,7 @@ def new_lang(lang: str = typer.Argument(..., callback=lang_callback)):
typer.echo(f"The language was already created: {lang}")
raise typer.Abort()
new_path.mkdir()
new_config_path: Path = Path(new_path) / alternate_langs_config_name
new_config_path: Path = Path(new_path) / mkdocs_config_name
new_config_path.write_text(get_mkdocs_yaml_for_lang(lang), encoding="utf-8")
new_config_docs_path: Path = language_docs_dir(lang)
new_config_docs_path.mkdir()
Expand Down
4 changes: 2 additions & 2 deletions mkdocs-utils/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ def generate_renamed_section_items(


def on_nav(
nav: Navigation, *, config: MkDocsConfig, _: Files
nav: Navigation, *, config: MkDocsConfig, **_: Any
) -> Navigation:
new_items = generate_renamed_section_items(nav.items, config=config)
return Navigation(items=new_items, pages=nav.pages)


def on_page_markdown(
markdown: str, *, page: Page, config: MkDocsConfig
markdown: str, *, page: Page, config: MkDocsConfig, **_: Any
) -> str:
if isinstance(page.file, EnFile):
for excluded_section in non_translated_sections:
Expand Down

0 comments on commit 983bc87

Please sign in to comment.