https://github.com/tombreit/zammadkb2mkdocs
Exports a Zammad Knowledge Base to MkDocs
https://github.com/tombreit/zammadkb2mkdocs
mkdocs zammad
Last synced: 2 months ago
JSON representation
Exports a Zammad Knowledge Base to MkDocs
- Host: GitHub
- URL: https://github.com/tombreit/zammadkb2mkdocs
- Owner: tombreit
- License: eupl-1.2
- Created: 2025-01-11T23:06:56.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-23T20:41:53.000Z (3 months ago)
- Last Synced: 2025-01-23T21:29:01.894Z (3 months ago)
- Topics: mkdocs, zammad
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zammadkb2mkdocs
## Features
- `zammadkb2mkdocs` takes a Zammad database file and converts the Zammad Knowledge Base to a `MkDocs` project
- Converts Zammad source HTML to Markdown
- Converts multilanguage Knowledge Base to multilanguage MkDocs
- Downloads referenced images and adjusts the image links
- Grabs the Zammad Knowledge Base categories and converts them to MkDocs tags## Requirements
- `python3`
- `sqlite3`
- Zammad database must be available as a SQLite3 database file. See [Database](#database).## Usage
**🔥 This is work in progress - no liability for nothing.**
### Install
```bash
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install 'zammadkb2mkdocs @ git+https://github.com/tombreit/zammadkb2mkdocs'
```### Run
```bash
zammadkb2mkdocs path/to/zammad-sqlite-dbfile --zammad-fqdn zammad.example.org
```### Result
The Zammad Knowledge Base articles converted to Markdown files end up in `./dist/docs`.
Some other intermediate files such as the JSON representation of the Zammad Knowledge Base are also stored in `./dist`.For your convenience, `mkdocs` will be installed with this package and you can view your new MkDocs knowledgebase base right now:
```bash
mkdocs serve
```## Notes
- Currently only used/tested with a Zammad Knowledge Base in EN and DE.
- If the given `zammad-fqdn` is not reachable image src attributes will not be fixed and no images will be downloaded.
- To start from scratch: delete the automatically populated `./dist` directory.## Database
### Create PostgreSQL dump
```bash
@:~$ pg_dump \
--port \
--username \
--disable-dollar-quoting --no-security-labels \
--no-subscriptions --no-table-access-method \
--no-owner --no-privileges --no-comments \
--attribute-inserts \
zammad > path/to/dump.sql
```### PostgreSQL dump to SQLite3
This package includes a rudimentary conversion script:
```bash
pgsql2sqlite path/to/dump.sql
```