Skip to content

Commit 9adc0ee

Browse files
authored
Merge pull request #1 from codebase-interface/copilot/add-reveal-presentations-feature
Implement reveal.js-based presentation system with Markdown and Taskfile automation
2 parents 5e47e96 + e9d5b7e commit 9adc0ee

File tree

18 files changed

+2111
-2
lines changed

18 files changed

+2111
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
deploy:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '18'
32+
cache: 'npm'
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v4
39+
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: '.'
44+
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,10 @@ dist
137137
# Vite logs files
138138
vite.config.js.timestamp-*
139139
vite.config.ts.timestamp-*
140+
141+
# Task runner
142+
.task/
143+
144+
# OS files
145+
.DS_Store
146+
Thumbs.db

.nojekyll

Whitespace-only changes.

CONTRIBUTING.md

Lines changed: 339 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,339 @@
1+
# Contributing to Presentations
2+
3+
This repository hosts reveal.js-based presentations for the Codebase Interface organization, deployed at `codebaseinterface.org/presentations/`.
4+
5+
## Quick Workflow Overview
6+
7+
```
8+
1. Create presentation: task new -- my-presentation
9+
2. Edit slides: presentations/my-presentation/slides.md
10+
3. Test locally: task serve
11+
4. Add to index: index.html (update presentations array)
12+
5. Commit & push: Git workflow
13+
6. Auto-deploy: GitHub Actions → GitHub Pages
14+
7. Live at: codebaseinterface.org/presentations/my-presentation/
15+
```
16+
17+
## Prerequisites
18+
19+
- [Node.js](https://nodejs.org/) (v14 or higher)
20+
- [Task](https://taskfile.dev/) - A task runner / build tool
21+
- Git
22+
23+
### Installing Task
24+
25+
**macOS/Linux:**
26+
```bash
27+
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
28+
```
29+
30+
**Windows (with Scoop):**
31+
```bash
32+
scoop install task
33+
```
34+
35+
**Or use npm:**
36+
```bash
37+
npm install -g @go-task/cli
38+
```
39+
40+
## Getting Started
41+
42+
1. **Clone the repository:**
43+
```bash
44+
git clone https://github.com/codebase-interface/presentations.git
45+
cd presentations
46+
```
47+
48+
2. **Install dependencies:**
49+
```bash
50+
task install
51+
```
52+
53+
## Creating a New Presentation
54+
55+
### Using the Task Command
56+
57+
The easiest way to create a new presentation is using the `task new` command:
58+
59+
```bash
60+
task new -- my-presentation-name
61+
```
62+
63+
This will:
64+
- Create a new directory under `presentations/my-presentation-name/`
65+
- Copy the presentation template (HTML and Markdown files)
66+
- Set up the basic structure with sample slides in Markdown
67+
- Show you the next steps
68+
69+
**Example:**
70+
```bash
71+
task new -- introduction-to-ai
72+
```
73+
74+
### Manual Creation
75+
76+
If you prefer to create a presentation manually:
77+
78+
1. Create a new directory under `presentations/`:
79+
```bash
80+
mkdir -p presentations/my-presentation
81+
```
82+
83+
2. Copy the template:
84+
```bash
85+
cp -r templates/presentation/* presentations/my-presentation/
86+
```
87+
88+
3. Edit the `presentations/my-presentation/slides.md` file to add your content in Markdown.
89+
90+
## Editing Your Presentation
91+
92+
Presentations use Markdown format, making them easy to write and maintain!
93+
94+
1. Open `presentations/your-presentation-name/slides.md` in your favorite editor.
95+
96+
2. Use `---` to separate horizontal slides:
97+
```markdown
98+
# First Slide
99+
100+
Content for first slide
101+
102+
---
103+
104+
# Second Slide
105+
106+
Content for second slide
107+
```
108+
109+
3. Use `--` for vertical slides (sub-slides):
110+
```markdown
111+
# Main Topic
112+
113+
---
114+
115+
## Subtopic 1
116+
117+
--
118+
119+
## Subtopic 2
120+
121+
--
122+
123+
## Subtopic 3
124+
```
125+
126+
4. Format text with Markdown:
127+
```markdown
128+
# Heading 1
129+
## Heading 2
130+
131+
**Bold text**
132+
*Italic text*
133+
`Inline code`
134+
135+
- Bullet point 1
136+
- Bullet point 2
137+
138+
1. Numbered item 1
139+
2. Numbered item 2
140+
141+
[Link text](https://example.com)
142+
```
143+
144+
5. Add code blocks with syntax highlighting:
145+
```markdown
146+
```javascript
147+
function example() {
148+
return "Hello World";
149+
}
150+
` ``
151+
```
152+
153+
6. Add fragment animations (step-by-step reveals):
154+
```markdown
155+
- First item <!-- .element: class="fragment" -->
156+
- Second item <!-- .element: class="fragment" -->
157+
- Third item <!-- .element: class="fragment" -->
158+
```
159+
160+
7. Add speaker notes:
161+
```markdown
162+
This is slide content
163+
164+
Note:
165+
These are speaker notes that only appear in presenter view
166+
```
167+
168+
### Advanced HTML in Markdown
169+
170+
You can also use HTML within your Markdown for more control:
171+
172+
```markdown
173+
<div style="color: red;">
174+
Custom styled content
175+
</div>
176+
```
177+
178+
## Testing Locally
179+
180+
Start the local development server:
181+
182+
```bash
183+
task serve
184+
```
185+
186+
Then open your browser to:
187+
- Main page: http://localhost:8000/
188+
- Your presentation: http://localhost:8000/presentations/your-presentation-name/
189+
190+
**Navigation tips:**
191+
- Use arrow keys to navigate between slides
192+
- Press `F` for fullscreen
193+
- Press `S` for speaker notes view
194+
- Press `ESC` for slide overview
195+
196+
## Available Task Commands
197+
198+
Run `task --list` to see all available commands:
199+
200+
- `task install` - Install dependencies
201+
- `task new -- <name>` - Create a new presentation
202+
- `task serve` - Start local development server
203+
- `task list` - List all presentations
204+
- `task clean` - Clean generated files
205+
- `task help` - Show available commands
206+
207+
## Adding Your Presentation to the Index
208+
209+
After creating a presentation, add it to the main index page so it appears on the homepage:
210+
211+
### Option 1: Using the helper script (Recommended)
212+
213+
1. Run the script to generate the presentations array:
214+
```bash
215+
task update-index
216+
```
217+
218+
2. Copy the output and paste it into `index.html`, replacing the existing `presentations` array.
219+
220+
3. Update the descriptions manually to make them more meaningful.
221+
222+
### Option 2: Manual Update
223+
224+
1. Open `index.html` in the root directory
225+
2. Find the `presentations` array in the JavaScript section
226+
3. Add your presentation:
227+
```javascript
228+
const presentations = [
229+
{
230+
slug: 'my-presentation',
231+
title: 'My Presentation Title',
232+
description: 'A brief description of the presentation'
233+
}
234+
];
235+
```
236+
237+
## Reveal.js Features
238+
239+
This setup includes the following reveal.js plugins:
240+
- **Markdown** - Write slides in Markdown (primary method)
241+
- **Highlight** - Syntax highlighting for code
242+
- **Notes** - Speaker notes (press `S` during presentation)
243+
244+
### Advanced Features in Markdown
245+
246+
**Backgrounds:**
247+
248+
Add backgrounds using HTML comments:
249+
```markdown
250+
<!-- .slide: data-background-color="#ff0000" -->
251+
# Red Background Slide
252+
253+
---
254+
255+
<!-- .slide: data-background-image="image.jpg" -->
256+
# Image Background Slide
257+
```
258+
259+
**Transitions:**
260+
```markdown
261+
<!-- .slide: data-transition="zoom" -->
262+
# This Slide Zooms In
263+
```
264+
265+
**Custom Classes and Styles:**
266+
```markdown
267+
This text is red <!-- .element: style="color: red;" -->
268+
269+
Centered content <!-- .element: class="r-fit-text" -->
270+
```
271+
272+
For more features, see the [reveal.js documentation](https://revealjs.com/).
273+
274+
## Customizing Themes
275+
276+
The template uses the `black` theme by default. You can change it by editing the theme link in your presentation's HTML:
277+
278+
```html
279+
<link rel="stylesheet" href="../../node_modules/reveal.js/dist/theme/black.css">
280+
```
281+
282+
Available themes:
283+
- `black.css` (default) - Dark background
284+
- `white.css` - Light background
285+
- `league.css` - Gray background, blue links
286+
- `beige.css` - Beige background
287+
- `sky.css` - Blue gradient background
288+
- `night.css` - Black background, thick headers
289+
- `serif.css` - Cappuccino background with serif text
290+
- `simple.css` - White background, black text
291+
- `solarized.css` - Cream-colored background
292+
- `moon.css` - Dark blue background
293+
- `dracula.css` - Dracula color scheme
294+
- `blood.css` - Dark background, blood red accents
295+
296+
## Deployment
297+
298+
The repository is automatically deployed to GitHub Pages when changes are pushed to the main branch. Your presentation will be available at:
299+
300+
```
301+
https://codebaseinterface.org/presentations/your-presentation-name/
302+
```
303+
304+
## Best Practices
305+
306+
1. **Keep it simple** - Focus on key points, avoid text-heavy slides
307+
2. **Use visuals** - Images, diagrams, and code examples are powerful
308+
3. **Test locally** - Always preview your presentation before committing
309+
4. **Consistent naming** - Use lowercase and hyphens for presentation names (e.g., `my-presentation`)
310+
5. **Organize slides** - Use horizontal slides (`---`) for main topics and vertical slides (`--`) for details
311+
6. **Add speaker notes** - Use `Note:` prefix in Markdown for presenter guidance
312+
7. **Write in Markdown** - It's easier to maintain and version control than HTML
313+
314+
## Troubleshooting
315+
316+
### Presentation not showing?
317+
- Ensure you've run `task install` to install dependencies
318+
- Check that your presentation directory has both `index.html` and `slides.md` files
319+
- Verify the reveal.js paths in your HTML are correct (`../../node_modules/reveal.js/...`)
320+
- Make sure the markdown file path in index.html matches your filename
321+
322+
### Styles not loading?
323+
- Make sure `node_modules` exists (run `task install`)
324+
- Check the console for 404 errors
325+
- Verify the CSS link paths are correct
326+
327+
### Task command not found?
328+
- Install Task following the instructions in Prerequisites
329+
- Alternatively, run npm scripts directly: `npm run serve`
330+
331+
## Getting Help
332+
333+
- **Reveal.js Documentation:** https://revealjs.com/
334+
- **Task Documentation:** https://taskfile.dev/
335+
- **Issues:** Open an issue in this repository
336+
337+
## License
338+
339+
This project is open source and available under the MIT License.

0 commit comments

Comments
 (0)