|
|
# XML Conversion
|
|
|
|
|
|
Install the _laweb2pressbooks_ converter [from here](https://gitlab.ethz.ch/laweb/laweb2pressbooks/-/blob/master/README.md), either as Python module with `pip` or use the Docker container provided.
|
|
|
|
|
|
## Conversion with Executable
|
|
|
Simply launch `laweb2pressbooks example.html`:
|
|
|
```
|
|
|
laweb2pressbooks example.html
|
|
|
INFO:root:Cleaning source file
|
|
|
INFO:root:Parsing HTML source
|
|
|
INFO:root:Cleaning HTML source
|
|
|
INFO:root:Preparing images
|
|
|
INFO:root:Scanning for parts and chapters
|
|
|
INFO:root:Reading anchors
|
|
|
INFO:root:Fixing references
|
|
|
INFO:root:Writing Wordpress XML
|
|
|
```
|
|
|
|
|
|
## Conversion with Docker Container
|
|
|
```
|
|
|
docker run --rm -v $(pwd):/home/workdir registry.ethz.ch/laweb/laweb2pressbooks:latest example.html
|
|
|
INFO:root:Cleaning source file
|
|
|
INFO:root:Parsing HTML source
|
|
|
INFO:root:Cleaning HTML source
|
|
|
INFO:root:Preparing images
|
|
|
INFO:root:Scanning for parts and chapters
|
|
|
INFO:root:Reading anchors
|
|
|
INFO:root:Fixing references
|
|
|
INFO:root:Writing Wordpress XML
|
|
|
```
|
|
|
|
|
|
## Export Result
|
|
|
By default, the conversion creates a file named `export.xml`. This file has to be imported into Pressbooks. But there are [some preparations](walkthrough/Preparations) to do. |
|
|
\ No newline at end of file |