@@ -35,156 +35,7 @@ npm install
35353 . Navigate to and select the ` static/ ` folder in your repository
36364 . Start creating your canvas!
3737
38- ### 4. Start Development Server
38+ ### 4. Github - deployment
3939
40- ``` bash
41- # Start the dev server
42- npm run dev
43-
44- # Or open in browser automatically
45- npm run dev -- --open
46- ```
47-
48- Visit ` http://localhost:5173 ` to see your canvas in action.
49-
50- ## Creating Your Canvas
51-
52- ### In Obsidian
53-
54- 1 . In your Obsidian vault (the ` static/ ` folder), create markdown files for your content
55- 2 . Create a ` .canvas ` file (File → New Canvas)
56- 3 . Add your markdown files as nodes by dragging them onto the canvas
57- 4 . Connect nodes with edges to show relationships
58- 5 . Save your work
59-
60- ### Main Canvas File
61-
62- The viewer looks for ` static/main.canvas ` by default. Make sure your main canvas file is named ` main.canvas ` .
63-
64- ## Deploying to GitHub Pages
65-
66- Deployment happens automatically via GitHub Actions whenever you push to the ` main ` branch.
67-
68- ### First-Time Setup
69-
70- 1 . Go to your repository settings
71- 2 . Navigate to ** Pages** (under "Code and automation")
72- 3 . Under "Build and deployment", set:
73- - ** Source** : GitHub Actions
74- 4 . Push your changes and the workflow will deploy automatically
75-
76- Your site will be available at:
77- ```
78- https://YOUR-USERNAME.github.io/YOUR-REPO-NAME/
79- ```
80-
81- For organization repos:
82- ```
83- https://YOUR-ORG-NAME.github.io/YOUR-REPO-NAME/
84- ```
85-
86- ### Manual Deployment
87-
88- If you need to trigger a deployment manually:
89-
90- ``` bash
91- git commit --allow-empty -m " Trigger deployment"
92- git push
93- ```
94-
95- ## Customizing
96-
97- ### Repository Name
98-
99- If you change your repository name, update the ` base ` path in ` svelte.config.js ` :
100-
101- ``` javascript
102- paths: {
103- base: process .env .NODE_ENV === ' production' ? ' /YOUR-NEW-REPO-NAME' : ' '
104- }
105- ```
106-
107- ### Canvas Styling
108-
109- Edit ` src/lib/canvas.css ` to customize colors, fonts, and styling. The CSS variables at the top of the file control the theme:
110-
111- ``` css
112- :root {
113- --color-bg-1 : #fff ;
114- --color-bg-2 : #fafafa ;
115- --color-tx-1 : #3F062D ;
116- --color-ui-3 : #5E0641 ;
117- /* ... */
118- }
119- ```
120-
121- ### Adding More Canvas Files
122-
123- Currently, the viewer loads ` main.canvas ` . To support multiple canvas files, you can modify ` src/routes/+page.svelte ` to accept a query parameter or create additional routes.
124-
125- ## Workflow
126-
127- 1 . ** Edit in Obsidian** - Open the ` static/ ` folder as a vault and work on your canvas
128- 2 . ** Preview Locally** - Run ` npm run dev ` to see your changes in real-time
129- 3 . ** Commit Changes** - ` git add . && git commit -m "Update canvas" `
130- 4 . ** Push to GitHub** - ` git push origin main `
131- 5 . ** Auto-Deploy** - GitHub Actions builds and deploys your site automatically
132-
133- ## Project Structure
134-
135- ```
136- jsoncanvas-kit/
137- ├── static/ # Obsidian vault (your canvas and markdown files)
138- │ ├── main.canvas # Main canvas file
139- │ ├── welcome.md # Example markdown files
140- │ ├── getting-started.md
141- │ ├── canvas.js # Canvas interaction scripts
142- │ └── prism.js # Syntax highlighting
143- ├── src/
144- │ ├── routes/
145- │ │ └── +page.svelte # Main viewer component
146- │ └── lib/
147- │ └── canvas.css # Canvas styling
148- ├── .github/
149- │ └── workflows/
150- │ └── deploy.yml # GitHub Actions deployment
151- └── svelte.config.js # SvelteKit configuration
152- ```
153-
154- ## Troubleshooting
155-
156- ### Canvas not loading
157-
158- - Ensure your main canvas file is named ` main.canvas ` and located in the ` static/ ` folder
159- - Check that file paths in your canvas don't include the ` static/ ` prefix (just use ` filename.md ` )
160-
161- ### Styles not appearing
162-
163- - Make sure ` src/lib/canvas.css ` is being imported in ` +page.svelte `
164- - Clear your browser cache and hard reload (Cmd/Ctrl + Shift + R)
165-
166- ### Deployment failing
167-
168- - Check the Actions tab in your GitHub repository for error logs
169- - Ensure GitHub Pages is enabled and set to use GitHub Actions as the source
170-
171- ## Technical Details
172-
173- - ** Framework** : SvelteKit with adapter-static
174- - ** Markdown Rendering** : svelte-exmarkdown with GFM plugin
175- - ** Canvas Format** : JSON Canvas spec v1.0
176- - ** Deployment** : GitHub Actions + GitHub Pages
177-
178- ## Contributing
179-
180- Feel free to open issues or submit pull requests to improve this template!
181-
182- ## License
183-
184- MIT
185-
186- ## Resources
187-
188- - [ JSON Canvas Specification] ( https://jsoncanvas.org/ )
189- - [ Obsidian] ( https://obsidian.md/ )
190- - [ SvelteKit Documentation] ( https://svelte.dev/docs/kit )
40+ 1 . Click on ` Settings/Pages `
41+ 2 . Make sure it is using Github action for deployment.
0 commit comments