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

Commit 3c8fa22

Browse files
refactor(#35): Web Component deckgo-code renamed to deckgo-highlight-code
1 parent e03beb6 commit 3c8fa22

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

doc/components/components.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
- [Gif](#gif)
88
- [Chart](#chart)
9-
- [Code](#code)
9+
- [Highlight Code](#highlight-code)
1010
- [Youtube](#youtube)
1111
- [Social](#social)
1212

@@ -64,13 +64,13 @@ The "Chart" component is an extra component which let you draw charts easily. Th
6464

6565
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).
6666

67-
## Code
67+
## Highlight Code
6868

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.
69+
The "Highlight 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-highlight-code) for the details.
7070

7171
### Note
7272

73-
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).
73+
The [DeckDeckGo] - Highlight 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-highlight-code). See its related [installation guide](https://github.com/fluster/deckdeckgo-highlight-code#getting-started).
7474

7575
## Youtube
7676

doc/slides/slides.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ The slots `title` and `code` are optional.
489489

490490
#### Code components
491491

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).
492+
The slide "Code" relies on the code component `<deckgo-highlight-code/>` which is described in the components [documentation](https://github.com/fluster/deckdeckgo/blob/master/doc/components/components.md).
493493

494494
#### Installation
495495

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).
496+
The [DeckDeckGo] - Hightlight 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-highlight-code) as described in its [installation guide](https://github.com/fluster/deckdeckgo-highlight-code#getting-started).
497497

498498
#### Attributes
499499

@@ -546,7 +546,7 @@ The following theming options will affect this component if set on its host or p
546546
| --slide-padding-bottom | 16px | Padding bottom of the all slide |
547547
| --slide-padding-start | 32px | Padding left of the all slide |
548548

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

551551
### Slide: Author
552552

src/components/slides/deckdeckgo-slide-code/deckdeckgo-slide-code.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class DeckdeckgoSlideCode implements DeckdeckgoSlide {
4444
return new Promise<void>((resolve) => {
4545
const code: HTMLElement = this.el.querySelector('[slot=\'code\']');
4646

47-
const codeComponent = this.el.shadowRoot.querySelector('deckgo-code');
47+
const codeComponent = this.el.shadowRoot.querySelector('deckgo-highlight-code');
4848

4949
if (codeComponent && code) {
5050
codeComponent.appendChild(code);
@@ -73,7 +73,7 @@ export class DeckdeckgoSlideCode implements DeckdeckgoSlide {
7373
}
7474

7575
private scrollToNext(swipeLeft: boolean): Promise<boolean> {
76-
const element: HTMLElement = this.el.shadowRoot.querySelector('deckgo-code');
76+
const element: HTMLElement = this.el.shadowRoot.querySelector('deckgo-highlight-code');
7777

7878
if (element) {
7979
return (element as any).scrollToNext(swipeLeft);
@@ -86,7 +86,7 @@ export class DeckdeckgoSlideCode implements DeckdeckgoSlide {
8686

8787
private zoomCode(zoom: boolean): Promise<void> {
8888
return new Promise<void>(async (resolve) => {
89-
const element: HTMLElement = this.el.shadowRoot.querySelector('deckgo-code');
89+
const element: HTMLElement = this.el.shadowRoot.querySelector('deckgo-highlight-code');
9090

9191
if (element) {
9292
await (element as any).zoomCode(zoom);
@@ -160,7 +160,7 @@ export class DeckdeckgoSlideCode implements DeckdeckgoSlide {
160160
onTouchEnd={() => this.touchScrollEnd()}>
161161
<slot name="title"></slot>
162162
<div class="deckgo-slide-code-container" onScroll={() => this.emitScrolling()}>
163-
<deckgo-code src={this.src} anchor={this.anchor} anchorZoom={this.anchorZoom} hideAnchor={this.hideAnchor} language={this.language}></deckgo-code>
163+
<deckgo-highlight-code src={this.src} anchor={this.anchor} anchorZoom={this.anchorZoom} hideAnchor={this.hideAnchor} language={this.language}></deckgo-highlight-code>
164164
</div>
165165
<slot name="code"></slot>
166166
</div>;

0 commit comments

Comments
 (0)