@sakura-ui/markdown 0.0.9 → 0.0.11-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -0
- package/dist/index.cjs.js +31 -31
- package/dist/index.es.js +142 -162
- package/dist/types/components/Markdown.d.ts.map +1 -1
- package/dist/types/plugins/card.d.ts +1 -1
- package/dist/types/plugins/card.d.ts.map +1 -1
- package/dist/types/plugins/cell.d.ts +1 -1
- package/dist/types/plugins/cell.d.ts.map +1 -1
- package/dist/types/plugins/faq.d.ts +1 -1
- package/dist/types/plugins/faq.d.ts.map +1 -1
- package/dist/types/plugins/grid.d.ts +1 -1
- package/dist/types/plugins/grid.d.ts.map +1 -1
- package/dist/types/plugins/headings.d.ts.map +1 -1
- package/dist/types/plugins/helper.d.ts +2 -2
- package/dist/types/plugins/helper.d.ts.map +1 -1
- package/dist/types/plugins/linkButton.d.ts +1 -1
- package/dist/types/plugins/linkButton.d.ts.map +1 -1
- package/dist/types/plugins/youtube.d.ts +1 -1
- package/dist/types/plugins/youtube.d.ts.map +1 -1
- package/package.json +4 -2
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Sakura UI markdown extension
|
|
2
|
+
Sakura UI markdown extension is a markdown extension library that utilizes the Directive syntax of markdown.
|
|
3
|
+
|
|
4
|
+
For details on markdown directives, please refer to the following page.
|
|
5
|
+
- [remark-directive](https://github.com/remarkjs/remark-directive)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
```
|
|
9
|
+
$ npm install @sakura-ui/markdown
|
|
10
|
+
```
|
|
11
|
+
or
|
|
12
|
+
```
|
|
13
|
+
$ yarn add @sakura-ui/markdown
|
|
14
|
+
```
|
|
15
|
+
or
|
|
16
|
+
```
|
|
17
|
+
$ pnpm add @sakura-ui/markdown
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
When using libraries such as Gatsby or Next.js, please use them in combination with React Suspense.
|
|
22
|
+
```ts
|
|
23
|
+
import React, { lazy, Suspense } from 'react'
|
|
24
|
+
|
|
25
|
+
const Markdown = lazy(() =>
|
|
26
|
+
import('@sakura-ui/markdown').then((module) => ({ default: module.Markdown }))
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
export const MyPage = () => {
|
|
30
|
+
const text = `
|
|
31
|
+
# Page title
|
|
32
|
+
I really like using Markdown.
|
|
33
|
+
|
|
34
|
+
- First item
|
|
35
|
+
- Second item
|
|
36
|
+
- Third item
|
|
37
|
+
`
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div>
|
|
41
|
+
<Suspense fallback={<div />}>
|
|
42
|
+
<Markdown>{text}</Markdown>
|
|
43
|
+
</Suspense>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Syntax
|
|
50
|
+
### LinkButton
|
|
51
|
+
```
|
|
52
|
+
:link-button[Services and applications]{href=/services}
|
|
53
|
+
```
|
|
54
|
+
<img width="288" alt="スクリーンショット 2024-07-26 23 44 39" src="https://github.com/user-attachments/assets/997ccf27-4d83-4fb5-b173-ae94cd7d76cb">
|
|
55
|
+
|
|
56
|
+
### YouTube
|
|
57
|
+
```
|
|
58
|
+
::youtube[title]{id=yXdbvBzxeb8}
|
|
59
|
+
```
|
|
60
|
+
<img width="494" alt="スクリーンショット 2024-07-26 23 48 18" src="https://github.com/user-attachments/assets/a724cf27-a1af-4633-b9a8-27b25b04e3ae">
|
|
61
|
+
|
|
62
|
+
### Multi column layout
|
|
63
|
+
```
|
|
64
|
+
::::grid-cols-3
|
|
65
|
+
:::cell
|
|
66
|
+

|
|
67
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
68
|
+
:::
|
|
69
|
+
:::cell
|
|
70
|
+

|
|
71
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
72
|
+
:::
|
|
73
|
+
:::cell
|
|
74
|
+

|
|
75
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
76
|
+
:::
|
|
77
|
+
::::
|
|
78
|
+
```
|
|
79
|
+
<img width="1143" alt="スクリーンショット 2024-07-26 23 51 46" src="https://github.com/user-attachments/assets/60b813b4-3a8c-451d-99b2-58c1e5b3a3b4">
|
|
80
|
+
|
|
81
|
+
### Multi column layout with card
|
|
82
|
+
```
|
|
83
|
+
::::grid-cols-3
|
|
84
|
+
:::card
|
|
85
|
+
::card-img{alt=alternative_text src=https://dummyimage.com/600x400/000/fff}
|
|
86
|
+
::card-title[Card title]
|
|
87
|
+
::card-description[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]
|
|
88
|
+
:::
|
|
89
|
+
:::card
|
|
90
|
+
::card-img{alt=alternative_text src=https://dummyimage.com/600x400/000/fff}
|
|
91
|
+
::card-title[Card title]
|
|
92
|
+
::card-description[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]
|
|
93
|
+
:::
|
|
94
|
+
:::card
|
|
95
|
+
::card-img{alt=alternative_text src=https://dummyimage.com/600x400/000/fff}
|
|
96
|
+
::card-title[Card title]
|
|
97
|
+
::card-description[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]
|
|
98
|
+
:::
|
|
99
|
+
::::
|
|
100
|
+
```
|
|
101
|
+
<img width="1133" alt="スクリーンショット 2024-07-26 23 55 37" src="https://github.com/user-attachments/assets/9a6dff6f-7115-451a-9d15-f953ddad78b7">
|
|
102
|
+
|
|
103
|
+
### FAQ
|
|
104
|
+
```
|
|
105
|
+
:::faq
|
|
106
|
+
::faq-q[Why you need an FAQ page]
|
|
107
|
+
::faq-a[Here are the benefits of having an FAQ page.]
|
|
108
|
+
::faq-q[Whom to contact?]
|
|
109
|
+
::faq-a[You can contact the apprenticeship office through our official phone hotline above, or with the web-form below. We generally respond to written requests within 7-10 days.]
|
|
110
|
+
:::
|
|
111
|
+
```
|
|
112
|
+
or
|
|
113
|
+
```
|
|
114
|
+
::::faq
|
|
115
|
+
:::faq-q
|
|
116
|
+
Why you need an FAQ page
|
|
117
|
+
:::
|
|
118
|
+
:::faq-a
|
|
119
|
+
Here are the benefits of having an FAQ page.
|
|
120
|
+
:::
|
|
121
|
+
:::faq-q
|
|
122
|
+
Whom to contact?
|
|
123
|
+
:::
|
|
124
|
+
:::faq-a
|
|
125
|
+
You can contact the apprenticeship office through our official phone hotline above, or with the web-form below. We generally respond to written requests within 7-10 days.
|
|
126
|
+
:::
|
|
127
|
+
::::
|
|
128
|
+
```
|
|
129
|
+
<img width="1133" alt="スクリーンショット 2024-07-26 23 59 50" src="https://github.com/user-attachments/assets/0f6b51fb-068e-4173-8011-f782c1b894f6">
|