Skip to content

Commit

Permalink
fix: toggle markdown css
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Dec 29, 2024
1 parent f1681f2 commit 7947b6f
Show file tree
Hide file tree
Showing 12 changed files with 1,688 additions and 1,611 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
![npm bundle size (minified)](https://img.shields.io/bundlephobia/min/star-markdown-css.svg)
[![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hm/star-markdown-css)](https://cdn.jsdelivr.net/npm/star-markdown-css/dist/yun/yun-markdown.min.css)

- [Demo](https://smc.yunyoujun.cn)
- [Demo](https://yunyoujun.github.io/star-markdown-css/)

## Theme

Expand Down
1 change: 1 addition & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public/css
16 changes: 8 additions & 8 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
"lint": "eslint \"**/*.{vue,ts,js}\""
},
"dependencies": {
"@vueuse/core": "^11.1.0",
"vue": "^3.5.12"
"@vueuse/core": "^12.2.0",
"vue": "^3.5.13"
},
"devDependencies": {
"@iconify-json/ri": "^1.2.2",
"@shikijs/markdown-it": "^1.22.0",
"@vitejs/plugin-vue": "^5.1.4",
"@iconify-json/ri": "^1.2.5",
"@shikijs/markdown-it": "^1.24.4",
"@vitejs/plugin-vue": "^5.2.1",
"@vueuse/head": "^2.0.0",
"markdown-it-link-attributes": "^4.0.1",
"markdown-it-prism": "^2.3.0",
"markdown-it-task-lists": "^2.1.1",
"unocss": "^0.63.6",
"unplugin-vue-markdown": "^0.26.2",
"vite": "^5.4.10"
"unocss": "^0.65.3",
"unplugin-vue-markdown": "^0.28.0",
"vite": "^6.0.6"
}
}
1 change: 0 additions & 1 deletion demo/public/CNAME

This file was deleted.

7 changes: 5 additions & 2 deletions demo/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ useHead({
meta: [
{ name: 'description', content: 'Star Markdown CSS Demo' },
],
link: [
{ rel: 'stylesheet', href: './css/yun/markdown.min.css', title: 'theme' },
]

Check failure on line 18 in demo/src/App.vue

View workflow job for this annotation

GitHub Actions / lint

Missing trailing comma
})
window.onhashchange = function () {
window.onhashchange = () => {
const curTheme = location.hash.slice(1) || 'yun'
const el = document.querySelector('link[title="theme"]') as HTMLLinkElement
el.href = `./css/${curTheme}-markdown.min.css`
el.href = `./css/${curTheme}/markdown.min.css`
}
</script>

Expand Down
4 changes: 4 additions & 0 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import Unocss from 'unocss/vite'
import Markdown from 'unplugin-vue-markdown/vite'

import { defineConfig } from 'vite'
import repoPkg from '../package.json'

const markdownWrapperClasses = 'markdown-body'

export default defineConfig({
// for GitHub Pages
base: `/${repoPkg.name}/`,

css: {
preprocessorOptions: {
scss: {
Expand Down
29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "star-markdown-css",
"type": "module",
"version": "0.5.3",
"packageManager": "pnpm@9.12.2",
"packageManager": "pnpm@9.15.2",
"description": "Markdown Css about starry.",
"author": "YunYouJun <[email protected]>",
"license": "MIT",
"homepage": "https://smc.yunyoujun.cn",
"homepage": "https://yunyoujun.github.io/star-markdown-css/",
"repository": "https://github.com/YunYouJun/star-markdown-css.git",
"keywords": [
"browser",
Expand Down Expand Up @@ -35,25 +35,24 @@
"typecheck": "vue-tsc --noEmit"
},
"devDependencies": {
"@antfu/eslint-config": "^3.8.0",
"@antfu/eslint-config": "^3.12.1",
"@types/clean-css": "^4.2.11",
"@types/fs-extra": "^11.0.4",
"@types/markdown-it-link-attributes": "^3.0.5",
"@types/node": "^22.7.9",
"@types/sass": "^1.45.0",
"@unocss/eslint-plugin": "^0.63.6",
"@types/node": "^22.10.2",
"@unocss/eslint-plugin": "^0.65.3",
"@yunyoujun/logger": "^0.3.5",
"bumpp": "^9.7.1",
"bumpp": "^9.9.2",
"clean-css": "^5.3.3",
"consola": "^3.2.3",
"eslint": "^9.13.0",
"eslint-plugin-format": "^0.1.2",
"consola": "^3.3.3",
"eslint": "^9.17.0",
"eslint-plugin-format": "^0.1.3",
"fs-extra": "^11.2.0",
"gzip-size": "^7.0.0",
"sass": "^1.80.4",
"tsx": "^4.19.1",
"typescript": "^5.6.3",
"unbuild": "^2.0.0",
"vue-tsc": "^2.1.6"
"sass": "^1.83.0",
"tsx": "^4.19.2",
"typescript": "^5.7.2",
"unbuild": "^3.2.0",
"vue-tsc": "^2.2.0"
}
}
Loading

0 comments on commit 7947b6f

Please sign in to comment.