]> BookStack Code Mirror - api-scripts/blob - go-export-page-content/readme.md
Added go-export-page-content example
[api-scripts] / go-export-page-content / readme.md
1 # Export Page Content
2
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).
5
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.
7
8 ## Requirements
9
10 [Go](https://go.dev/) is required to build this project.
11 This project was built and tested using Go 1.18.
12
13 You will need your BookStack API credentials at the ready.
14
15 ## Building
16
17 ```bash
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
21 go build
22 ```
23
24 This will output a `bookstack-export` executable file.
25
26 A `build.sh` script is provided to build compressed binaries for multiple platforms.
27 This requires `upx` for the compression element.
28
29 ## Running
30
31 You can run the project by running the executable file like so:
32
33 ```bash
34 ./bookstack-export --baseurl=https://bookstack.example.com --tokenid=abc123 --tokensecret=def456
35 ```
36
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.