Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add svelte demo for cherry-markdown #865

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions examples/cherry-markdown-svelte-demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
8 changes: 8 additions & 0 deletions examples/cherry-markdown-svelte-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 介绍
这是cherry-markdown的svelte示例

# 开始
```
npm install
npm run dev
```
15 changes: 15 additions & 0 deletions examples/cherry-markdown-svelte-demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cherry Svelte Demo</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>


32 changes: 32 additions & 0 deletions examples/cherry-markdown-svelte-demo/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compilerOptions": {
"moduleResolution": "bundler",
"target": "ESNext",
"module": "ESNext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"verbatimModuleSyntax": true,
"isolatedModules": true,
"resolveJsonModule": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}
19 changes: 19 additions & 0 deletions examples/cherry-markdown-svelte-demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "cherry-markdown-svelte-demo",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"svelte": "^4.2.18",
"vite": "^5.3.4"
},
"dependencies": {
"cherry-markdown": "^0.8.45"
}
}
Binary file not shown.
1 change: 1 addition & 0 deletions examples/cherry-markdown-svelte-demo/public/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions examples/cherry-markdown-svelte-demo/src/App.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script>
import NavBar from "./components/NavBar.svelte";
import NavMenu from "./components/NavMenu.svelte";
import Content from "./components/Content.svelte";
</script>

<main>
<div>
<NavBar/>
<div class="container">
<NavMenu/>
<Content/>
</div>
</div>
</main>

<style>
.container {
max-width: 1241px;
display: flex;
flex-direction: row;
}
</style>

6 changes: 6 additions & 0 deletions examples/cherry-markdown-svelte-demo/src/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:root {
font-size: 18px;
font-family: 'Segoe UI';
}


Loading