Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit f25c3ec

Browse files
doc(#9): document author template
1 parent ef6ea35 commit f25c3ec

File tree

3 files changed

+127
-46
lines changed

3 files changed

+127
-46
lines changed

README.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Create a lightweight presentation using HTML and Web Components.
1717
- [Framework integration](#framework-integration)
1818
- [Editing](#editing)
1919
- [Detailed documentation](doc/slides/slides.md)
20-
- [Showcasing code](#showcasing-code)
2120
- [Navigation](#navigation)
2221
- [Extra features](#extra-features)
2322
- [Lazy loading](#lazy-loading)
@@ -87,34 +86,26 @@ The [Stencil documentation](https://stenciljs.com/docs/overview) provide example
8786

8887
## Editing
8988

90-
[DeckDeckGo] is a deck of slides where each slide has its own layout and behaviour. Their content could be edited and structured using the provided `slots`.
89+
[DeckDeckGo] is a deck of slides where each slide has its own layout and behaviour. Their content could be edited and structured using the provided `slots` and other attributes.
9190

92-
The slides [documentation](doc/slides/slides.md) display all templates and all options available for each slide.
91+
The deck should be declared using the tag `<deckgo-deck>` and each slide should be added to its children.
9392

9493
```
9594
<deckgo-deck>
9695
<deckgo-slide-title>
97-
<h1 slot="title">My presentation title</h1>
96+
<h1 slot="title">The first slide</h1>
9897
<p slot="content">
9998
Hello World 🚀
10099
</p>
101100
</deckgo-slide-title>
101+
102+
<deckgo-slide-content>
103+
<h1 slot="title">The second slide</h1>
104+
</deckgo-slide-content>
102105
</deckgo-deck>
103106
```
104107

105-
### Showcasing code
106-
107-
[DeckDeckGo] offers an handy slide to showcase code in your presentation. Instead of having to copy/paste your code inside the presentation itself, the provided template only need an url to the piece of code you would like display.
108-
109-
For example, in the following example, the slide is showcasing a piece of code of [DeckDeckGo] hosted on [Github](https://raw.githubusercontent.com/fluster/deckdeckgo/master/src/components/slides/deckdeckgo-slide-code/deckdeckgo-slide-code.tsx).
110-
111-
```
112-
<deckgo-deck>
113-
<deckgo-slide-code src-file="https://raw.githubusercontent.com/fluster/deckdeckgo/master/src/components/slides/deckdeckgo-slide-code/deckdeckgo-slide-code.tsx">
114-
<h1 slot="title">My code</h1>
115-
</deckgo-slide-title>
116-
</deckgo-deck>
117-
```
108+
The [detailed documentation](doc/slides/slides.md) display all templates and all options available for each slides.
118109

119110
## Navigation
120111

22.6 KB
Loading

doc/slides/slides.md

Lines changed: 119 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Some templates offer extra features as for example the slide [Code](#slide-code)
1010
- [Slide: Content](#slide-content)
1111
- [Slide: Split](#slide-split)
1212
- [Slide: Code](#slide-code)
13+
- [Slide: Author](#slide-author)
1314

1415
## Slide: Title
1516

@@ -225,21 +226,25 @@ You could provide a file URI to the code you want to display or provide it with
225226
#### Usage with file URI
226227

227228
```
228-
<deckgo-slide-code src-file="https://domain.com/path-to-my-code.extension">
229-
<h1 slot="title">My code</h1>
230-
</deckgo-slide-code>
229+
<deckgo-deck>
230+
<deckgo-slide-code src-file="https://domain.com/path-to-my-code.extension">
231+
<h1 slot="title">My code</h1>
232+
</deckgo-slide-code>
233+
</deckgo-deck>
231234
```
232235

233236
#### Usage with slotted element
234237

235238
```
236-
<deckgo-slide-code language="java">
237-
<h1 slot="title">Manual code</h1>
238-
<code slot="code">
239-
interface DeckDeckGoDemo {
240-
boolean helloWorld();
241-
}
242-
</deckgo-slide-code>
239+
<deckgo-deck>
240+
<deckgo-slide-code language="java">
241+
<h1 slot="title">Manual code</h1>
242+
<code slot="code">
243+
interface DeckDeckGoDemo {
244+
boolean helloWorld();
245+
}
246+
</deckgo-slide-code>
247+
</deckgo-deck>
243248
```
244249

245250
#### Slots
@@ -261,31 +266,35 @@ The attribute `src-file` is for this component mandatory. Other attributes are o
261266
#### Example with file URI
262267

263268
```
264-
<deckgo-slide-code hide-anchor="fals" src-file="https://raw.githubusercontent.com/fluster/deckdeckgo/master/src/components/slides/deckdeckgo-slide-code/deckdeckgo-slide-code.tsx">
265-
<h1 slot="title">Code</h1>
266-
</deckgo-slide-code>
269+
<deckgo-deck>
270+
<deckgo-slide-code hide-anchor="fals" src-file="https://raw.githubusercontent.com/fluster/deckdeckgo/master/src/components/slides/deckdeckgo-slide-code/deckdeckgo-slide-code.tsx">
271+
<h1 slot="title">Code</h1>
272+
</deckgo-slide-code>
273+
</deckgo-deck>
267274
```
268275

269276
#### Example with slotted element
270277

271278
```
272-
<deckgo-slide-code language="java">
273-
<h1 slot="title">Manual code</h1>
274-
<code slot="code">interface NumericTest {
275-
boolean computeTest(int n);
276-
}
277-
278-
public static void main(String args[]) {
279-
NumericTest isEven = (n) -> (n % 2) == 0;
280-
NumericTest isNegative = (n) -> (n < 0);
281-
282-
// Output: false
283-
System.out.println(isEven.computeTest(5));
284-
285-
// Output: true
286-
System.out.println(isNegative.computeTest(-5));
287-
}</code>
279+
<deckgo-deck>
280+
<deckgo-slide-code language="java">
281+
<h1 slot="title">Manual code</h1>
282+
<code slot="code">interface NumericTest {
283+
boolean computeTest(int n);
284+
}
285+
286+
public static void main(String args[]) {
287+
NumericTest isEven = (n) -> (n % 2) == 0;
288+
NumericTest isNegative = (n) -> (n < 0);
289+
290+
// Output: false
291+
System.out.println(isEven.computeTest(5));
292+
293+
// Output: true
294+
System.out.println(isNegative.computeTest(-5));
295+
}</code>
288296
</deckgo-slide-code>
297+
</deckgo-deck>
289298
```
290299

291300
### Theming
@@ -314,4 +323,85 @@ The library [Prism.js](https://prismjs.com) from [James DiGioia](https://github.
314323

315324
No extra [Prism.js](https://prismjs.com) languages than the default one are bundled in the [DeckDeckGo] Web Component. If you would specify another `language` (see above list of attributes) the component will inject and load the required extra scripts from [unpkg](https://unpkg.com) at runtime.
316325

326+
## Slide: Author
327+
328+
The "Author" slide let you introduce the author of the presentation.
329+
330+
### Layout
331+
332+
<img src="https://github.com/fluster/deckdeckgo/blob/master/doc/slides/deckdeckgo-slide-title-author.png" width="450px">
333+
334+
### Usage
335+
336+
The "Author" slide's Web Component could be integrated using the tag `<deckgo-slide-author/>`.
337+
338+
```
339+
<deckgo-deck>
340+
<deckgo-slide-author img-url="/assets/author.jpeg">
341+
<h1 slot="title">Author</h1>
342+
<div slot="author">
343+
<h2>David</h2>
344+
<p>Something about me</p>
345+
</div>
346+
<div slot="social-link"><deckgo-social twitter="daviddalbusco">twitter</deckgo-social></div>
347+
</deckgo-slide-author>
348+
</deckgo-deck>
349+
```
350+
351+
#### Slots
352+
353+
Both slots `title`, `author` and `social-link` are optional, but of course the slide would looks better with at least the slot `author` would be provided.
354+
355+
Notes:
356+
357+
* The slot `title` is hidden. If you use the [DeckDeckGo] starter, it will be use for the navigation modal.
358+
359+
* You could provide up to six `social-link` slots.
360+
361+
### Attributes
362+
363+
This component offers the following options which could be set using attributes:
364+
365+
| Attribute | Type | Default | Description |
366+
| -------------------------- |:-----------------:|:-----------------:|:-----------------:|
367+
| img-url | string | | An image URI, for example a picture of the author. Note: this image will be displayed as a circle. |
368+
369+
#### Example
370+
371+
```
372+
<deckgo-deck>
373+
<deckgo-slide-author img-url="/assets/author.jpeg">
374+
<div slot="author">
375+
<h2>David</h2>
376+
<p>Something about me</p>
377+
</div>
378+
<div slot="social-link"><deckgo-social twitter="daviddalbusco">twitter</deckgo-social></div>
379+
<div slot="social-link"><deckgo-social linkedin="david-dal-busco/">linkedin</deckgo-social></div>
380+
<div slot="social-link"><deckgo-social medium="david.dalbusco">medium</deckgo-social></div>
381+
</deckgo-slide-author>
382+
</deckgo-deck>
383+
```
384+
385+
### Theming
386+
387+
The following theming options will affect this component if set on its host or parent.
388+
389+
| CSS4 variable | Default | Note |
390+
| -------------------------- |:-----------------:|:-----------------:|
391+
| --background | | |
392+
| --color | | |
393+
| --slide-author-background-start | | Left pane background |
394+
| --slide-author-color-start | | Left pane color |
395+
| --slide-author-background-end | | Right pane background |
396+
| --slide-author-color-end | | Right pane color |
397+
| --slide-author-padding-top | 16px | Padding top of a slide |
398+
| --slide-author-padding-end | 32px | Padding right of a slide |
399+
| --slide-author-padding-bottom | 16px | Padding bottom of a slide |
400+
| --slide-author-padding-start | 32px | Padding left of a slide |
401+
| --slide-padding-start | 32px | Modify slotted ul and ol padding-inline-start |
402+
| --slide-author-align | inherit | Modify for example to center if you want to align the content in the middle |
403+
| --slide-author-text-align | inherit | Modify for example to center if you want to align the text in the middle |
404+
| --slide-author-img-size | 80% | The size of the image of the left pane |
405+
| --slide-author-social-padding-top | 32px | The spacing between the author description and the social links |
406+
317407
[DeckDeckGo]: https://deckdeckgo.com

0 commit comments

Comments
 (0)