Skip to content

Commit

Permalink
šŸ› Fix calling mkdocs for languages as a subprocess to fix/enable Mkā€¦
Browse files Browse the repository at this point in the history
ā€¦Docs Material search plugin (#5501)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
tiangolo and pre-commit-ci[bot] committed Oct 16, 2022
1 parent 90fc429 commit e866a2c
Show file tree
Hide file tree
Showing 22 changed files with 489 additions and 2 deletions.
466 changes: 466 additions & 0 deletions docs/az/docs/index.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/az/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/de/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/en/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/es/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/fa/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/fr/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/he/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/id/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/it/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/ja/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/ko/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/nl/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/pl/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/pt/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/ru/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/sq/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/sv/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/tr/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/uk/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
1 change: 1 addition & 0 deletions docs/zh/mkdocs.yml
Expand Up @@ -32,6 +32,7 @@ repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
Expand Down
5 changes: 3 additions & 2 deletions scripts/docs.py
@@ -1,6 +1,7 @@
import os
import re
import shutil
import subprocess
from http.server import HTTPServer, SimpleHTTPRequestHandler
from multiprocessing import Pool
from pathlib import Path
Expand Down Expand Up @@ -200,7 +201,7 @@ def build_lang(
)
current_dir = os.getcwd()
os.chdir(build_lang_path)
mkdocs.commands.build.build(mkdocs.config.load_config(site_dir=str(dist_path)))
subprocess.run(["mkdocs", "build", "--site-dir", dist_path], check=True)
os.chdir(current_dir)
typer.secho(f"Successfully built docs for: {lang}", color=typer.colors.GREEN)

Expand Down Expand Up @@ -275,7 +276,7 @@ def build_all():
current_dir = os.getcwd()
os.chdir(en_docs_path)
typer.echo("Building docs for: en")
mkdocs.commands.build.build(mkdocs.config.load_config(site_dir=str(site_path)))
subprocess.run(["mkdocs", "build", "--site-dir", site_path], check=True)
os.chdir(current_dir)
langs = []
for lang in get_lang_paths():
Expand Down

0 comments on commit e866a2c

Please sign in to comment.