Skip to content

Commit 008fd4e

Browse files
authored
Merge pull request #4 from rishichawda/update-docs
update docusaurus pages
2 parents 6fc0922 + fd21138 commit 008fd4e

File tree

7 files changed

+55
-55
lines changed

7 files changed

+55
-55
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches: [main]
66
paths:
77
- 'docs/**'
8+
- 'lib/**'
9+
- 'index.ts'
10+
- 'styles.css'
11+
- 'package.json'
812
- 'README.md'
913
- '.github/workflows/deploy-docs.yml'
1014

@@ -39,21 +43,15 @@ jobs:
3943
- name: Setup Pages
4044
uses: actions/configure-pages@v4
4145

42-
- name: Install Dependencies
43-
run: |
44-
cd docs
45-
yarn install --frozen-lockfile
46-
47-
# Import plugin into the docs to showcase examples
48-
- name: Build Plugin
46+
- name: Install Root Dependencies & Build Plugin
4947
run: |
5048
yarn install --frozen-lockfile
5149
yarn build
5250
53-
- name: Copy Plugin to Docs
51+
- name: Install Docs Dependencies
5452
run: |
55-
mkdir -p docs/node_modules/remark-notes-plugin/dist
56-
cp -r dist/* docs/node_modules/remark-notes-plugin/dist/
53+
cd docs
54+
yarn install --frozen-lockfile
5755
5856
- name: Build Documentation Site
5957
run: |

docs/docs/examples/note-types.mdx

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ sidebar_position: 1
1010

1111
Used for providing general information or notes to the reader.
1212

13-
<div class="remark-note note"><div class="remark-note-header"><span class="remark-note-icon" data-type="note"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.048"></g><g><path d="M8 2V5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"></path><path d="M16 2V5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"></path><path d="M21 8.5V17C21 20 19.5 22 16 22H8C4.5 22 3 20 3 17V8.5C3 5.5 4.5 3.5 8 3.5H16C19.5 3.5 21 5.5 21 8.5Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"></path><path d="M8 11H16" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"></path><path d="M8 16H12" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"></path></g></svg></span><span class="remark-note-title">note</span></div><div class="remark-note-content"><p>This is a standard note that provides additional information to the reader.</p></div></div>
13+
> [!note]
14+
> This is a standard note that provides additional information to the reader.
1415
1516
**Markdown Syntax**:
1617
```markdown
@@ -22,7 +23,8 @@ Used for providing general information or notes to the reader.
2223

2324
Used for providing helpful tips and advice.
2425

25-
<div class="remark-note tip"><div class="remark-note-header"><span class="remark-note-icon" data-type="tip"><svg viewBox="-0.5 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-linecap="round" stroke-linejoin="round"></g><g><path d="M19.0006 9.03002C19.0007 8.10058 18.8158 7.18037 18.4565 6.32317C18.0972 5.46598 17.5709 4.68895 16.9081 4.03734C16.2453 3.38574 15.4594 2.87265 14.5962 2.52801C13.7331 2.18336 12.8099 2.01409 11.8806 2.03002C10.0966 2.08307 8.39798 2.80604 7.12302 4.05504C5.84807 5.30405 5.0903 6.98746 5.00059 8.77001C4.95795 9.9595 5.21931 11.1402 5.75999 12.2006C6.30067 13.2609 7.10281 14.1659 8.09058 14.83C8.36897 15.011 8.59791 15.2584 8.75678 15.5499C8.91565 15.8415 8.99945 16.168 9.00059 16.5V18.03H15.0006V16.5C15.0006 16.1689 15.0829 15.843 15.24 15.5515C15.3971 15.26 15.6241 15.0121 15.9006 14.83C16.8528 14.1911 17.6336 13.328 18.1741 12.3167C18.7147 11.3054 18.9985 10.1767 19.0006 9.03002Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15 21.04C14.1345 21.6891 13.0819 22.04 12 22.04C10.9181 22.04 9.86548 21.6891 9 21.04" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.9901 5.64001L10.3301 8.41998C10.2549 8.54184 10.2138 8.68167 10.2111 8.82483C10.2084 8.96799 10.2441 9.10925 10.3146 9.23389C10.3851 9.35852 10.4877 9.46195 10.6118 9.53339C10.7359 9.60482 10.8769 9.64165 11.0201 9.64001H13.0201C13.1617 9.63947 13.301 9.67657 13.4237 9.7475C13.5463 9.81843 13.6479 9.92063 13.7181 10.0437C13.7883 10.1668 13.8245 10.3063 13.8231 10.4479C13.8217 10.5896 13.7827 10.7283 13.7101 10.85L12.0301 13.64" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></g></svg></span><span class="remark-note-title">tip</span></div><div class="remark-note-content"><p>Here's a helpful tip that can improve your workflow or code quality.</p></div></div>
26+
> [!tip]
27+
> Here's a helpful tip that can improve your workflow or code quality.
2628
2729
**Markdown Syntax**:
2830
```markdown
@@ -34,7 +36,8 @@ Used for providing helpful tips and advice.
3436

3537
Used for highlighting critical information that requires special attention.
3638

37-
<div class="remark-note important"><div class="remark-note-header"><span class="remark-note-icon" data-type="important"><svg viewBox="0 0 18 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><g stroke-width="0"></g><g stroke-linecap="round" stroke-linejoin="round"></g><g><path d="M9,14a1.5,1.5,0,1,1,1.5068-1.5A1.5035,1.5035,0,0,1,9,14Z" fill="currentColor"></path><path d="M9,2A7,7,0,1,1,2,9,7.0079,7.0079,0,0,1,9,2M9,0a9,9,0,1,0,9,9A9,9,0,0,0,9,0Z" fill="currentColor"></path><path d="M10,4H8a1,1,0,0,0-.97,1.2425l1,4a1,1,0,0,0,1.94,0l1-4A1,1,0,0,0,10,4Zm0,2h0Z" fill="currentColor"></path></g></svg></span><span class="remark-note-title">important</span></div><div class="remark-note-content"> <p>This information is crucial and requires your attention to avoid issues or errors.</p></div></div>
39+
> [!important]
40+
> This information is crucial and requires your attention to avoid issues or errors.
3841
3942
**Markdown Syntax**:
4043
```markdown
@@ -46,7 +49,8 @@ Used for highlighting critical information that requires special attention.
4649

4750
Used for styling quotations in a distinctive way.
4851

49-
<div class="quote remark-note"><div class="remark-note-header"><span class="remark-note-icon" data-type="quote"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-linecap="round" stroke-linejoin="round"></g><g><path d="M14 15V14C14 13.0681 14 12.6022 14.1522 12.2346C14.3552 11.7446 14.7446 11.3552 15.2346 11.1522C15.6022 11 16.0681 11 17 11H17.5C18.9045 11 19.6067 11 20.1111 11.3371C20.3295 11.483 20.517 11.6705 20.6629 11.8889C21 12.3933 21 13.0955 21 14.5V15.3431C21 16.1606 21 16.5694 20.8478 16.9369C20.6955 17.3045 20.4065 17.5935 19.8284 18.1716L19.2396 18.7604C18.7822 19.2178 18 18.8938 18 18.2469V17.8787C18 17.3934 17.6066 17 17.1213 17H16C14.8954 17 14 16.1046 14 15Z" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 9V8C3 7.06812 3 6.60218 3.15224 6.23463C3.35523 5.74458 3.74458 5.35523 4.23463 5.15224C4.60218 5 5.06812 5 6 5H6.5C7.90446 5 8.60669 5 9.11114 5.33706C9.32952 5.48298 9.51702 5.67048 9.66294 5.88886C10 6.39331 10 7.09554 10 8.5V9.34315C10 10.1606 10 10.5694 9.84776 10.9369C9.69552 11.3045 9.40649 11.5935 8.82843 12.1716L8.23965 12.7604C7.78219 13.2178 7 12.8938 7 12.2469V11.8787C7 11.3934 6.6066 11 6.12132 11H5C3.89543 11 3 10.1046 3 9Z" stroke-linejoin="round" stroke-width="1.5"></path></g></svg></span><span class="remark-note-title">quote</span></div><div class="remark-note-content"><p>"The best way to predict the future is to invent it." — Alan Kay</p></div></div>
52+
> [!quote]
53+
> "The best way to predict the future is to invent it." — Alan Kay
5054
5155
**Markdown Syntax**:
5256
```markdown
@@ -58,7 +62,8 @@ Used for styling quotations in a distinctive way.
5862

5963
Used for providing additional, nice-to-have information or features.
6064

61-
<div class="remark-note bonus"><div class="remark-note-header"><span class="remark-note-icon" data-type="bonus"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-linecap="round" stroke-linejoin="round"></g><g><path d="M9.23163 8.61762C7.26389 9.06284 6.28001 9.28545 6.04594 10.0382C5.81186 10.7909 6.4826 11.5753 7.82408 13.1439L8.17113 13.5498C8.55234 13.9955 8.74294 14.2184 8.82869 14.4942C8.91444 14.7699 8.88562 15.0673 8.82799 15.662L8.77552 16.2035C8.5727 18.2965 8.4713 19.343 9.08412 19.8082C9.69694 20.2734 10.6181 19.8492 12.4605 19.0009L12.9372 18.7815C13.4607 18.5404 13.7225 18.4199 14 18.4199C14.2775 18.4199 14.5393 18.5404 15.0628 18.7815L15.5395 19.0009C17.3819 19.8492 18.3031 20.2734 18.9159 19.8082C19.5287 19.343 19.4273 18.2965 19.2245 16.2035M20.1759 13.1439C21.5174 11.5753 22.1881 10.7909 21.9541 10.0382C21.72 9.28545 20.7361 9.06284 18.7684 8.61762L18.2593 8.50244C17.7001 8.37592 17.4205 8.31266 17.196 8.14225C16.9716 7.97183 16.8276 7.71355 16.5396 7.19699L16.2775 6.7267C15.2641 4.9089 14.7575 4 14 4C13.2425 4 12.7359 4.9089 11.7225 6.7267" stroke-width="1.5" stroke-linecap="round"></path><path d="M2.08887 16C3.20445 15.121 4.68639 14.7971 6.08887 15.1257" stroke-width="1.5" stroke-linecap="round"></path><path d="M2.08887 10.5C3.08887 10 3.37862 10.0605 4.08887 10" stroke-width="1.5" stroke-linecap="round"></path><path d="M2 5.60867L2.20816 5.48676C4.41383 4.19506 6.75032 3.84687 8.95304 4.48161L9.16092 4.54152" stroke-width="1.5" stroke-linecap="round"></path></g></svg></span><span class="remark-note-title">bonus</span></div><div class="remark-note-content"><p>Here's an advanced technique that can further enhance your implementation.</p></div></div>
65+
> [!bonus]
66+
> Here's an advanced technique that can further enhance your implementation.
6267
6368
**Markdown Syntax**:
6469
```markdown
@@ -70,12 +75,21 @@ Used for providing additional, nice-to-have information or features.
7075

7176
Notes can contain multiple paragraphs and other markdown elements like lists and code blocks.
7277

73-
<div class="remark-note note"><div class="remark-note-header"><span class="remark-note-icon" data-type="note"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.048"></g><g><path d="M8 2V5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"></path><path d="M16 2V5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"></path><path d="M21 8.5V17C21 20 19.5 22 16 22H8C4.5 22 3 20 3 17V8.5C3 5.5 4.5 3.5 8 3.5H16C19.5 3.5 21 5.5 21 8.5Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"></path><path d="M8 11H16" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"></path><path d="M8 16H12" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"></path></g></svg></span><span class="remark-note-title">note</span></div><div class="remark-note-content"><p>This note has multiple paragraphs.</p><p>You can include:</p><ul><li>Lists</li><li>And other markdown elements</li></ul><pre><code>// Even code blocks
74-
console.log('Hello world');</code></pre></div></div>
78+
> [!note]
79+
> This note has multiple paragraphs.
80+
>
81+
> You can include:
82+
> - Lists
83+
> - And other markdown elements
84+
>
85+
> ```js
86+
> // Even code blocks
87+
> console.log('Hello world');
88+
> ```
7589
7690
**Markdown Syntax**:
7791
```markdown
78-
> [!notes]
92+
> [!note]
7993
> This note has multiple paragraphs.
8094
>
8195
> You can include:

docs/docusaurus.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {themes as prismThemes} from 'prism-react-renderer';
22
import type {Config} from '@docusaurus/types';
33
import type * as Preset from '@docusaurus/preset-classic';
4+
import remarkNotes from 'remark-notes-plugin';
45

56
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
67

@@ -41,6 +42,8 @@ const config: Config = {
4142
// Remove this to remove the "edit this page" links.
4243
editUrl:
4344
'https://github.com/rishichawda/remark-notes-plugin/tree/main/docs',
45+
// Add remark plugin to process notes
46+
remarkPlugins: [remarkNotes],
4447
},
4548
blog: false, // We don't need a blog for this project
4649
theme: {

docs/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"private": true,
55
"scripts": {
66
"docusaurus": "docusaurus",
7+
"prebuild": "cd .. && yarn build",
8+
"prestart": "cd .. && yarn build",
79
"start": "docusaurus start",
810
"build": "docusaurus build",
911
"swizzle": "docusaurus swizzle",
@@ -22,7 +24,7 @@
2224
"prism-react-renderer": "^2.3.0",
2325
"react": "^19.0.0",
2426
"react-dom": "^19.0.0",
25-
"remark-notes-plugin": "^1.0.2"
27+
"remark-notes-plugin": "file:.."
2628
},
2729
"devDependencies": {
2830
"@docusaurus/module-type-aliases": "3.7.0",

docs/src/css/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* work well for content-centric websites.
55
*/
66

