Skip to content

Commit

Permalink
Fix multiple docs issues (#1718)
Browse files Browse the repository at this point in the history
* Use mkdocs hooks to show correct edit url for public_api pages

* Use correct workflow path

* Change twitter.com to x.com

* Update .yml to .yaml to fix broken badge

* Remove broken reference to faststream codegen

* Fix formatting of EmailStr API docs link

* Update max response body size
  • Loading branch information
kumaranvpl authored Aug 23, 2024
1 parent c77ea5e commit 9961017
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs_check-broken-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
uses: ruzickap/action-my-broken-link-checker@v2
with:
url: https://faststream.airt.ai
cmd_params: '--buffer-size=8192 --max-connections=1 --color=always --header="User-Agent:Mozilla/5.0(Firefox/97.0)" --exclude="(localhost:8000|linkedin.com|fonts.gstatic.com|reddit.com)" --max-connections-per-host=1 --rate-limit=1'
cmd_params: '--buffer-size=8192 --max-connections=1 --color=always --header="User-Agent:Mozilla/5.0(Firefox/97.0)" --exclude="(localhost:8000|linkedin.com|fonts.gstatic.com|reddit.com)" --max-connections-per-host=1 --rate-limit=1 --max-response-body-size=20000000'
debug: true
2 changes: 1 addition & 1 deletion .github/workflows/docs_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
paths:
- docs/**
- .github/workflows/deploy-docs.yaml
- .github/workflows/docs_deploy.yaml
- faststream/__about__.py

permissions:
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

<br/>

<a href="https://github.com/airtai/faststream/actions/workflows/pr_codeql.yml" target="_blank">
<img src="https://github.com/airtai/faststream/actions/workflows/pr_codeql.yml/badge.svg" alt="CodeQL">
<a href="https://github.com/airtai/faststream/actions/workflows/pr_codeql.yaml" target="_blank">
<img src="https://github.com/airtai/faststream/actions/workflows/pr_codeql.yaml/badge.svg" alt="CodeQL">
</a>

<a href="https://github.com/airtai/faststream/actions/workflows/pr_dependency-review.yaml" target="_blank">
Expand Down Expand Up @@ -73,8 +73,6 @@ Making streaming microservices has never been easier. Designed with junior devel

- [**Integrations**](#any-framework): **FastStream** is fully compatible with any HTTP framework you want ([**FastAPI**](#fastapi-plugin) especially)

- [**Built for Automatic Code Generation**](#code-generator): **FastStream** is optimized for automatic code generation using advanced models like GPT and Llama

That's **FastStream** in a nutshell—easy, efficient, and powerful. Whether you're just starting with streaming microservices or looking to scale, **FastStream** has got you covered.

---
Expand Down
8 changes: 7 additions & 1 deletion docs/create_api_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def _generate_api_docs_for_module(root_path: Path, module_name: str) -> Tuple[st
src = """ - [ContactDict](api/faststream/asyncapi/schema/info/ContactDict.md)
"""
dst = """ - [ContactDict](api/faststream/asyncapi/schema/info/ContactDict.md)
- [EmailStr](api/faststream/asyncapi/schema/info/EmailStr.md)
- [EmailStr](api/faststream/asyncapi/schema/info/EmailStr.md)
"""
api_summary = api_summary.replace(src, dst)

Expand Down Expand Up @@ -342,6 +342,12 @@ def create_api_docs(
(docs_dir / "SUMMARY.md").write_text(summary)


def on_page_markdown(markdown, *, page, config, files):
"""Mkdocs hook to update the edit URL for the public API pages."""
if "public_api" in page.edit_url:
page.edit_url = page.edit_url.replace("public_api", "api")


if __name__ == "__main__":
root = Path(__file__).resolve().parent
create_api_docs(root, "faststream")
2 changes: 1 addition & 1 deletion docs/docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ search:
- info
- [Contact](api/faststream/asyncapi/schema/info/Contact.md)
- [ContactDict](api/faststream/asyncapi/schema/info/ContactDict.md)
- [EmailStr](api/faststream/asyncapi/schema/info/EmailStr.md)
- [EmailStr](api/faststream/asyncapi/schema/info/EmailStr.md)
- [Info](api/faststream/asyncapi/schema/info/Info.md)
- [License](api/faststream/asyncapi/schema/info/License.md)
- [LicenseDict](api/faststream/asyncapi/schema/info/LicenseDict.md)
Expand Down
6 changes: 2 additions & 4 deletions docs/docs/en/faststream.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ search:

<br/>

<a href="https://github.com/airtai/faststream/actions/workflows/pr_codeql.yml" target="_blank">
<img src="https://github.com/airtai/faststream/actions/workflows/pr_codeql.yml/badge.svg" alt="CodeQL">
<a href="https://github.com/airtai/faststream/actions/workflows/pr_codeql.yaml" target="_blank">
<img src="https://github.com/airtai/faststream/actions/workflows/pr_codeql.yaml/badge.svg" alt="CodeQL">
</a>

<a href="https://github.com/airtai/faststream/actions/workflows/pr_dependency-review.yaml" target="_blank">
Expand Down Expand Up @@ -80,8 +80,6 @@ Making streaming microservices has never been easier. Designed with junior devel

- [**Integrations**](#any-framework): **FastStream** is fully compatible with any HTTP framework you want ([**FastAPI**](#fastapi-plugin) especially)

- [**Built for Automatic Code Generation**](#code-generator): **FastStream** is optimized for automatic code generation using advanced models like GPT and Llama

That's **FastStream** in a nutshell—easy, efficient, and powerful. Whether you're just starting with streaming microservices or looking to scale, **FastStream** has got you covered.

---
Expand Down
5 changes: 4 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ plugins:
redirect_template: templates/redirect.html
canonical_version: latest

hooks:
- create_api_docs.py

markdown_extensions:
- toc:
permalink: "#" # replace TOC block symbol
Expand Down Expand Up @@ -163,7 +166,7 @@ extra:
- icon: fontawesome/brands/github-alt
link: https://github.com/airtai/faststream
- icon: fontawesome/brands/twitter
link: https://twitter.com/airt_AI
link: https://x.com/airt_AI
- icon: fontawesome/brands/facebook
link: https://www.facebook.com/airt.ai.api/
- icon: fontawesome/brands/linkedin
Expand Down
6 changes: 3 additions & 3 deletions docs/overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ <h2 class="title">The community has spoken!</h2>
<div class="container tx-container">
<div class="row">
<div class="col col--4 testimonialWrapper_gvoa">
<a href="https://twitter.com/nats_io/status/1716460663734759831" target="_blank" rel="noopener noreferrer"
<a href="https://x.com/nats_io/status/1716460663734759831" target="_blank" rel="noopener noreferrer"
class="testimonialAnchor_iYyG">
<div>
<div class="testimonialHeader_iSI8">
Expand Down Expand Up @@ -826,7 +826,7 @@ <h6>robot__eyes</h6>
</div>
</div>
</a>
<a href="https://twitter.com/edwardkens50830/status/1710248156540145979" target="_blank"
<a href="https://x.com/edwardkens50830/status/1710248156540145979" target="_blank"
rel="noopener noreferrer" class="testimonialAnchor_iYyG">
<div>
<div class="testimonialHeader_iSI8">
Expand Down Expand Up @@ -864,7 +864,7 @@ <h6>Pale-Cantaloupe3878</h6>
</div>
</div>
</a>
<a href="https://twitter.com/dev_raj4522/status/1706417606956343529" target="_blank"
<a href="https://x.com/dev_raj4522/status/1706417606956343529" target="_blank"
rel="noopener noreferrer" class="testimonialAnchor_iYyG hidden">
<div>
<div class="testimonialHeader_iSI8">
Expand Down

0 comments on commit 9961017

Please sign in to comment.