]> BookStack Code Mirror - api-scripts/blob - go-export-page-content/readme.md
Added bsfs to community project list
[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 This project uses timeouts, and lacks async requesting, to respect potential rate limits.
9
10 ## Requirements
11
12 [Go](https://go.dev/) is required to build this project.
13 This project was built and tested using Go 1.18.
14
15 You will need your BookStack API credentials at the ready.
16
17 ## Building
18
19 ```bash
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
23 go build
24 ```
25
26 This will output a `bookstack-export` executable file.
27
28 A `build.sh` script is provided to build compressed binaries for multiple platforms.
29 This requires `upx` for the compression element.
30
31 ## Running
32
33 You can run the project by running the executable file like so:
34
35 ```bash
36 ./bookstack-export --baseurl=https://bookstack.example.com --tokenid=abc123 --tokensecret=def456
37 ```
38
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.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.