A PlantUML to XML converter
  • OCaml 87.2%
  • Dune 5.8%
  • Makefile 4.8%
  • Dockerfile 2.2%
Find a file
Khalid 19441cf52c
Merge pull request #3 from khalidbelk/feat/sortedFeatures
Feat: sorted features & versioning
2025-02-17 13:47:06 +01:00
.github/workflows feat(ci): trigger CI builds on PR's to main branch as well 2025-02-17 13:36:11 +01:00
diagrams feat: initial commit 2025-01-04 09:34:34 +01:00
src feat: add puml2xml versioning to XMI header 2025-02-17 13:40:35 +01:00
.gitignore feat: initial commit 2025-01-04 09:34:34 +01:00
Dockerfile fix: remove useless cmd from dockerfile 2025-02-16 23:36:14 +01:00
dune-project feat: convert multiple classes and add some error handling 2025-02-14 14:28:11 +01:00
LICENSE feat: add Readme and License files 2025-02-15 02:34:56 +01:00
Makefile feat: initial commit 2025-01-04 09:34:34 +01:00
puml2xml.opam feat: convert multiple classes and add some error handling 2025-02-14 14:28:11 +01:00
README.md docs: fix hyperlink tags in README's badge container 2025-02-16 23:51:30 +01:00

Puml2xml 🌱➡️📄

ubuntu-latest      macOS-latest      Docker Build

A PlantUML (.puml) to XML (.xmi) converter.

Prerequisites

Before starting, If you want to run it locally, ensure you have the following dependencies installed, otherwise you'll just need Docker, and can ignore this :

  • dune (v3.16 or higher)
  • OCaml (v4.08.0 or higher)
  • make

Installation

Steps

  1. Clone this repository and open it

Local install

  1. Compile the program with the command
make

Docker 🐳

  1. Build the image with the command
docker build -t puml2xml .
  1. Run the container
docker run --rm -v $(pwd):/data/input puml2xml ./puml2xml /data/input/<yourfile.puml>

Note: for this last command, you'll just have to replace <yourfile.puml> by the .puml file you want to convert (located in your current directory).

Usage

You can use it as specified here :

USAGE: ./puml2xml <file> [OPTIONS]

   <file>          : the relative path of the .puml file to convert

OPTIONS:
   -f <new_name>   : specify the output file name. Default: same as input with .xmi extension.
   -h              : display this message

Why and how was this project created ?

This project was born from my experience working on a university project, where we were required to create PlantUML diagrams and also deliver them in XML format. Logically, I thought "It shouldn't be that hard to find a PlantUML tool that does this". After searching for a while, I encountered an issue : either finding a solution was quite tedious for such a simple problem, or many users found issues with the tools provided by PlantUml.

After more digging, I finally found a Docker command line provided somewhere by PlantUML, which, by chance, worked for me. However, as a result, I wanted a more accessible, native tool, primarily to save others the hassle of facing the same situation as me in the future (and also as an excuse for myself to make a project in OCaml ^^).

This project was made possible by reverse-engineering the given output. For reference, you can find the .xmi output file here and the .puml file I used here.

Contributions 📥

To contribute, fork this repository and open a pull request describing the fix or feature you're adding. Please ensure that your commits follow the conventional commit format.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.