🏁 Change docs address to localhost for Windows (#1169)

This commit is contained in:
Camila Gutierrez 2020-03-26 22:22:34 +01:00 committed by GitHub
parent 71c2abb41d
commit c13b54ad0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -201,14 +201,14 @@ During local development, there is a script that builds the site and checks for
```console ```console
$ python ./scripts/docs.py live $ python ./scripts/docs.py live
<span style="color: green;">[INFO]</span> Serving on http://0.0.0.0:8008 <span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes <span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes <span style="color: green;">[INFO]</span> Start detecting changes
``` ```
</div> </div>
It will serve the documentation on `http://0.0.0.0:8008`. It will serve the documentation on `http://127.0.0.1:8008`.
That way, you can edit the documentation/source files and see the changes live. That way, you can edit the documentation/source files and see the changes live.
@ -280,14 +280,14 @@ Now run the live server for the docs in Spanish:
// Use the command "live" and pass the language code as a CLI argument // Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es $ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://0.0.0.0:8008 <span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes <span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes <span style="color: green;">[INFO]</span> Start detecting changes
``` ```
</div> </div>
Now you can go to <a href="http://0.0.0.0:8008" class="external-link" target="_blank">http://0.0.0.0:8008</a> and see your changes live. Now you can go to <a href="http://127.0.0.1:8008" class="external-link" target="_blank">http://127.0.0.1:8008</a> and see your changes live.
If you look at the FastAPI docs website, you will see that every language has all the pages. But some are not translated and have a notification about the the translation is missing. If you look at the FastAPI docs website, you will see that every language has all the pages. But some are not translated and have a notification about the the translation is missing.

View File

@ -245,7 +245,7 @@ def serve():
os.chdir("site") os.chdir("site")
server_address = ("", 8008) server_address = ("", 8008)
server = HTTPServer(server_address, SimpleHTTPRequestHandler) server = HTTPServer(server_address, SimpleHTTPRequestHandler)
typer.echo(f"Serving at: http://0.0.0.0:8008") typer.echo(f"Serving at: http://127.0.0.1:8008")
server.serve_forever() server.serve_forever()
@ -268,7 +268,7 @@ def live(
lang = "en" lang = "en"
lang_path: Path = docs_path / lang lang_path: Path = docs_path / lang
os.chdir(lang_path) os.chdir(lang_path)
mkdocs.commands.serve.serve(dev_addr="0.0.0.0:8008") mkdocs.commands.serve.serve(dev_addr="127.0.0.1:8008")
def update_config(lang: str): def update_config(lang: str):