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 orphan: true
--- ---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# Dell Distribution of Llama Stack # 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 orphan: true
--- ---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# Fireworks Distribution # Fireworks Distribution
```{toctree} ```{toctree}

View file

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

View file

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

View file

@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
--- ---
orphan: true orphan: true
--- ---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# Ollama Distribution # Ollama Distribution
```{toctree} ```{toctree}

View file

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

View file

@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
--- ---
orphan: true orphan: true
--- ---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# SambaNova Distribution # SambaNova Distribution
```{toctree} ```{toctree}

View file

@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
--- ---
orphan: true orphan: true
--- ---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# TGI Distribution # TGI Distribution

View file

@ -1,7 +1,7 @@
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
--- ---
orphan: true orphan: true
--- ---
<!-- This file was auto-generated by distro_codegen.py, please edit source -->
# Together Distribution # Together Distribution
```{toctree} ```{toctree}

View file

@ -131,8 +131,15 @@ class DistributionTemplate(BaseModel):
providers_str = ", ".join(f"`{p}`" for p in providers) providers_str = ", ".join(f"`{p}`" for p in providers)
providers_table += f"| {api} | {providers_str} |\n" 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 # Render template with rich-generated table
env = jinja2.Environment( env = jinja2.Environment(
trim_blocks=True, trim_blocks=True,