Skip to content

Commit 0aff050

Browse files
committed
feat: automate llms.txt update
1 parent a98da45 commit 0aff050

3 files changed

Lines changed: 110 additions & 16 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"version": "0.0.1",
55
"scripts": {
6-
"prebuild": "node scripts/update-changelog.cjs",
6+
"prebuild": "node scripts/update-changelog.cjs && node scripts/update-llms.cjs",
77
"dev": "astro dev",
88
"start": "astro dev",
99
"build": "astro build",

public/llms.txt

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
## Actions
66

77
- [Supported actions | Demo Time](https://demotime.show/actions/): List of all supported actions in Demo Time
8+
- [GitHub Copilot actions | Demo Time](https://demotime.show/actions/copilot/): Actions for integrating GitHub Copilot in Demo Time
9+
- [External application actions | Demo Time](https://demotime.show/actions/external/): Perform actions that interact with external applications from your demos.
810
- [File actions | Demo Time](https://demotime.show/actions/file/): File actions are used to open, create, or preview files in the editor.
11+
- [Interaction actions | Demo Time](https://demotime.show/actions/interactions/): Perform interaction actions in your demos like copying to clipboard, pasting content, typing text, and pressing keys.
912
- [Patch actions | Demo Time](https://demotime.show/actions/patch/): File patch actions can be used to insert code based on a snapshot of the file and a patch file.
1013
- [Preview actions | Demo Time](https://demotime.show/actions/preview/): Preview actions are used to preview files like Markdown and images in the editor.
1114
- [Setting actions | Demo Time](https://demotime.show/actions/setting/): Perform setting actions in your demos like update settings, change themes, and more.
@@ -19,6 +22,10 @@
1922

2023
- [Adding demos | Demo Time](https://demotime.show/adding-demos/): Add your demos to your demo time configuration.
2124

25+
## Beta
26+
27+
- [Beta version | Demo Time](https://demotime.show/beta/): How to use the beta version of Demo Time.
28+
2229
## Contribute
2330

2431
- [Contributing | Demo Time](https://demotime.show/contribute/): Learn how you can contribute to the development of Demo Time.
@@ -30,6 +37,7 @@
3037

3138
## Features
3239

40+
- [MCP server support | Demo Time](https://demotime.show/features/mcp-server/): Learn how to use the Model Context Protocol (MCP) server with Demo Time for AI assistants and automation.
3341
- [Presenter View | Demo Time](https://demotime.show/features/presenter-view/): Learn how to use the presenter view in Demo Time.
3442
- [Using clock and timer functions | Demo Time](https://demotime.show/features/timer-clock/): To keep an eye on the time, you can use the clock and timer functions from Demo Time.
3543
- [Trigger from a link | Demo Time](https://demotime.show/features/uri-handler/): Learn how to trigger a demo from a link.
@@ -41,6 +49,8 @@
4149

4250
## Integrations
4351

52+
- [Apple Keynote Integration | Demo Time](https://demotime.show/integrations/keynote/): Learn how to integrate and use Demo Time with Apple Keynote for seamless live demos in your presentations.
53+
- [Demo Time for PowerPoint | Demo Time](https://demotime.show/integrations/powerpoint/): Learn how to integrate and use Demo Time with the PowerPoint Office Add-in for seamless live demos in your presentations.
4454
- [Slidev | Demo Time](https://demotime.show/integrations/slidev/): Learn more about how to integrate Slidev with Demo Time
4555

4656
## Presentation-mode
@@ -54,39 +64,50 @@
5464
- [JSON schema | Demo Time](https://demotime.show/references/json-schema/): JSON schema for the Demo Time configuration.
5565
- [Settings | Demo Time](https://demotime.show/references/settings/): Customize the settings of Demo Time to fit your needs.
5666

67+
## Releases
68+
69+
- [v1.7.0 | Demo Time](https://demotime.show/releases/1.7.0/): Release notes for version 1.7.0 of the Demo Time extension, including new features, improvements, and bug fixes.
70+
5771
## Slides
5872

5973
- [Present your slides | Demo Time](https://demotime.show/slides/): From Markdown to slides - present your slides with Demo Time
74+
- [Animations | Demo Time](https://demotime.show/slides/animations/): Learn how to use animation components in your slides.
75+
- [Components | Demo Time](https://demotime.show/slides/components/): Learn how to use animations and components in your slides.
76+
- [Custom Components | Demo Time](https://demotime.show/slides/components/custom/): Learn how to use custom components in your slides.
77+
- [Exporting your slides | Demo Time](https://demotime.show/slides/export/): Export your slides to PDF
6078
- [Slide layouts | Demo Time](https://demotime.show/slides/layouts/): Learn about the different slide layouts available in Demo Time
79+
- [Custom Slide Layout | Demo Time](https://demotime.show/slides/layouts/custom/): Learn about creating and using a custom slide layout in Demo Time
80+
- [Default Slide Layout | Demo Time](https://demotime.show/slides/layouts/default/): Learn about the default slide layout in Demo Time
81+
- [Header and Footer Support | Demo Time](https://demotime.show/slides/layouts/header-footer/): Learn how to add and customize headers and footers in your slides.
82+
- [Image Slide Layout | Demo Time](https://demotime.show/slides/layouts/image/): Learn about the image slide layout in Demo Time
83+
- [Image Left Slide Layout | Demo Time](https://demotime.show/slides/layouts/image-left/): Learn about the image-left slide layout in Demo Time
84+
- [Image Right Slide Layout | Demo Time](https://demotime.show/slides/layouts/image-right/): Learn about the image-right slide layout in Demo Time
85+
- [Intro Slide Layout | Demo Time](https://demotime.show/slides/layouts/intro/): Learn about the intro slide layout in Demo Time
86+
- [Quote Slide Layout | Demo Time](https://demotime.show/slides/layouts/quote/): Learn about the quote slide layout in Demo Time
87+
- [Section Slide Layout | Demo Time](https://demotime.show/slides/layouts/section/): Learn about the section slide layout in Demo Time
88+
- [Two Columns Slide Layout | Demo Time](https://demotime.show/slides/layouts/two-columns/): Learn about the two-columns slide layout in Demo Time
89+
- [Mermaid Diagrams | Demo Time](https://demotime.show/slides/mermaid/): Learn how to use Mermaid diagrams in your slides.
90+
- [Import PowerPoint slides | Demo Time](https://demotime.show/slides/powerpoint-import/): Import images from a PowerPoint presentation as slides
6191
- [Slide themes | Demo Time](https://demotime.show/slides/themes/): Learn about the different slide themes available in Demo Time
92+
- [Custom theme | Demo Time](https://demotime.show/slides/themes/custom/): Create your own custom theme for your slides
6293
- [Default theme | Demo Time](https://demotime.show/slides/themes/default/): Overview of the default theme in Demo Time.
94+
- [Frost theme | Demo Time](https://demotime.show/slides/themes/frost/): Overview of the frost theme in Demo Time.
6395
- [Minimal theme | Demo Time](https://demotime.show/slides/themes/minimal/): Overview of the minimal theme in Demo Time.
6496
- [Monomi theme | Demo Time](https://demotime.show/slides/themes/monomi/): Overview of the Monomi theme in Demo Time.
97+
- [Quantum theme | Demo Time](https://demotime.show/slides/themes/quantum/): Overview of the quantum theme in Demo Time.
6598
- [Unnamed theme | Demo Time](https://demotime.show/slides/themes/unnamed/): Overview of the Unnamed theme in Demo Time.
66-
- [Frost theme | Demo Time](https://demotime.show/slides/themes/frost/): Overview of the Frost theme in Demo Time.
67-
- [Quantum theme | Demo Time](https://demotime.show/slides/themes/quantum/): Overview of the Quantum theme in Demo Time.
68-
- [Custom theme | Demo Time](https://demotime.show/slides/themes/custom/): Overview of custom themes in Demo Time.
69-
- [Slide animations | Demo Time](https://demotime.show/slides/animations/): Learn about slide animations in Demo Time.
70-
- [Slide components | Demo Time](https://demotime.show/slides/components/): Learn about slide components in Demo Time.
71-
- [Custom components | Demo Time](https://demotime.show/slides/custom-components/): Learn about custom components in Demo Time.
72-
- [Export slides | Demo Time](https://demotime.show/slides/export/): Learn how to export slides in Demo Time.
73-
- [Mermaid diagrams | Demo Time](https://demotime.show/slides/mermaid/): Learn how to use Mermaid diagrams in Demo Time.
74-
- [PowerPoint import | Demo Time](https://demotime.show/slides/powerpoint-import/): Learn how to import PowerPoint slides into Demo Time.
75-
- [Slide transitions | Demo Time](https://demotime.show/slides/transitions/): Learn about slide transitions in Demo Time.
99+
- [Slide transitions | Demo Time](https://demotime.show/slides/transitions/): Learn about the different slide transitions available in Demo Time
76100

77101
## Snippets
78102

79103
- [Snippets | Demo Time](https://demotime.show/snippets/): Snippets that you can use to automate some tasks in your demo.
80104

81-
## Support
82-
83-
- [Support | Demo Time](https://demotime.show/support/): Learn how you can support the development of Demo Time.
84-
85105
## Tips
86106

87107
- [Adding Content | Demo Time](https://demotime.show/tips/adding-content/): Learn how to add content to a file in Demo Time.
88108
- [Adding new steps to a demo | Demo Time](https://demotime.show/tips/adding-steps/): Learn how you can add new steps to a demo in Demo Time.
109+
- [Control the next demo shortcut | Demo Time](https://demotime.show/tips/control-next-demo/): Learn how you can control the next demo during your presentation in Demo Time.
89110
- [Highlighting code | Demo Time](https://demotime.show/tips/highlighting/): Learn how to highlight code in Demo Time to make it stand out in your demos.
90111
- [Move panel to activity bar | Demo Time](https://demotime.show/tips/move-to-activity-bar/): You can move the Demo Time panel to the activity bar to have its own dedicated space.
91112
- [Working with Variables | Demo Time](https://demotime.show/tips/variables/): Learn how to work with variables in Demo Time to reuse them across your demos.
92-
- [Control next demo | Demo Time](https://demotime.show/tips/control-next-demo/): Learn how to control the next demo in Demo Time.
113+
- [VS Code Settings | Demo Time](https://demotime.show/tips/vscode-settings/): Learn about additional VS Code Settings that may be useful

scripts/update-llms.cjs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env node
2+
const fs=require('fs');
3+
const path=require('path');
4+
5+
const docsDir=path.resolve('src','content','docs');
6+
const baseUrl='https://demotime.show/';
7+
8+
function parseFrontMatter(content){
9+
const match=content.match(/^---\n([\s\S]*?)\n---/);
10+
const data={};
11+
if(match){
12+
const lines=match[1].split(/\n/);
13+
for(const line of lines){
14+
const idx=line.indexOf(':');
15+
if(idx>-1){
16+
const key=line.slice(0,idx).trim();
17+
const val=line.slice(idx+1).trim();
18+
data[key]=val;
19+
}
20+
}
21+
}
22+
return data;
23+
}
24+
25+
function walk(rel, results){
26+
const dir=path.join(docsDir, rel);
27+
for(const name of fs.readdirSync(dir)){
28+
const fp=path.join(dir, name);
29+
const stat=fs.statSync(fp);
30+
if(stat.isDirectory()){
31+
walk(path.join(rel, name), results);
32+
} else if(name.endsWith('.md') || name.endsWith('.mdx')){
33+
let slug=path.join(rel, name).replace(/\\/g,'/').replace(/\.mdx?$/,'');
34+
if(slug==='index') continue;
35+
if(slug.endsWith('/index')) slug=slug.slice(0,-6);
36+
const content=fs.readFileSync(fp,'utf8');
37+
const fm=parseFrontMatter(content);
38+
results.push({slug, title: fm.title||slug, desc: fm.description||''});
39+
}
40+
}
41+
}
42+
43+
const docs=[];
44+
walk('', docs);
45+
46+
docs.sort((a,b)=>a.slug.localeCompare(b.slug));
47+
48+
const categories={};
49+
for(const doc of docs){
50+
const cat=doc.slug.split('/')[0];
51+
(categories[cat]=categories[cat]||[]).push(doc);
52+
}
53+
54+
function capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1);}
55+
56+
let lines=[
57+
'# Demo Time - Live demos & slides in VS Code',
58+
'',
59+
'> Script your coding demos to perfection with this VS Code extension - no typos, no missteps, just flawless, stress-free presentations every time.',
60+
''
61+
];
62+
63+
Object.keys(categories).sort().forEach(cat=>{
64+
lines.push(`## ${capitalize(cat)}`);
65+
lines.push('');
66+
categories[cat].forEach(({slug,title,desc})=>{
67+
lines.push(`- [${title} | Demo Time](${baseUrl}${slug}/): ${desc}`);
68+
});
69+
lines.push('');
70+
});
71+
72+
fs.writeFileSync(path.join('public','llms.txt'), lines.join('\n'));
73+
console.log('llms.txt updated');

0 commit comments

Comments
 (0)