From 413986d1a93d8cc5351f1a1c9beed24094c2fe78 Mon Sep 17 00:00:00 2001 From: jmkdev <21228906+jmkd3v@users.noreply.github.com> Date: Sun, 4 Feb 2024 16:29:03 -0500 Subject: [PATCH] documentation rework (#115) - bumped mkdocs-material to 9.5.7 - bumped other docs dependencies to latest versions - bumped to new mkdocstrings python provider - rewrote doc-stubs generator based on mkdocstrings example recipe, fixed weird __init__ behavior - light/dark theme support with a toggle - new CSS, very pretty! - fixed broken absolute links - some small text changes here and there --- .github/workflows/dev-docs.yml | 6 +- .github/workflows/release-docs.yml | 5 +- docs/SUMMARY.md | 7 +- docs/assets/theme.css | 16 --- docs/gen_doc_stubs.py | 39 -------- docs/index.md | 8 +- docs/overrides/assets/stylesheets/main.css | 8 -- docs/overrides/main.html | 7 -- docs/scripts/gen_ref_pages.py | 36 +++++++ docs/stylesheets/main.css | 107 +++++++++++++++++++++ docs/tutorials/authentication.md | 2 +- docs/tutorials/error-handling.md | 3 +- docs/tutorials/migrating.md | 25 ----- docs/tutorials/pagination.md | 6 +- docs/tutorials/roblosecurity.md | 8 +- docs/tutorials/thumbnails.md | 47 ++++----- mkdocs.yml | 38 +++++--- roblox/client.py | 16 +-- roblox/utilities/iterators.py | 2 +- 19 files changed, 214 insertions(+), 172 deletions(-) delete mode 100644 docs/assets/theme.css delete mode 100644 docs/gen_doc_stubs.py delete mode 100644 docs/overrides/assets/stylesheets/main.css create mode 100644 docs/scripts/gen_ref_pages.py create mode 100644 docs/stylesheets/main.css delete mode 100644 docs/tutorials/migrating.md diff --git a/.github/workflows/dev-docs.yml b/.github/workflows/dev-docs.yml index cabb8c3a..d8b07dbd 100644 --- a/.github/workflows/dev-docs.yml +++ b/.github/workflows/dev-docs.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: name: - description: "MkDocs Deploy" + description: "Deploy docs (dev)" push: branches: - "main" @@ -30,9 +30,7 @@ jobs: - name: Install dependencies run: | - pip install git+https://github.com/squidfunk/mkdocs-material.git@8.0.0b2 - pip install mkdocstrings[python-legacy] httpx mkdocs-literate-nav mkdocs-gen-files mike - + pip install mkdocs-material==9.5.7 mkdocs-section-index==0.3.8 mkdocstrings==0.24.0 mkdocstrings-python==1.8.0 mkdocs-literate-nav==0.6.1 mkdocs-gen-files==0.5.0 mkdocs-autorefs==0.5.0 mike==2.0.0 - name: Configure Git user run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/release-docs.yml b/.github/workflows/release-docs.yml index f2190752..4942f7c7 100644 --- a/.github/workflows/release-docs.yml +++ b/.github/workflows/release-docs.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: inputs: name: - description: "Deploy Docs (release)" + description: "Deploy docs (release)" jobs: mkdocs: @@ -24,8 +24,7 @@ jobs: - name: Install dependencies run: | - pip install git+https://github.com/squidfunk/mkdocs-material.git@8.0.0b2 - pip install mkdocstrings[python-legacy] httpx mkdocs-literate-nav mkdocs-gen-files mike + pip install mkdocs-material==9.5.7 mkdocs-section-index==0.3.8 mkdocstrings==0.24.0 mkdocstrings-python==1.8.0 mkdocs-literate-nav==0.6.1 mkdocs-gen-files==0.5.0 mkdocs-autorefs==0.5.0 mike==2.0.0 - name: Configure Git user run: | diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index c0bab0d8..1702bd16 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -1,3 +1,8 @@ +--- +search: + exclude: true +--- + * [Overview](index.md) * [Tutorials](tutorials/index.md) * [Get Started](tutorials/get-started.md) @@ -7,6 +12,4 @@ * [Pagination](tutorials/pagination.md) * [ROBLOSECURITY](tutorials/roblosecurity.md) * [Bases](tutorials/bases.md) - * [Extensions](tutorials/extensions.md) - * [Migrating to v2.0](tutorials/migrating.md) * [Code Reference](reference/) \ No newline at end of file diff --git a/docs/assets/theme.css b/docs/assets/theme.css deleted file mode 100644 index a92e3a0d..00000000 --- a/docs/assets/theme.css +++ /dev/null @@ -1,16 +0,0 @@ -[data-md-color-scheme=slate] { - --md-default-bg-color: #1d1d1f; - --md-typeset-a-color: var(--md-accent-fg-color) !important; -} - -.md-typeset a:focus, .md-typeset a:hover { - color: #72b8ff; -} - -.md-footer-copyright::after{ - content: "ยท Original theme by Elttob"; -} - -:root { - color-scheme: dark; -} diff --git a/docs/gen_doc_stubs.py b/docs/gen_doc_stubs.py deleted file mode 100644 index 40445dd7..00000000 --- a/docs/gen_doc_stubs.py +++ /dev/null @@ -1,39 +0,0 @@ -""" -Generates documentation for our Python modules. -""" - -from pathlib import Path -import mkdocs_gen_files -nav = mkdocs_gen_files.Nav() - -package_names = ["roblox"] - -for package_name in package_names: - for path in sorted(Path(package_name).glob("**/*.py")): - module_path = path.with_suffix("") - doc_path = path.with_suffix(".md") - - full_doc_path = Path("reference", doc_path) - - nav[module_path.parts] = str(doc_path) - print(full_doc_path) - with mkdocs_gen_files.open(full_doc_path, "w") as f: - ident = ".".join(module_path.parts) - data = "::: " + ident - print(data, file=f) - - # mkdocs_gen_files.set_edit_path(full_doc_path, path) - -generated_nav = nav.build_literate_nav() - -nav_string = "" - -for nav_piece in generated_nav: - # Fix bugs with __init__ files. Why does this work? No idea. - nav_piece = nav_piece.replace("[\\__init__]", "[\\_\\_init\\_\\_]") - nav_piece = nav_piece.replace("__init__.md", "/__init__.md") - nav_string += nav_piece - - -with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: - nav_file.write(nav_string) diff --git a/docs/index.md b/docs/index.md index 99c485a1..6fbdfe45 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,16 +1,14 @@

- ro.py - + ro.py

- ro.py is an asynchronous, object-oriented wrapper for the Roblox web API.

## Features -- **Asynchronous**: ro.py works well with asynchronous frameworks like [FastAPI](https://fastapi.tiangolo.com/) and -[discord.py](https://github.com/Rapptz/discord.py). - **Easy**: ro.py's client-based model is intuitive and easy to learn. It abstracts away API requests and leaves you with simple objects that represent data on the Roblox platform. +- **Asynchronous**: ro.py works well with asynchronous frameworks like [FastAPI](https://fastapi.tiangolo.com/) and +[discord.py](https://github.com/Rapptz/discord.py). - **Flexible**: ro.py's Requests object allows you to extend ro.py beyond what we've already implemented. ## Installation diff --git a/docs/overrides/assets/stylesheets/main.css b/docs/overrides/assets/stylesheets/main.css deleted file mode 100644 index c70d2084..00000000 --- a/docs/overrides/assets/stylesheets/main.css +++ /dev/null @@ -1,8 +0,0 @@ -.md-banner strong { - white-space: nowrap; -} -.md-banner a { - color: white; - font-size: 0.8rem; -} - diff --git a/docs/overrides/main.html b/docs/overrides/main.html index 92759564..85bffa30 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -1,12 +1,5 @@ {% extends "base.html" %} -{% block extrahead %} - -{% endblock %} - {% block announce %} For updates and support, join the diff --git a/docs/scripts/gen_ref_pages.py b/docs/scripts/gen_ref_pages.py new file mode 100644 index 00000000..cfdd64cb --- /dev/null +++ b/docs/scripts/gen_ref_pages.py @@ -0,0 +1,36 @@ +from pathlib import Path + +import mkdocs_gen_files + +nav = mkdocs_gen_files.Nav() + +src = Path(__file__).parent.parent.parent / "roblox" + +for path in sorted(src.rglob("*.py")): + module_path = path.relative_to(src).with_suffix("") + doc_path = path.relative_to(src).with_suffix(".md") + full_doc_path = Path("reference", doc_path) + + parts = tuple(module_path.parts) + + if parts[-1] == "__init__": + parts = parts[:-1] + doc_path = doc_path.with_name("index.md") + full_doc_path = full_doc_path.with_name("index.md") + elif parts[-1] == "__main__": + continue + + if not parts: + print(f"skipping {module_path.parts}") + continue + + nav[parts] = doc_path.as_posix() + + with mkdocs_gen_files.open(full_doc_path, "w") as fd: + ident = ".".join(parts) + fd.write(f"::: roblox.{ident}") + + mkdocs_gen_files.set_edit_path(full_doc_path, path) + +with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: + nav_file.writelines(nav.build_literate_nav()) diff --git a/docs/stylesheets/main.css b/docs/stylesheets/main.css new file mode 100644 index 00000000..9bf01fe5 --- /dev/null +++ b/docs/stylesheets/main.css @@ -0,0 +1,107 @@ +:root { + /* font-size: 125% !important; */ +} + +[data-md-color-scheme=slate] { + --md-code-bg-color: hsl(0 0% 100% / 1.5%); + --md-default-bg-color: hsl(0 0% 6%); + + --md-footer-bg-color: hsl(0 0% 12% / 75%); + --md-footer-bg-color--dark: transparent; + +} + +[data-md-color-scheme=slate] .md-header, +[data-md-color-scheme=slate] .md-tabs { + background: hsl(0 0% 10% / 75%); +} + +[data-md-color-scheme=slate] .md-typeset table { + --md-default-bg-color: hsl(0 0% 7.5%); + --md-typeset-table-color: hsl(0 0% 95% / 3%); +} + +[data-md-color-scheme=slate] .md-typeset details { + background: hsl(0 0% 100% / 2%); +} + +[data-md-color-scheme=default] { + --md-footer-bg-color: hsl(0 0% 97%); + --md-footer-bg-color--dark: transparent; + --md-footer-fg-color: hsl(0 0% 0%); + --md-footer-fg-color--lighter: hsl(0 0% 33%); + --md-footer-fg-color--light: hsl(0 0% 0%); + --md-code-bg-color: hsl(0 0% 0% / 2.33%); +} + +[data-md-color-scheme=default] .md-header, +[data-md-color-scheme=default] .md-tabs { + background: hsl(0 0% 100% / 75%); +} + +[data-md-color-scheme=default] .md-search__form { + background: hsl(0 0% 0% / 5%); +} + +[data-md-color-scheme=default] .md-search__form:hover { + background: hsl(0 0% 0% / 10%); +} + +[data-md-color-scheme=default] .md-typeset details { + background: hsl(0 0% 0% / 0.5%); +} + +.md-header, .md-tabs { + backdrop-filter: blur(32px); + -webkit-backdrop-filter: blur(32px); +} + +.md-typeset table { + border-radius: .3rem !important; +} + +.md-banner strong { + white-space: nowrap; +} + +.md-banner a { + color: inherit; + font-size: 0.8rem; +} + +.md-typeset .admonition, .md-typeset details { + border-width: 1px; + border-radius: .3rem !important; + overflow: clip; +} + +.md-typeset details { + border: none; +} + +.admonition-title { + border-radius: 0rem !important; +} + +.md-header--shadow { + box-shadow: 0 0 .2rem #0000001a, 0 .2rem .4rem #0001; +} + +.md-search__form { + border-radius: .15rem !important; +} +[data-md-toggle=search]:checked~.md-header .md-search__form { + border-bottom-left-radius: 0 !important; + border-bottom-right-radius 0 !important; +} + +.doc-contents .quote .highlight { + margin: 0; + margin-left: -.6rem; + margin-right: -.6rem; + --md-code-bg-color: transparent; +} + +.doc-contents .quote .highlighttable { + margin: 0; +} \ No newline at end of file diff --git a/docs/tutorials/authentication.md b/docs/tutorials/authentication.md index 340ffb35..6573b367 100644 --- a/docs/tutorials/authentication.md +++ b/docs/tutorials/authentication.md @@ -1,6 +1,6 @@ # Authentication To authenticate our client, we need our .ROBLOSECURITY token. To learn about why we need this and how to get it, -please see [ROBLOSECURITY](/roblosecurity). +please see [ROBLOSECURITY](./roblosecurity.md). Once we have our token, we can add it to our client by passing it as the first parameter. Use the following code and replace `TOKEN` with the .ROBLOSECURITY token grabbed earlier to authenticate your client. diff --git a/docs/tutorials/error-handling.md b/docs/tutorials/error-handling.md index 4e38c83b..becef22f 100644 --- a/docs/tutorials/error-handling.md +++ b/docs/tutorials/error-handling.md @@ -82,8 +82,7 @@ except Unauthorized as exception: print("URL:", exception.response.url) ``` Roblox also returns extra error data, which is what you see in our error messages. -We can access this with the `.errors` attribute, which is a list of -[`ResponseError`](/reference/roblox/utilities/exceptions/#roblox.utilities.exceptions.ResponseError): +We can access this with the `.errors` attribute, which is a list of [`ResponseError`][roblox.utilities.exceptions.ResponseError]: ```python group = await client.get_group(1) try: diff --git a/docs/tutorials/migrating.md b/docs/tutorials/migrating.md deleted file mode 100644 index e3ccfc51..00000000 --- a/docs/tutorials/migrating.md +++ /dev/null @@ -1,25 +0,0 @@ -# Migrating to v2.0 - -# Changes -- The cache has been removed. When you call `client.get_XYZ`, you can guarantee that you'll always get a new object. - Keep this in mind. -- The events system has been removed. The polling behavior was hard to maintain and is out of scope for this project. -- ro.py's gamepersistence system has been removed. It may be added in the future. -- ro.py's trade system has been removed. We have no plans to reimplement it. -- ro.py's SignalR-based notification system has been removed. It is out of scope for this project but may be added later - as an extension. -- `Client.filter_text()` has been removed. It may be added back in the future. -- `Client.get_game_by_place_id()` and `Client.get_game_by_universe_id()` have been removed. Instead, use - `Client.get_place()` and `Client.get_universe()`. -- The captcha system has been removed, along with methods that used it, including `Client.user_login()` and - `Client.get_captcha_metadata()`. -- `Client.secure_sign_out()` has been removed. -- All *singular* `Client` methods, like `get_user()`, raise new errors. See [Error handling](/tutorial/error-handling). -- `BaseGroup.get_member()` now returns an abstract `MemberRelationship` representing the relationship between a group - and a user. For this reason, it is no longer a coroutine. `BaseGroup.get_member_by_username` is still a coroutine. -- The thumbnail system has been rewritten. For this reason, `BaseUser.thumbnails` no longer exists and you should use - `Client.thumbnails` or `BaseXYZ.get_thumbnail` methods. -- `Client.get_self()` is now `Client.get_authenticated_user()`. -- The way objects were structured in ro.py has changed. In the past, objects would be responsible for their own requests - with an `update` method - now they take in data and parse it. If your code ever calls `.update`, please change it to - instead grab the object again with `Client.get_XYZ()`. \ No newline at end of file diff --git a/docs/tutorials/pagination.md b/docs/tutorials/pagination.md index 11fcf4a7..d2b1ee08 100644 --- a/docs/tutorials/pagination.md +++ b/docs/tutorials/pagination.md @@ -3,9 +3,9 @@ Certain Roblox endpoints are paginated. This means that going through their data pages of a book - you start at page 1 and then you can move forwards or backwards until you reach the start or the end. This can be annoying when all you want is "every member in a group" or "the last 10 posts on a group wall", so ro.py -abstracts this away into a "PageIterator" that you can use to loop over your data. +abstracts this away into an iterator that you can use to loop over your data. -As an example, the `Client.user_search()` function takes in a keyword (like "builderman") and returns a `PageIterator` +As an example, the [`Client.user_search()`][roblox.client.Client.user_search] function takes in a keyword (like "builderman") and returns a [`PageIterator`][roblox.utilities.iterators.PageIterator] which you can loop through to get the search results. ## Looping through items @@ -45,7 +45,7 @@ async for page in client.user_search("builderman", page_size=100).pages(): ``` ## Flattening into a list -If we want to turn all of this data into one list, we can use `flatten()`. Be careful, as this isn't ideal for large +If we want to turn all of this data into one list, we can use [`flatten()`][roblox.utilities.iterators.PageIterator.flatten]. Be careful, as this isn't ideal for large sets of data and may use more memory. Because we turn this iterator into a list, we can use a normal for loop now: ```python for user in await client.user_search("boatbomber").flatten(): diff --git a/docs/tutorials/roblosecurity.md b/docs/tutorials/roblosecurity.md index b5ad34df..093b0003 100644 --- a/docs/tutorials/roblosecurity.md +++ b/docs/tutorials/roblosecurity.md @@ -35,18 +35,18 @@ To grab your .ROBLOSECURITY cookie, log into your account on the Roblox website browser, clicking the arrow next to `roblox.com`, opening up the "Cookies" folder, clicking ".ROBLOSECURITY", clicking on the "Content" text once, pressing ++control+a++, and then pressing ++control+c++ (make sure **not** to double-click this field as you won't select the entire value!) - - ![](/assets/screenshots/ChromeCookie.png){: style="width: 400px"} + + ![](../assets/screenshots/ChromeCookie.png){: style="width: 400px"} Alternatively, you can access the cookie by going to https://www.roblox.com/, pressing ++control+shift+i++ to access the Developer Tools, navigating to the "Application" tab, opening up the arrow next to "Cookies" on the sidebar on the left, clicking the `https://www.roblox.com` item underneath the Cookies button, and then copying the .ROBLOSECURITY token by double-clicking on the value and then hitting ++control+c++. - ![](/assets/screenshots/ChromeDevTools.png){: style="height: 436px"} + ![](../assets/screenshots/ChromeDevTools.png){: style="height: 436px"} === "Firefox" You can access the cookie by going to https://www.roblox.com/ and pressing ++shift+f9++, pressing the "Storage" tab button on the top, opening up the "Cookies" section in the sidebar on the left, clicking the `https://www.roblox.com` item underneath it, and then copying the .ROBLOSECURITY token by double-clicking on the value and then hitting ++control+c++. - ![](/assets/screenshots/FirefoxCookie.jpeg) + ![](../assets/screenshots/FirefoxCookie.jpeg) diff --git a/docs/tutorials/thumbnails.md b/docs/tutorials/thumbnails.md index e88522b3..7f185a7c 100644 --- a/docs/tutorials/thumbnails.md +++ b/docs/tutorials/thumbnails.md @@ -3,9 +3,8 @@ The `client.thumbnails` attribute is a `ThumbnailProvider` object which you can Below is a list of item types on Roblox and methods you can use to generate their thumbnails. ## Users -To generate avatar thumbnails, use the -[`get_user_avatar_thumbnails()`](/reference/roblox/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_user_avatar_thumbnails) method. -The `type` parameter is an [`AvatarThumbnailType`](/reference/roblox/thumbnails/#roblox.thumbnails.AvatarThumbnailType) +To generate avatar thumbnails, use the [`get_user_avatar_thumbnails()`][roblox.thumbnails.ThumbnailProvider.get_user_avatar_thumbnails] method. +The `type` parameter is an [`AvatarThumbnailType`][roblox.thumbnails.AvatarThumbnailType] object, which you can import from `roblox` or from `roblox.thumbnails`. Do note that the `size` parameter only allows certain sizes - see the docs for more details. @@ -22,14 +21,12 @@ if len(user_thumbnails) > 0: print(user_thumbnail.image_url) ``` -`thumbnails` is a list of [`Thumbnail`](/reference/roblox/thumbnails/#roblox.thumbnails.Thumbnail) objects. +`thumbnails` is a list of [`Thumbnail`][roblox.thumbnails.Thumbnail] objects. We can read the first thumbnail (if it exists) and print out its URL. ### 3D thumbnails -To generate 3D avatar thumbnails, use the -[`get_user_avatar_thumbnails_3d()`](/reference/roblox/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_user_avatar_thumbnails_3d) method -and call the [`get_3d_data()`](/reference/roblox/thumbnails/#roblox.thumbnails.Thumbnail.get_3d_data) -method on the thumbnail to get 3d-related data. +To generate 3D avatar thumbnails, use the [`get_user_avatar_thumbnail_3d()`][roblox.thumbnails.ThumbnailProvider.get_user_avatar_thumbnail_3d] method +and call [`get_3d_data()`][roblox.thumbnails.Thumbnail.get_3d_data] on the resulting thumbnail. ```python user = await client.get_user(1) @@ -41,12 +38,12 @@ print("Textures:") for texture in user_3d_data.textures: print(texture.get_url()) ``` -`threed_data` is a [`ThreeDThumbnail`](/reference/roblox/threedthumbnails/#roblox.threedthumbnails.ThreeDThumbnail) +`threed_data` is a [`ThreeDThumbnail`][roblox.threedthumbnails.ThreeDThumbnail] object. ## Groups To generate group icons, use the -[`get_group_icons()`](/reference/roblox/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_group_icons) method. +[`get_group_icons()`][roblox.thumbnails.ThumbnailProvider.get_group_icons] method. ```python group = await client.get_group(9695397) group_icons = await client.thumbnails.get_group_icons( @@ -60,7 +57,7 @@ if len(group_icons) > 0: ## Assets To generate asset thumbnails, use the -[`get_asset_thumbnails()`](/reference/roblox/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_asset_thumbnails) +[`get_asset_thumbnails()`][roblox.thumbnails.ThumbnailProvider.get_asset_thumbnails] method. ```python asset = await client.get_asset(8100249026) @@ -74,11 +71,11 @@ if len(asset_thumbnails) > 0: ``` ### 3D thumbnails -To generate 3D asset thumbnails, use the -[`get_asset_thumbnail_3d()`](/reference/roblox/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_asset_thumbnail_3d) -method and and call the [`get_3d_data()`](/reference/roblox/thumbnails/#roblox.thumbnails.Thumbnail.get_3d_data) -method on the thumbnail to get 3d-related data. -Do note that you can only generate 3D thumbnails for "catalog-type" assets, like hats. +!!! note + Not all assets support 3D thumbnails. Most "catalog" assets do, excluding "classic faces", which have no 3D representation. + +To generate 3D asset thumbnails, use the [`get_asset_thumbnail_3d()`][roblox.thumbnails.ThumbnailProvider.get_asset_thumbnail_3d] +method and call [`get_3d_data()`][roblox.thumbnails.Thumbnail.get_3d_data] on the resulting thumbnail. ```python asset = await client.get_asset(151784320) asset_3d_thumbnail = await client.thumbnails.get_asset_thumbnail_3d(asset) @@ -91,8 +88,7 @@ for texture in asset_3d_data.textures: ``` ## Places -To generate place icons, use the -[`get_place_icons()`](/reference/roblox/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_place_icons) method. +To generate place icons, use the [`get_place_icons()`][roblox.thumbnails.ThumbnailProvider.get_place_icons] method. ```python place = await client.get_place(8100260845) place_thumbnails = await client.thumbnails.get_place_icons( @@ -106,8 +102,7 @@ if len(place_thumbnails) > 0: ## Universes ### Icons -To generate universe icons, use the -[`get_universe_icons()`](/reference/roblox/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_universe_icons) method. +To generate universe icons, use the[`get_universe_icons()`][roblox.thumbnails.ThumbnailProvider.get_universe_icons] method. ```python universe = await client.get_universe(3118067569) universe_icons = await client.thumbnails.get_universe_icons( @@ -119,9 +114,7 @@ if len(universe_icons) > 0: print(universe_icon.image_url) ``` ### Thumbnails -To generate universe thumbnails, use the -[`get_universe_thumbnails()`](/reference/roblox/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_universe_thumbnails) -method. +To generate universe thumbnails, use the [`get_universe_thumbnails()`][roblox.thumbnails.ThumbnailProvider.get_universe_thumbnails] method. Because each universe can have multiple thumbnails, this method behaves differently. ```python universe = await client.get_universe(3118067569) @@ -136,8 +129,7 @@ if len(universes_thumbnails) > 0: ``` ## Badges -To generate badge icons, use the -[`get_badge_icons()`](/reference/roblox/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_badge_icons) method. +To generate badge icons, use the [`get_badge_icons()`][roblox.thumbnails.ThumbnailProvider.get_badge_icons] method. ```python badge = await client.get_badge(2124867793) badge_icons = await client.thumbnails.get_badge_icons( @@ -151,9 +143,8 @@ if len(badge_icons) > 0: ## Gamepasses To generate gamepass icons, use the -[`get_gamepass_icons()`](/reference/roblox/thumbnails/#roblox.thumbnails.ThumbnailProvider.get_gamepass_icons) method. -This example uses [`get_base_gamepass()`](/reference/roblox/client/#roblox.client.Client.get_base_gamepass) -because there is no `get_gamepass` method. +[`get_gamepass_icons()`][roblox.thumbnails.ThumbnailProvider.get_gamepass_icons] method. +This example uses [`get_base_gamepass()`][roblox.client.Client.get_base_gamepass] because there is no `get_gamepass` method. ```python gamepass = client.get_base_gamepass(25421830) gamepass_icons = await client.thumbnails.get_gamepass_icons( diff --git a/mkdocs.yml b/mkdocs.yml index d111f74b..29c7ec0e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,16 +16,30 @@ theme: code: JetBrains Mono icon: repo: fontawesome/brands/github + palette: - scheme: slate - primary: black - accent: blue + - media: "(prefers-color-scheme: light)" + scheme: default + primary: white + accent: blue + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: black + accent: blue + toggle: + icon: material/brightness-3 + name: Switch to light mode + features: - content.code.annotate - navigation.tabs extra_css: - - assets/theme.css + - stylesheets/main.css watch: - roblox @@ -34,20 +48,12 @@ plugins: - search - gen-files: scripts: - - docs/gen_doc_stubs.py + - docs/scripts/gen_ref_pages.py - literate-nav: nav_file: SUMMARY.md - - mkdocstrings: - handlers: - python: - setup_commands: - - import sys - - sys.path.append("docs") - options: - new_path_syntax: yes - show_if_no_docstring: yes - show_signature_annotations: yes - show_root_heading: yes + - mkdocstrings + - section-index + markdown_extensions: - admonition diff --git a/roblox/client.py b/roblox/client.py index fbea3a43..5090408d 100644 --- a/roblox/client.py +++ b/roblox/client.py @@ -221,7 +221,7 @@ def get_base_user(self, user_id: int) -> BaseUser: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](../tutorials/bases.md). Arguments: user_id: A Roblox user ID. @@ -282,7 +282,7 @@ def get_base_group(self, group_id: int) -> BaseGroup: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](../tutorials/bases.md). Arguments: group_id: A Roblox group ID. @@ -335,7 +335,7 @@ def get_base_universe(self, universe_id: int) -> BaseUniverse: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](../tutorials/bases.md). Arguments: universe_id: A Roblox universe ID. @@ -389,7 +389,7 @@ def get_base_place(self, place_id: int) -> BasePlace: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](../tutorials/bases.md). Arguments: place_id: A Roblox place ID. @@ -430,7 +430,7 @@ def get_base_asset(self, asset_id: int) -> BaseAsset: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](../tutorials/bases.md). Arguments: asset_id: A Roblox asset ID. @@ -484,7 +484,7 @@ def get_base_plugin(self, plugin_id: int) -> BasePlugin: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](../tutorials/bases.md). Arguments: plugin_id: A Roblox plugin ID. @@ -525,7 +525,7 @@ def get_base_badge(self, badge_id: int) -> BaseBadge: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](../tutorials/bases.md). Arguments: badge_id: A Roblox badge ID. @@ -542,7 +542,7 @@ def get_base_gamepass(self, gamepass_id: int) -> BaseGamePass: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](../tutorials/bases.md). Arguments: gamepass_id: A Roblox gamepass ID. diff --git a/roblox/utilities/iterators.py b/roblox/utilities/iterators.py index 59f4e844..11ec82f3 100644 --- a/roblox/utilities/iterators.py +++ b/roblox/utilities/iterators.py @@ -153,7 +153,7 @@ def pages(self) -> IteratorPages: class PageIterator(RobloxIterator): """ Represents a cursor-based, paginated Roblox object. Learn more about iterators in the pagination tutorial: - [Pagination](/tutorial/pagination) + [Pagination](../../tutorials/pagination.md) For more information about how cursor-based pagination works, see https://robloxapi.wiki/wiki/Pagination. Attributes: