Skip to content

Commit

Permalink
feat: add GitHub-style alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-ub committed Oct 5, 2024
1 parent 6980d45 commit 1ee3cd0
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
"dependencies": {
"dayjs": "^1.11.13",
"fast-glob": "^3.3.2",
"nprogress": "^0.2.0"
"nprogress": "^0.2.0",
"remark-github-alerts": "0.1.0-beta.3"
},
"devDependencies": {
"@antfu/eslint-config": "^3.3.2",
Expand Down
38 changes: 38 additions & 0 deletions playground/src/content/pages/posts/markdown-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,44 @@ Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptio

Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.

## Alerts

### Syntax

```markdown
> [!NOTE]
> Highlights information that users should take into account, even when skimming.

> [!TIP]
> Optional information to help a user be more successful.

> [!IMPORTANT]
> Crucial information necessary for users to succeed.

> [!WARNING]
> Critical content demanding immediate user attention due to potential risks.

> [!CAUTION]
> Negative potential consequences of an action.
```

### Output

> [!NOTE]
> Highlights information that users should take into account, even when skimming.
> [!TIP]
> Optional information to help a user be more successful.
> [!IMPORTANT]
> Crucial information necessary for users to succeed.
> [!WARNING]
> Critical content demanding immediate user attention due to potential risks.
> [!CAUTION]
> Negative potential consequences of an action.
## Images

### Syntax
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { AstroIntegration } from 'astro'

import remarkGithubAlerts from 'remark-github-alerts'

export default function AntfuMeIntegration(): AstroIntegration {
return {
name: 'astro-vitesse',
Expand All @@ -20,6 +22,7 @@ export default function AntfuMeIntegration(): AstroIntegration {
defaultColor: false,
wrap: true,
},
remarkPlugins: [remarkGithubAlerts],
},
})
},
Expand Down
5 changes: 5 additions & 0 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import BaseHead from '../components/BaseHead.astro'
import Footer from '../components/Footer.astro'
import NavBar from '../components/NavBar.astro'
import '@unocss/reset/tailwind.css'
import 'remark-github-alerts/styles/github-colors-light.css'
import 'remark-github-alerts/styles/github-colors-dark-class.css'
import 'remark-github-alerts/styles/github-base.css'
import '../styles/main.css'
import '../styles/prose.css'
import '../styles/markdown.css'
Expand Down

0 comments on commit 1ee3cd0

Please sign in to comment.