Synchronize a page from a file stored in a Git repository #4279

Closed
opened 2026-02-05 08:24:51 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @benjamin-cartereau on GitHub (Oct 25, 2023).

Describe the feature you'd like

I'd like to have a way to link a BookStack page to a file in a Git repository for example in Markdown format.
We could provide the Git repository URL and the filename.
And the sync would would take place at (configurable) regular intervals.

Maybe it could be extended to a book/chapter that would match a directory tree.

Describe the benefits this would bring to existing BookStack users

The main benefits would be to have only one source of truth and prevent BookStacks users from duplicating (copy/paste) documentation (MD) from a Git repo to BookStack.

Can the goal of this request already be achieved via other means?

No, not natively I think.
Maybe it could be achieved through an external system that would do the sync and call BookStack API to create/update page.

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?

3 months to 1 year

Additional context

Git commands that could be :
1st time) git clone -n GIT_REPO_URL --depth 1
then update at some interval) git checkout HEAD readme.md

Originally created by @benjamin-cartereau on GitHub (Oct 25, 2023). ### Describe the feature you'd like I'd like to have a way to link a BookStack page to a file in a Git repository for example in Markdown format. We could provide the Git repository URL and the filename. And the sync would would take place at (configurable) regular intervals. Maybe it could be extended to a book/chapter that would match a directory tree. ### Describe the benefits this would bring to existing BookStack users The main benefits would be to have only one source of truth and prevent BookStacks users from duplicating (copy/paste) documentation (MD) from a Git repo to BookStack. ### Can the goal of this request already be achieved via other means? No, not natively I think. Maybe it could be achieved through an external system that would do the sync and call BookStack API to create/update page. ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundamental request ### How long have you been using BookStack? 3 months to 1 year ### Additional context Git commands that could be : 1st time) git clone -n GIT_REPO_URL --depth 1 then update at some interval) git checkout HEAD readme.md
OVERLORD added the 🔨 Feature Request label 2026-02-05 08:24:51 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Oct 26, 2023):

Thanks for the suggest @benjamin-cartereau.
This runs quite close to the fundamental request in #776.

Personally I'm not too keen of maintaining an in-platform sync system. It seems to primarily serve external use-cases and processes here rather then the application itself.
Sync systems can quickly get quite complex in logic and handling, It's not something I'd deem worth the maintenance at this time.

This is probably something better suited to our methods of platform extension.
As you mentioned, the API could be one method to achieve this.
Alternatively, you could use the logical theme system to hook into content events and run desired logic.
A related very simple example, of just writing out page content to files on save, can be seen in my blogpost here. This could be extended with git control and management.

@ssddanbrown commented on GitHub (Oct 26, 2023): Thanks for the suggest @benjamin-cartereau. This runs quite close to the fundamental request in #776. Personally I'm not too keen of maintaining an in-platform sync system. It seems to primarily serve external use-cases and processes here rather then the application itself. Sync systems can quickly get quite complex in logic and handling, It's not something I'd deem worth the maintenance at this time. This is probably something better suited to our methods of platform extension. As you mentioned, the API could be one method to achieve this. Alternatively, you could use the logical theme system to hook into content events and run desired logic. A related very simple example, of just writing out page content to files on save, can be seen [in my blogpost here](https://www.bookstackapp.com/blog/bookstack-release-v22-07/#new-activity-logged-logical-theme-system-event). This could be extended with git control and management.
Author
Owner

@benjamin-cartereau commented on GitHub (Nov 8, 2023):

Thank you @ssddanbrown !
I understand. I will have a look at trying to use Git (hook) and Bookstack API trying to achieve this.

Best regards

@benjamin-cartereau commented on GitHub (Nov 8, 2023): Thank you @ssddanbrown ! I understand. I will have a look at trying to use Git (hook) and Bookstack API trying to achieve this. Best regards
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4279