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.
8 This project uses timeouts, and lacks async requesting, to respect potential rate limits.
12 [Go](https://go.dev/) is required to build this project.
13 This project was built and tested using Go 1.18.
15 You will need your BookStack API credentials at the ready.
20 # Clone down the api-scripts repo and enter this directory
21 git clone https://github.com/BookStackApp/api-scripts.git
22 cd api-scripts/go-export-page-content
26 This will output a `bookstack-export` executable file.
28 A `build.sh` script is provided to build compressed binaries for multiple platforms.
29 This requires `upx` for the compression element.
33 You can run the project by running the executable file like so:
36 ./bookstack-export --baseurl=https://bookstack.example.com --tokenid=abc123 --tokensecret=def456
39 By default, this will output to a `page-export` directory within the current working directory.
40 You can define the output directory via a `--exportdir=<dir>` option.