Skip to content

Commit acc0676

Browse files
Add generate_llms_txt.py to make llms.txt (#1338)
* Add generate_llms_txt.py to make `llms.txt` Also removes `generate_content_catalog.py` since that's no longer needed for the AI assistant demo (https://demo-ai-assistant.streamlit.app/). * Make generate_llms_txt.py read descriptions from MD as well. * Improve typing. * Add comments, reformat header lines --------- Co-authored-by: Debbie Matthews <[email protected]>
1 parent 597db82 commit acc0676

File tree

11 files changed

+208
-90
lines changed

11 files changed

+208
-90
lines changed

content/get-started/installation/streamlit-playground.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Use Streamlit Playground in your browser
33
slug: /get-started/installation/streamlit-playground
4+
description: Quick start guide to Streamlit using the Streamlit Playground - no installation required.
45
---
56

67
# Use Streamlit Playground in your browser

content/kb/FAQ/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: FAQ
33
slug: /knowledge-base/using-streamlit
4+
description: Explore answers to frequently asked questions about developing a Streamlit app.
45
---
56

67
# FAQ

content/kb/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Knowledge Base
33
slug: /knowledge-base
4+
description: Explore troubleshooting guides for common problems.
45
---
56

67
# Knowledge base

content/kb/dependencies/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Installing dependencies
33
slug: /knowledge-base/dependencies
4+
description: Explore common dependency and environment problems, and see possible solutions.
45
---
56

67
# Installing dependencies

content/kb/deployments/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Deployment Issues
33
slug: /knowledge-base/deploy
4+
description: Explore common deployment problems and solutions.
45
---
56

67
# Deployment-related questions and errors

makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ start:
1111
npm run start
1212

1313
.PHONY: export
14-
export: llms
14+
export: llms llms-full
1515
npm run export
1616

1717
.PHONY: llms
1818
llms:
19+
uv run python/generate_llms_txt.py
20+
21+
.PHONY: llms-full
22+
llms-full:
1923
uv run python/generate_llms_full_txt.py
2024

2125
.PHONY: lint

public/llms-full.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
This gets autogenerated on deploy. See `make export`.
2-

public/llms.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This gets autogenerated on deploy. See `make export`.

python/generate_content_catalog.py

Lines changed: 0 additions & 84 deletions
This file was deleted.

python/generate_llms_full_txt.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,7 @@ def replace_autofunction_tags(content: str, function_info: Dict[str, Any]) -> st
280280
else:
281281
if function_name:
282282
print(
283-
f"Warning: Function '{function_name}' not found in "
284-
"streamlit.json"
283+
f"Warning: Function '{function_name}' not found in streamlit.json"
285284
)
286285
# If function not found, remove the tag but leave a placeholder
287286
tag.replace_with(f"[Function '{function_name}' not found]")
@@ -303,7 +302,7 @@ def process_markdown_files(content_dir: Path) -> List[Dict[str, Optional[str]]]:
303302
content_dir: Path to the content directory containing markdown files.
304303
305304
Returns:
306-
List of dictionaries containing 'url' (from frontmatter slug) and 'content'
305+
List of dictionaries containing 'url' (from frontmatter slug) and 'content'
307306
for each markdown file.
308307
"""
309308
content_catalog: List[Dict[str, Optional[str]]] = []
@@ -398,4 +397,3 @@ def main() -> None:
398397

399398
if __name__ == "__main__":
400399
main()
401-

0 commit comments

Comments
 (0)