3 This project, written in Go, will export all page content in its original written form (HTML or Markdown).
4 Content will be written into a directory structure that mirrors the page's location within the BookStack content hierarchy (Book > Chapter > Page).
6 Note: This is only provided as an example. The project lacks full error handling and also disables HTTPS verification for easier use with self-signed certificates.
10 [Go](https://go.dev/) is required to build this project.
11 This project was built and tested using Go 1.18.
13 You will need your BookStack API credentials at the ready.
18 # Clone down the api-scripts repo and enter this directory
19 git clone https://github.com/BookStackApp/api-scripts.git
20 cd api-scripts/go-export-page-content
24 This will output a `bookstack-export` executable file.
26 A `build.sh` script is provided to build compressed binaries for multiple platforms.
27 This requires `upx` for the compression element.
31 You can run the project by running the executable file like so:
34 ./bookstack-export --baseurl=https://bookstack.example.com --tokenid=abc123 --tokensecret=def456
37 By default, this will output to a `page-export` directory within the current working directory.
38 You can define the output directory via a `--exportdir=<dir>` option.