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

This commit is contained in:
Ellis Tarn 2025-02-10 13:35:16 -08:00 committed by GitHub
parent ab9516c789
commit afca9d92f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 18 additions and 11 deletions

View file

@ -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

View file

@ -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}

View file

@ -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}

View file

@ -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}

View file

@ -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}

View file

@ -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

View file

@ -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}

View file

@ -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

View file

@ -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}

View file

@ -131,8 +131,15 @@ class DistributionTemplate(BaseModel):
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,