diff --git a/docs/en/images/linux/tutorial-8.png b/docs/en/images/linux/tutorial-8.png index 8d88b140..207f1987 100644 Binary files a/docs/en/images/linux/tutorial-8.png and b/docs/en/images/linux/tutorial-8.png differ diff --git a/docs/en/images/macOS/tutorial-8.png b/docs/en/images/macOS/tutorial-8.png index 93c113cf..c9d66cbe 100644 Binary files a/docs/en/images/macOS/tutorial-8.png and b/docs/en/images/macOS/tutorial-8.png differ diff --git a/docs/en/images/windows/tutorial-8.png b/docs/en/images/windows/tutorial-8.png index f3fdeaf8..51632615 100644 Binary files a/docs/en/images/windows/tutorial-8.png and b/docs/en/images/windows/tutorial-8.png differ diff --git a/docs/en/index.md b/docs/en/index.md index f3d0b03f..7de5771f 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -18,7 +18,7 @@ If you're not comfortable with English, translations of this tutorial are availa /// admonition | This is a machine translation! -This version of the tutorial has been generated by machine translation. We know this isn't ideal, but we felt that a bad translation was better than no translation at all. +This document is a machine-generated translation of the [English](https://tutorial.beeware.org/) tutorial. We know that a machine translation isn't ideal, but we felt that a bad translation was better than no translation at all. If you'd like the help improve the translation, get in touch! We have a `#translations` channel in [Discord](https://beeware.org/bee/chat/). Introduce yourself there and we will add you to the translation team. @@ -30,7 +30,7 @@ If you'd like the help improve the translation, get in touch! We have a `#transl /// admonition | This is a translation! -This document is a translation of the English version. The translation has been reviewed by humans, but newer sections may be generated by machine translation, or not translated at all. +This document is a translation of the [English](https://tutorial.beeware.org) tutorial. The translation has been reviewed by humans, but newer sections may have been generated by machine translation. If you'd like the help improve the translation, get in touch! We have a `#translations` channel in [Discord](https://beeware.org/bee/chat/). Introduce yourself there and we will add you to the translation team. diff --git a/docs/en/tutorial/message.json b/docs/en/tutorial/message.json new file mode 100644 index 00000000..6dd22c00 --- /dev/null +++ b/docs/en/tutorial/message.json @@ -0,0 +1,3 @@ +{ + "body": "Hello, API user!" +} diff --git a/docs/en/tutorial/tutorial-8.md b/docs/en/tutorial/tutorial-8.md index fd59ec6c..b333980c 100644 --- a/docs/en/tutorial/tutorial-8.md +++ b/docs/en/tutorial/tutorial-8.md @@ -8,7 +8,7 @@ However, in a real world application, we'll need to perform complex tasks or cal A common time-consuming task an app will need to perform is to make a request on a web API to retrieve data, and display that data to the user. Web APIs sometimes take a second or two to respond, so if we're calling an API like that, we need to ensure our application doesn't become unresponsive while we wait for the web API to return an answer. -This is a toy app, so we don't have a *real* API to work with, so we'll use the [{JSON} Placeholder API](https://jsonplaceholder.typicode.com) as a source of data. The {JSON} Placeholder API has a number of "fake" API endpoints you can use as test data. One of those APIs is the `/posts/` endpoint, which returns fake blog posts. If you open `https://jsonplaceholder.typicode.com/posts/42` in your browser, you'll get a JSON payload describing a single post - some [Lorum ipsum](https://en.wikipedia.org/wiki/Lorem_ipsum) content for a blog post with ID 42. +This is a toy app, so we don't have a *real* API to work with, so we'll use a sample API endpoint as a source of data. If you open [`https://tutorial.beeware.org/tutorial/message.json`](https://tutorial.beeware.org/tutorial/message.json) in your browser, you'll get a JSON payload with a message. The Python standard library contains all the tools you'd need to access an API. However, the built-in APIs are very low level. They are good implementations of the HTTP protocol - but they require the user to manage lots of low-level details, like URL redirection, sessions, authentication, and payload encoding. As a "normal browser user" you're probably used to taking these details for granted, as a browser manages them for you. @@ -35,7 +35,7 @@ Then modify the `say_hello()` callback so it looks like this: async def say_hello(self, widget): fake = faker.Faker() with httpx.Client() as client: - response = client.get("https://jsonplaceholder.typicode.com/posts/42") + response = client.get("https://tutorial.beeware.org/tutorial/message.json") payload = response.json() diff --git a/tox.ini b/tox.ini index dbdd04bf..0b91910a 100644 --- a/tox.ini +++ b/tox.ini @@ -16,8 +16,8 @@ commands: translate : build_pot_translations translate : build_po_translations de es fr it pt zh_CN zh_TW translate : update_machine_translations --soft-fail de es fr it pt zh_CN zh_TW - lint : markdown-checker --dir {[docs]docs_dir} --func check_broken_urls lint : pyspelling + lint : markdown-checker --dir {[docs]docs_dir} --func check_broken_urls en : build_md_translations {posargs} en de : build_md_translations {posargs} de es : build_md_translations {posargs} es