Skip to content

Commit

Permalink
fix: Readthedocs cannot parse comments, resulting in docs bugs (#1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellistarn authored Feb 10, 2025
1 parent ab9516c commit afca9d9
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 11 deletions.
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
2 changes: 1 addition & 1 deletion docs/source/distributions/self_hosted_distro/fireworks.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 -->
# 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
2 changes: 1 addition & 1 deletion docs/source/distributions/self_hosted_distro/sambanova.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 -->
# 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

0 comments on commit afca9d9

Please sign in to comment.