Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed May 22, 2024
1 parent 2547cf7 commit a31a0c9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
9 changes: 9 additions & 0 deletions docs/src/app/(doc-session)/documentation/js/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import DrawerComponent from "@/components/Drawer";
import {
Cdns,
Installation,
UsageCDNExample,
UsageExample,
} from "./subComponents/MainPageSyntexHightlighter";

Expand Down Expand Up @@ -145,6 +146,14 @@ export default function DocumentationPageJs() {
<Cdns />
</div>

<h2 className="mb-2 mt-4 text-lg font-medium">
Example of use with CDN
</h2>

<div className="mb-8">
<UsageCDNExample />
</div>

<h2 className="text-lg font-medium">Installation</h2>

<Installation />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ import { FUNCTION_NAME } from 'multiform-validator';
);
}

export function UsageCDNExample() {
return (
<SyntaxHighlighter language="html" style={a11yDark}>
{`<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.0.6/dist/bundle.min.js"></script>
<script>
const emailResult = isEmail('123456');
const cpfResult = cpfIsValid('123456');
console.log(emailResult); // returns false
console.log(cpfResult.isValid); // returns false
</script>`}
</SyntaxHighlighter>
);
}

export function Cdns() {
return (
<>
Expand All @@ -61,7 +77,7 @@ export function Cdns() {
https://cdn.jsdelivr.net/npm/multiform-validator@2.0.6/dist/bundle.min.js
</SyntaxHighlighter>
<SyntaxHighlighter language="html" style={a11yDark}>
{`<scritp src="https://cdn.jsdelivr.net/npm/multiform-validator@2.0.6/dist/bundle.min.js"></script>`}
{`<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.0.6/dist/bundle.min.js"></script>`}
</SyntaxHighlighter>
</div>
<div className="mb-4">
Expand All @@ -70,7 +86,7 @@ export function Cdns() {
https://unpkg.com/multiform-validator@2.0.6/dist/bundle.js
</SyntaxHighlighter>
<SyntaxHighlighter language="html" style={a11yDark}>
{`<scritp src="https://unpkg.com/multiform-validator@2.0.6/dist/bundle.js"></script>`}
{`<script src="https://unpkg.com/multiform-validator@2.0.6/dist/bundle.js"></script>`}
</SyntaxHighlighter>
</div>
</>
Expand Down
4 changes: 3 additions & 1 deletion packages/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,18 @@ https://unpkg.com/multiform-validator@2.0.6/dist/bundle.js
<script src="https://unpkg.com/multiform-validator@2.0.6/dist/bundle.js"></script>
```

## Example of use with CDN
### Example of use with CDN

```html
<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.0.6/dist/bundle.min.js"></script>
<script>
const emailResult = isEmail('123456');
const cpfResult = cpfIsValid('123456');
console.log(emailResult); // returns false
console.log(cpfResult.isValid); // returns false
</script>
```

Expand Down

0 comments on commit a31a0c9

Please sign in to comment.