Skip to content
This repository was archived by the owner on Aug 14, 2026. It is now read-only.
Open
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
Update plugin.py
some changes in order to remove typing library
  • Loading branch information
hmd37 authored Dec 2, 2025
commit 06ecfb5106c6d308d7c65f6494a1a0bfcefe457e
9 changes: 4 additions & 5 deletions src/plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
from pathlib import Path
from typing import Any, List, Union

import yaml
from mkdocs.config import config_options
Expand Down Expand Up @@ -39,10 +38,10 @@ class MultiLangPlugin(BasePlugin):
# Taken from FastAPI scripts/mkdocs_hooks.py
def _generate_multilang_nav(
self,
items: List[Union[Page, Section, Link]],
items: list[Page | Section | Link],
config: MkDocsConfig,
):
new_items: list[Union[Page, Section, Link]] = []
new_items: list[Page | Section | Link] = []
for item in items:
if isinstance(item, Section):
new_title = item.title
Expand Down Expand Up @@ -73,7 +72,7 @@ def on_nav(
*,
config: MkDocsConfig,
files: Files,
**kwargs: Any,
**kwargs,
):
new_items = self._generate_multilang_nav(nav.items, config=config)
return Navigation(items=new_items, pages=nav.pages)
Expand All @@ -97,7 +96,7 @@ def resolve_file(*, item: str, files: Files, config: MkDocsConfig) -> None:
def resolve_files(
self,
*,
items: List[Any],
items: list[str | dict[str, str | list]],
files: Files,
config: MkDocsConfig,
) -> None:
Expand Down