Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Readthedocs cannot parse comments, resulting in docs bugs #1033

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/distributions/self_hosted_distro/dell.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
---
orphan: true
---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->

# Dell Distribution of Llama Stack

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
---
orphan: true
---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# Fireworks Distribution

```{toctree}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
---
orphan: true
---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# Meta Reference Distribution

```{toctree}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
---
orphan: true
---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# Meta Reference Quantized Distribution

```{toctree}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/distributions/self_hosted_distro/ollama.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
---
orphan: true
---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# Ollama Distribution

```{toctree}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
---
orphan: true
---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# Remote vLLM Distribution
```{toctree}
:maxdepth: 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
---
orphan: true
---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# SambaNova Distribution

```{toctree}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/distributions/self_hosted_distro/tgi.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
---
orphan: true
---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->

# TGI Distribution

Expand Down
2 changes: 1 addition & 1 deletion docs/source/distributions/self_hosted_distro/together.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
---
orphan: true
---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# Together Distribution

```{toctree}
Expand Down
11 changes: 9 additions & 2 deletions llama_stack/templates/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,15 @@ def generate_markdown_docs(self) -> str:
providers_str = ", ".join(f"`{p}`" for p in providers)
providers_table += f"| {api} | {providers_str} |\n"

template = "<!-- This file was auto-generated by distro_codegen.py, please edit source -->\n"
template += self.template_path.read_text()
template = self.template_path.read_text()
comment = "<!-- This file was auto-generated by distro_codegen.py, please edit source -->\n"
orphantext = "---\norphan: true\n---\n"

if template.startswith(orphantext):
template = template.replace(orphantext, orphantext + comment)
else:
template = comment + template

# Render template with rich-generated table
env = jinja2.Environment(
trim_blocks=True,
Expand Down