Confluence2Markdown is a tool to convert Confluence documents to Markdown format. It provides a REST API for converting Confluence pages to Markdown and a command-line interface for batch conversion.
- REST API: Convert Confluence pages to Markdown via API.
- CLI Tool: Batch convert Confluence pages to Markdown files.
- Docker Support: Easily deploy the application using Docker.
- Kubernetes Support: Deploy the application on Kubernetes with a single command.
- Python 3.10 or higher
- Poetry (for dependency management)
- Clone the repository:
git clone https://github.com/yourusername/confluence2markdown.git cd confluence2markdown
- Install dependencies:
poetry install
- Set environment variables:
export CONFLUENCE_BASE_URL=https://your-confluence-instance.com export CONFLUENCE_USERNAME=your-username export CONFLUENCE_PASSWORD=your-api-key export HOST=0.0.0.0 export PORT=8080
- Start the application:
poetry run uvicorn confluence2markdown.rest_api.main:app --host $HOST --port $PORT
- Docker installed on your machine.
- Clone the repository:
git clone https://github.com/yourusername/confluence2markdown.git cd confluence2markdown
- Build the Docker image:
docker build -t confluence2markdown .
- Set environment variables:
export CONFLUENCE_BASE_URL=https://your-confluence-instance.com export CONFLUENCE_USERNAME=your-username export CONFLUENCE_PASSWORD=your-api-key export HOST=0.0.0.0 export PORT=8080
- Run the Docker container:
docker run -p 8080:8080 \ -e CONFLUENCE_BASE_URL=$CONFLUENCE_BASE_URL \ -e CONFLUENCE_USERNAME=$CONFLUENCE_USERNAME \ -e CONFLUENCE_PASSWORD=CONFLUENCE_PASSWORD \ -e HOST=$HOST \ -e PORT=$PORT \ confluence2markdown
GET /api/page/{page_id}
Example
GET http://127.0.0.1:8000/api/page/12345
Response
{
"page_id": "12345",
"markdown": "# Hello, World!\n\nThis is a test."
}
This project is licensed under the MIT License.
Contributions are welcome!