Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/components/markdown/examples/markdown-blockquotes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Component, h } from '@stencil/core';

const markdown = `
> Blockquotes are very handy in email to emulate reply text.
> This line is part of the same quote.

Quote break.

> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
`;

/**
* Blockquotes
*/
@Component({
tag: 'kompendium-example-markdown-blockquotes',
shadow: true,
})
export class MarkdownBlockquotesExample {
public render(): HTMLElement {
return <kompendium-markdown text={markdown} />;
}
}
40 changes: 40 additions & 0 deletions src/components/markdown/examples/markdown-callout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Component, h } from '@stencil/core';

const markdown = `
:::note
Some important note.
:::

:::tip
A very useful tip!
:::

:::warning
Just be careful.
:::

:::danger
This is too risky.
:::

:::important
This is vey important!
:::

:::info
Just for your information…
:::
`;

/**
* Callout
*/
@Component({
tag: 'kompendium-example-markdown-callout',
shadow: true,
})
export class MarkdownCalloutExample {
public render(): HTMLElement {
return <kompendium-markdown text={markdown} />;
}
}
26 changes: 26 additions & 0 deletions src/components/markdown/examples/markdown-code.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Component, h } from '@stencil/core';

const markdown = `
~~~
const s = "JavaScript no syntax highlighting";
alert(s);
~~~

~~~javascript
const a = "JavaScript no syntax highlighting";
alert(a);
~~~
`;

/**
* Code
*/
@Component({
tag: 'kompendium-example-markdown-code',
shadow: true,
})
export class MarkdownCodeExample {
public render(): HTMLElement {
return <kompendium-markdown text={markdown} />;
}
}
24 changes: 24 additions & 0 deletions src/components/markdown/examples/markdown-emphasis.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Component, h } from '@stencil/core';

const markdown = `
Emphasis, aka italics, with *asterisks* or _underscores_.

Strong emphasis, aka bold, with **asterisks** or __underscores__.

Combined emphasis with **asterisks and _underscores_**.

Strikethrough uses two tildes. ~~Scratch this.~~
`;

/**
* Emphasis
*/
@Component({
tag: 'kompendium-example-markdown-emphasis',
shadow: true,
})
export class MarkdownEmphasisExample {
public render(): HTMLElement {
return <kompendium-markdown text={markdown} />;
}
}
149 changes: 0 additions & 149 deletions src/components/markdown/examples/markdown-example.ts

This file was deleted.

31 changes: 31 additions & 0 deletions src/components/markdown/examples/markdown-headings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Component, h } from '@stencil/core';

const markdown = `
# Headline 1
## Headline 2
### Headline 3
#### Headline 4
##### Headline 5
###### Headline 6

Alternatively, H1 and H2 can be typed underline-ish style like this:

Alternative H1
===

Alternative H2
---
`;

/**
* Headings
*/
@Component({
tag: 'kompendium-example-markdown-headings',
shadow: true,
})
export class MarkdownHeadingsExample {
public render(): HTMLElement {
return <kompendium-markdown text={markdown} />;
}
}
30 changes: 30 additions & 0 deletions src/components/markdown/examples/markdown-horizontal-rule.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Component, h } from '@stencil/core';

const markdown = `
Three or more of…

---

Hyphens,

***

Asterisks,

___

Or Underscores
`;

/**
* Horizontal Rule
*/
@Component({
tag: 'kompendium-example-markdown-horizontal-rule',
shadow: true,
})
export class MarkdownHorizontalRuleExample {
public render(): HTMLElement {
return <kompendium-markdown text={markdown} />;
}
}
26 changes: 26 additions & 0 deletions src/components/markdown/examples/markdown-images.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Component, h } from '@stencil/core';

const markdown = `
Here's our logo (hover to see the title text):

Inline-style:
![alt text](https://docs.kompendium.dev/~gitbook/image?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F35954987%2F99229931-f5889200-27ee-11eb-934e-6284b6978b07.png&width=300&dpr=2&quality=100&sign=5a11d8e&sv=1 "Logo Title Text 1")

Reference-style:
![alt text][logo]

[logo]: https://docs.kompendium.dev/~gitbook/image?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F35954987%2F99229931-f5889200-27ee-11eb-934e-6284b6978b07.png&width=300&dpr=2&quality=100&sign=5a11d8e&sv=1 "Logo Title Text 2"
`;

/**
* Images
*/
@Component({
tag: 'kompendium-example-markdown-images',
shadow: true,
})
export class MarkdownImageExample {
public render(): HTMLElement {
return <kompendium-markdown text={markdown} />;
}
}
40 changes: 40 additions & 0 deletions src/components/markdown/examples/markdown-links.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Component, h } from '@stencil/core';

const markdown = `
URLs and URLs in angle brackets will automatically get turned into links, like
http://www.example.com or <http://www.example.com>.

***

[I'm an inline-style link](https://www.google.com)

[I'm an inline-style link with title](https://www.google.com "Google's Homepage")

[I'm a reference-style link][Arbitrary case-insensitive reference text]

[I'm a relative reference to a repository file](../blob/master/LICENSE)

[You can use numbers for reference-style link definitions][1]

Or leave it empty and use the [link text itself].

Below, you find some text that the reference links can follow, but they will not be rendered in the body.

[arbitrary case-insensitive reference text]: https://www.mozilla.org
[1]: http://wikipedia.org
[link text itself]: http://www.wikipedia.org
`;

/**
* Links
* There are two ways to create links.
*/
@Component({
tag: 'kompendium-example-markdown-links',
shadow: true,
})
export class MarkdownLinksExample {
public render(): HTMLElement {
return <kompendium-markdown text={markdown} />;
}
}
Loading