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

Is there a program to update the database in real time for real time previews #45

Closed
3 tasks done
Ahidada opened this issue Oct 18, 2023 · 5 comments
Closed
3 tasks done
Assignees
Labels
enhancement New feature or request

Comments

@Ahidada
Copy link

Ahidada commented Oct 18, 2023

We want a way so that you can rebuild the database in real time so that we get real time previews.

Simplest approach is probably to use https://github.com/paulmillr/chokidar to watch the markdown folders and rebuild some json files (with these files being watched by nextjs or whatever tool you are using). this at least is a first pass.

This probably depends on the JSON output option.

Acceptance

@rufuspollock
Copy link
Member

@Ahidada we know exactly what you want - we need to add a watch function to rebuild. This is on our roadmap but is not there atm.

You could hack this right now by running the rebuild script with a watch function on your content folder.

@rufuspollock
Copy link
Member

@mohamedsalem401 could you put some info about how this was resolved and where it is documented ...

@mohamedsalem401
Copy link
Contributor

mohamedsalem401 commented Mar 22, 2024

@rufuspollock
Fixed here: #90
Basically, by using the --watch flag on the command line (mddb ./content --watch). And no, we didn't add a documentation page back then.

@rufuspollock
Copy link
Member

@mohamedsalem401 can we add something to README briefly about this functionality.

@mohamedsalem401
Copy link
Contributor

@rufuspollock
Here's the section in Readme.md about the watch flag
https://github.com/datopian/markdowndb?tab=readme-ov-file#watching-for-changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants