Comments (8)
Thank you for pointing this out. I know what the problem is now. Currently, the user root is the closest folder to cwd
with a package.json
, which may be not the best solution...
I think there are 3 possible resolving modes.
- Closest package root to cwd (Current)
Pros: If slides are managed in a monorepo, this way gives users the maximum flexibility.
Cons: This forces users to use monorepo (with a monorepo tool like PNPM) if there are multi slides in one package. - Closest package root to slides.md
Pros: No need to use a monorepo manager like PNPM, only nested package is required if there are multi slides in one package.
Cons: Packages nested but not a monorepo is very confused. - Directory of slides.md (Before #1308)
Pros: Easy to understand
Cons: In the future maybe we can build multiple slides together, and this is not very suitable for that.
We also need to find the user's package.json
(https://sli.dev/addons/use#use-addon).
@antfu, I am not very sure.
from slidev.
I would prefer to keep the original directory of slides.md approach. Later in the slides.md we could have a
---
rootDir: ..
---
to override that if needed
from slidev.
I think this is caused by #1308. In #1308, we assume that the project root is the closest folder to cwd with a package.json
. To use slidev/slides/public
as the public folder, you can add a package.json
to slidev/slides
.
(Before #1308, the project root (i.e. user root) was where the slides.md
is)
from slidev.
Thank you for your quick reply :) . What should this minimal package.json contain. Does this mean that I'll have to "pollute" my slides directory with node_modules files on the side?
from slidev.
Thank you for your quick reply :) . What should this minimal package.json contain. Does this mean that I'll have to "pollute" my slides directory with node_modules files on the side?
I think { "name": "my-slides", "version": "0.0.0" }
is enough.
from slidev.
Thanks for your help. That was what i first try but it does not seems to work. I have :
slidev
|package.json
|-- node_modules with all slidev dep & themes
`-- slides
|`-- public/images
| style.css
| my-slide.md
| package.json
from slidev.
Could you share how you start Slidev dev server?
from slidev.
I was using :
npx slidev slides/slide.md --remote
but going inside the slide directory and doing :
npx slidev slide.md --remote
seems to work. I am not sure why. The only downside is that i have to have a package.json in my slide directory :)
For the context, i am trying to have all slidev env in a docker env : https://github.com/Ynn/slides.tools . Contrary to what tangramor /slidev_docker
is doing i setup all the dependencies and modules inside the docker image to avoid having node_modules in my slides directory. I want to have something static as i don't want any surprise when editing or playing my slides.
I will try that and mark as fix if it works well. Would it be possible to have an option to change the root from the cli ? This way a package.json wouldn't be needed.
from slidev.
Related Issues (20)
- Static relative folder host no longer working HOT 4
- Universal Magic Move HOT 2
- Cannot export mermaid figures into pdf HOT 1
- `magic-move` Scrolling of code not possible when box small HOT 2
- Slides are not loaded properly in presenter mode HOT 2
- Animation on homepage of sli.dev errors HOT 2
- KaTeX fonts are not rendered by Vite (not in Vite `server.fs.allow[]`)
- Mustache Syntax is always interpreted HOT 2
- `.pdf` websites embedded with `layout: iframe` are unstable in Safari HOT 2
- White margin in exported pdf when in full view mode.
- Shiki Magic Move crashes after HMR with not LF files HOT 1
- Feat: Add some hooks of presentation slides lifetime
- Link Attributes,Please don't add `tartget="_blank"` always. HOT 1
- Keep slide show tab alive—Safari locks it in incognito mode
- Built results misses some unocss styles. HOT 3
- docs: howto include icons when publishing HOT 3
- Feat: v-switch HOT 2
- Running slidev with pnpm 9 fails HOT 2
- Make a bether documentation to usage of icons HOT 3
- font color wrong in light mode for "adjust setting" menu dropdown
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slidev.