7+
/* Import remark-notes-plugin styles */
8+
@import 'remark-notes-plugin/styles.css';
9+
710
/* You can override the default Infima variables here. */
811
:root {
912
--ifm-color-primary: #25c2a0;

docs/src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import GitHubRepo from '@site/src/components/GitHubRepo';
88
import Heading from '@theme/Heading';
99

1010
import styles from './index.module.css';
11-
import 'remark-notes-plugin/dist/styles.css';
11+
import 'remark-notes-plugin/styles.css';
1212

1313
// Import the SVG logo
1414
import Logo from '@site/static/img/logo.svg';

docs/yarn.lock

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4699,23 +4699,6 @@ hast-util-to-estree@^3.0.0:
46994699
unist-util-position "^5.0.0"
47004700
zwitch "^2.0.0"
47014701

4702-
hast-util-to-html@^9.0.5:
4703-
version "9.0.5"
4704-
resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz#ccc673a55bb8e85775b08ac28380f72d47167005"
4705-
integrity sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==
4706-
dependencies:
4707-
"@types/hast" "^3.0.0"
4708-
"@types/unist" "^3.0.0"
4709-
ccount "^2.0.0"
4710-
comma-separated-tokens "^2.0.0"
4711-
hast-util-whitespace "^3.0.0"
4712-
html-void-elements "^3.0.0"
4713-
mdast-util-to-hast "^13.0.0"
4714-
property-information "^7.0.0"
4715-
space-separated-tokens "^2.0.0"
4716-
stringify-entities "^4.0.0"
4717-
zwitch "^2.0.4"
4718-
47194702
hast-util-to-jsx-runtime@^2.0.0:
47204703
version "2.3.6"
47214704
resolved "https://registry.yarnpkg.com/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz#ff31897aae59f62232e21594eac7ef6b63333e98"
@@ -4757,6 +4740,11 @@ hast-util-whitespace@^3.0.0:
47574740
dependencies:
47584741
"@types/hast" "^3.0.0"
47594742

4743+
hast@^1.0.0:
4744+
version "1.0.0"
4745+
resolved "https://registry.yarnpkg.com/hast/-/hast-1.0.0.tgz#50615e6b2b0583e5608bc76c47029722f1e00607"
4746+
integrity sha512-vFUqlRV5C+xqP76Wwq2SrM0kipnmpxJm7OfvVXpB35Fp+Fn4MV+ozr+JZr5qFvyR1q/U+Foim2x+3P+x9S1PLA==
4747+
47604748
hastscript@^9.0.0:
47614749
version "9.0.1"
47624750
resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-9.0.1.tgz#dbc84bef6051d40084342c229c451cd9dc567dff"
@@ -5696,7 +5684,7 @@ mdast-util-phrasing@^4.0.0:
56965684
"@types/mdast" "^4.0.0"
56975685
unist-util-is "^6.0.0"
56985686

5699-
mdast-util-to-hast@^13.0.0, mdast-util-to-hast@^13.2.0:
5687+
mdast-util-to-hast@^13.0.0:
57005688
version "13.2.0"
57015689
resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz#5ca58e5b921cc0a3ded1bc02eed79a4fe4fe41f4"
57025690
integrity sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==
@@ -7738,16 +7726,13 @@ remark-mdx@^3.0.0:
77387726
mdast-util-mdx "^3.0.0"
77397727
micromark-extension-mdxjs "^3.0.0"
77407728

7741-
remark-notes-plugin@^1.0.2:
7729+
"remark-notes-plugin@file:..":
77427730
version "1.0.2"
7743-
resolved "https://registry.yarnpkg.com/remark-notes-plugin/-/remark-notes-plugin-1.0.2.tgz#3d33d5eded1223be2badf69d363c04c5187a7f07"
7744-
integrity sha512-svtGFefVfLT221KK7nD9nOJlunOM/ghHmE/mEANZEs8759UbKLz/nu1kFPLMUHxEMmJhWhmhADuq4tMISxWt6A==
77457731
dependencies:
7746-
hast-util-to-html "^9.0.5"
7732+
hast "^1.0.0"
77477733
mdast "^3.0.0"
7748-
mdast-util-to-hast "^13.2.0"
7749-
remark "^15.0.1"
77507734
unified "^11.0.4"
7735+
unist "^0.0.1"
77517736
unist-util-visit "^5.0.0"
77527737

77537738
remark-parse@^11.0.0:
@@ -7780,16 +7765,6 @@ remark-stringify@^11.0.0:
77807765
mdast-util-to-markdown "^2.0.0"
77817766
unified "^11.0.0"
77827767

7783-
remark@^15.0.1:
7784-
version "15.0.1"
7785-
resolved "https://registry.yarnpkg.com/remark/-/remark-15.0.1.tgz#ac7e7563260513b66426bc47f850e7aa5862c37c"
7786-
integrity sha512-Eht5w30ruCXgFmxVUSlNWQ9iiimq07URKeFS3hNc8cUWy1llX4KDWfyEDZRycMc+znsN9Ux5/tJ/BFdgdOwA3A==
7787-
dependencies:
7788-
"@types/mdast" "^4.0.0"
7789-
remark-parse "^11.0.0"
7790-
remark-stringify "^11.0.0"
7791-
unified "^11.0.0"
7792-
77937768
renderkid@^3.0.0:
77947769
version "3.0.0"
77957770
resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a"
@@ -8641,6 +8616,11 @@ unist-util-visit@^5.0.0:
86418616
unist-util-is "^6.0.0"
86428617
unist-util-visit-parents "^6.0.0"
86438618

8619+
unist@^0.0.1:
8620+
version "0.0.1"
8621+
resolved "https://registry.yarnpkg.com/unist/-/unist-0.0.1.tgz#360b99428d032d37724c467e186247c44a1429b1"
8622+
integrity sha512-bnzuF8b6d47WubA4a5yLqFbuZz/v/NS6eRwUIdOaDmsqzwTlyv8yS1g3M7ISdtBQrigPD3qKK87Cu7zhEfCF3A==
8623+
86448624
universalify@^2.0.0:
86458625
version "2.0.1"
86468626
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d"
@@ -9020,7 +9000,7 @@ yocto-queue@^1.0.0:
90209000
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.2.1.tgz#36d7c4739f775b3cbc28e6136e21aa057adec418"
90219001
integrity sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==
90229002

9023-
zwitch@^2.0.0, zwitch@^2.0.4:
9003+
zwitch@^2.0.0:
90249004
version "2.0.4"
90259005
resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7"
90269006
integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==

0 commit comments

Comments
 (0)