srcbookdev / srcbook

TypeScript notebook for rapid prototyping
https://srcbook.com
Apache License 2.0
2.06k stars 57 forks source link

Unable to set Base Directory #187

Open jirpok opened 1 month ago

jirpok commented 1 month ago

Hey,

Setting a base dir does not seem to work (recent Firefox, macOS and Linux). I don't see any errors.

matsko commented 1 month ago

Can this be configured as a flag when running srcbook? That way this can be integrated into monorepos.

nichochar commented 1 month ago

I think it might be working, but not doing what you're expecting. The baseDirectory is the directory we default to when importing srcbooks (clicking "open" on the home page) and is the default relative page when you click "export".

Others have thought that the baseDir is the ~/.srcbook dir we use for the internal application, but that currently cannot be changed.

What @matsko is asking for is something we want to build, "open srcbook within this directory", but isn't done yet. It might deserve its own GitHub issue.

matsko commented 1 month ago

Anything new here by chance?

Lokendra-sinh commented 1 week ago

@matsko i'd really appreciate if you could elaborate more on the issue...probably current behaviour, expected behaviour, and what you finally want to achieve?

matsko commented 1 week ago

Hello.

What I have in mind is to have a directory that is part of a project or package where you can do:

npm run srcbook -p 5555 -d ./books

Then it will load all the books within the books directory which can then import files from the same project and run them. All the books are then persisted in the books/ directory.

The usecase here is for projects to have notebooks that show how their code runs.