Metadata-Version: 2.4
Name: mindmapconverter
Version: 0.1.2
Summary: A tool to convert between Freemind/Freeplane and PlantUML mindmaps.
Author-email: Bosse <bosse@klykken.com>
License: MIT License
        
        Copyright (c) 2023 Bosse Klykken
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/larkly/mindmapconverter
Project-URL: Bug Tracker, https://github.com/larkly/mindmapconverter/issues
Keywords: mindmap,converter,freemind,freeplane,plantuml
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Mind Map Converter

## Overview
This project provides a Python script (`mindmapconverter.py`) to facilitate the conversion between Freeplane/Freemind XML mind map files (`.mm`) and PlantUML mind map definitions (`.puml`). This enables users to leverage Freeplane/Freemind for visual mind map creation and then convert these maps into a PlantUML format suitable for embedding in documentation, especially in environments that support PlantUML rendering (e.g., GitLab, Confluence, Markdown viewers with Kroki integration).

## Features
- Convert Freeplane/Freemind (`.mm`) to PlantUML (`.puml`).
- Convert PlantUML (`.puml`) to Freeplane/Freemind (`.mm`).
- Supports both standard PlantUML syntax (`* Node`) and legacy underscore syntax (`*_ Node`).
- Command-line interface with proper argument parsing.

## Installation

### Prerequisites
- Python 3.x

### From PyPI
```bash
pip install mindmapconverter
```

### From Source
1. Clone the repository:
   ```bash
   git clone https://github.com/your-username/mindmapconverter.git
   cd mindmapconverter
   ```
2. Install the package:
   ```bash
   pip install .
   ```
   Or for development (editable mode):
   ```bash
   pip install -e .
   ```

## Usage

The script automatically detects the conversion direction based on the input file's extension.

### Command Line Interface

```bash
python mindmapconverter.py input_file [-o output_file]
```

### Converting Freeplane/Freemind to PlantUML

To convert a Freeplane/Freemind `.mm` file to PlantUML:

```bash
python mindmapconverter.py input_file.mm -o output_file.puml
```

**Example:**
```bash
python mindmapconverter.py my_mindmap.mm -o my_mindmap.puml
```

If `-o` is omitted, the output is printed to stdout:
```bash
python mindmapconverter.py my_mindmap.mm > my_mindmap.puml
```

### Converting PlantUML to Freeplane/Freemind

To convert a PlantUML `.puml` file to Freeplane/Freemind XML:

```bash
python mindmapconverter.py input_file.puml -o output_file.mm
```

**Example:**
```bash
python mindmapconverter.py my_mindmap.puml -o my_mindmap.mm
```

### Supported Syntax
The converter supports the standard PlantUML MindMap syntax using asterisks for hierarchy:
```plantuml
@startmindmap
* Root
** Child 1
** Child 2
*** Grandchild
@endmindmap
```
It also supports the legacy syntax with underscores (`*_ Node`).

## Testing
To run the included unit tests:

```bash
python3 test_mindmapconverter.py
```

## Contributing
Contributions are welcome! If you have suggestions for improvements, bug reports, or want to add new features, please feel free to:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature/YourFeature`).
3. Make your changes and add tests.
4. Commit your changes (`git commit -m 'Add some feature'`).
5. Push to the branch (`git push origin feature/YourFeature`).
6. Open a Pull Request.

## License
This project is licensed under the [MIT License](LICENSE).
