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

Commit d2e9278

Browse files
doc(#35): update doc for code component
1 parent 96ce162 commit d2e9278

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

doc/components/components.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- [Gif](#gif)
88
- [Chart](#chart)
9+
- [Code](#code)
910
- [Youtube](#youtube)
1011
- [Social](#social)
1112

@@ -61,7 +62,15 @@ The "Chart" component is an extra component which let you draw charts easily. Th
6162

6263
### Installation
6364

64-
**Important note**: The [DeckDeckGo] charts components are provided in separate extra library. If you wish to add charts to your presentation, you will need to install this extra component from a CDN or [npm](https://www.npmjs.com/package/deckdeckgo). See its related [installation guide](https://github.com/fluster/deckdeckgo-charts#getting-started).
65+
**Important note**: The [DeckDeckGo] charts components are provided in separate extra library. If you don't use the starter kit and wish to add charts to your presentation, you will need to install this extra component from a CDN or [npm](https://www.npmjs.com/package/deckdeckgo-charts). See its related [installation guide](https://github.com/fluster/deckdeckgo-charts#getting-started).
66+
67+
## Code
68+
69+
The "Code" component is an extra component which let you highlight code easily. This Web Component could be use in [DeckDeckGo] or in any other web projects. See its [documentation](https://github.com/fluster/deckdeckgo-code) for the details.
70+
71+
### Installation
72+
73+
**Important note**: The [DeckDeckGo] code component is provided in separate extra library. If you don't use the starter kit and wish to add it to your presentation, you will need to install this extra component from a CDN or [npm](https://www.npmjs.com/package/deckdeckgo-code). See its related [installation guide](https://github.com/fluster/deckdeckgo-code#getting-started).
6574

6675
## Youtube
6776

doc/slides/slides.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ The slide "Chart" relies on the charts components `<deckgo-pie-chart/>`, `<deckg
345345

346346
#### Installation
347347

348-
The [DeckDeckGo] charts components are provided in separate extra library. If you don't use the [DeckDeckGo] starter kit and wish to add the [DeckDeckGo] chart to your project, you will need to install and integrate it from a CDN or [npm](https://www.npmjs.com/package/deckdeckgo) as described in its [installation guide](https://github.com/fluster/deckdeckgo-charts#getting-started).
348+
The [DeckDeckGo] charts components are provided in separate extra library. If you don't use the [DeckDeckGo] starter kit and wish to add the [DeckDeckGo] chart to your project, you will need to install and integrate it from a CDN or [npm](https://www.npmjs.com/package/deckdeckgo-charts) as described in its [installation guide](https://github.com/fluster/deckdeckgo-charts#getting-started).
349349

350350
#### Attributes
351351

@@ -487,23 +487,23 @@ You could provide a file URI to the code you want to display or provide it with
487487

488488
The slots `title` and `code` are optional.
489489

490-
#### Attributes
490+
#### Code components
491491

492-
The attribute `src` is for this component mandatory. Other attributes are optional.
492+
The slide "Code" relies on the code component `<deckgo-code/>` which is described in the components [documentation](https://github.com/fluster/deckdeckgo/blob/master/doc/components/components.md).
493493

494-
| Attribute | Type | Default | Description |
495-
| -------------------------- |:-----------------:|:-----------------:|:-----------------:|
496-
| src | string | | The web url to the source code you would like to showcase |
497-
| anchor | string | // DeckDeckGo | The anchor identifier which will be use to scroll through your code when navigating using `slideNext()` or `slidePrev()` (see [documention](/doc/features/navigation.md)) |
498-
| anchor-zoom | string | // DeckDeckGoZoom | The anchor identifier which will be use to zoom inside your code when navigating using `slideNext()` or `slidePrev()` (see [documention](/doc/features/navigation.md)) |
499-
| hide-anchor | boolean | true | Set this attribute to `false` in case you would like to actually display the anchor value too |
500-
| language | string | javascript | Define the language to be used for the syntax highlighting. The list of [supported languages](https://prismjs.com/#languages-list) is defined by [Prism.js](https://prismjs.com/#languages-list) |
494+
#### Installation
495+
496+
The [DeckDeckGo] code component is provided in separate extra library. If you don't use the [DeckDeckGo] starter kit and wish to add the [DeckDeckGo] code to your project, you will need to install and integrate it from a CDN or [npm](https://www.npmjs.com/package/deckdeckgo-code) as described in its [installation guide](https://github.com/fluster/deckdeckgo-code#getting-started).
497+
498+
#### Attributes
499+
500+
At least `src` or the `slot` code should be provided in order to render code in this template. It offers the same attributes as the [DeckDeckGo] charts Web Component, see its [documentation](https://github.com/fluster/deckdeckgo-code) for the details.
501501

502502
##### Example with file URI
503503

504504
```
505505
<deckgo-deck>
506-
<deckgo-slide-code hide-anchor="fals" src="https://raw.githubusercontent.com/fluster/deckdeckgo/master/src/components/slides/deckdeckgo-slide-code/deckdeckgo-slide-code.tsx">
506+
<deckgo-slide-code hide-anchor="false" src="https://raw.githubusercontent.com/fluster/deckdeckgo/master/src/components/slides/deckdeckgo-slide-code/deckdeckgo-slide-code.tsx">
507507
<h1 slot="title">Code</h1>
508508
</deckgo-slide-code>
509509
</deckgo-deck>
@@ -541,24 +541,12 @@ The following theming options will affect this component if set on its host or p
541541
| -------------------------- |:-----------------:|:-----------------:|
542542
| --background | | |
543543
| --color | | |
544-
| --code-color | | The color of the displayed code |
545-
| --code-font-size | | The size of the font for the code |
546-
| --code-font-family | | The family of the font for the code |
547544
| --slide-padding-top | 16px | Padding top of the all slide |
548545
| --slide-padding-end | 32px | Padding right of the all slide |
549546
| --slide-padding-bottom | 16px | Padding bottom of the all slide |
550547
| --slide-padding-start | 32px | Padding left of the all slide |
551-
| --code-margin-bottom | 64px | Padding bottom of the code scroller |
552-
| --zoom-code | 1 | If you wish to manually zoom the code |
553-
| --zIndex | 1 | The z-index of the slide |
554-
555-
#### Syntax highlighting
556-
557-
The library [Prism.js](https://prismjs.com) from [James DiGioia](https://github.com/mAAdhaTTah) is use for the syntax highlighting.
558-
559-
##### Note regarding highlight extra languages
560548

561-
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.
549+
Furthermore, this slide component offers the exact same CSS4 variables as the [DeckDeckGo] code Web Component, see its [documentation](https://github.com/fluster/deckdeckgo-code) for the details.
562550

563551
### Slide: Author
564552

0 commit comments

Comments
 (0)