Parse confluence xml export and create book, chapters and pages using the bookstBookStackack API.
The forked repo ben-tinc/xml2mw was a great start. Thank you for all the work!
- Python 3.6 (tested with 3.11.6)
- pipenv
- A BookStack instance
- A BookStack user with the Access System API permission
- Emoticons svg files (if your Confluence pages use them)
- Clone this repo and
cd xml2bookstack
. - Use
pipenv install
to install all dependencies (or ensure for yourself that you usepython3
and thatlxml
andanytree
are installed). If usingpipenv
, typepipenv shell
afterwards to enter the virtualenv. Prepend the command withPIPENV_VENV_IN_PROJECT=1
if you want the virtual environment folder to be created locally. If your python version is greater than 3.6, edit Pipfile to havepython_version = "3"
. - Place the
entities.xml
file andattachements
folder from the confluence export inside adata
subdirectory (or specify location with -d/--data option). - Copy
dot.env.sample
to.env
and configure for your BookStack instance (url, api token and secret) - Copy
emoticons
folder to your BookStack instance {web root}/public/emoticons (optional) - Run
python xml2bookstack.py
.
- Image attachements
- Flatten deep page hierarchy
- Emojis
- Comments
- Page order
- Table formatting (header, color, width)
- Image size
- Chapter/Page order is wrong
- Error 413 'Request entity too large' - see https://www.bookstackapp.com/docs/admin/upload-config/#changing-upload-limits
If you want to run the test suite, just run python -m unittest discover
. Using pytest
should work as well, if you prefer that. pytest
is included in the development dependencies, which you can install with pipenv install --dev
. Test suite is from original xml2mw project