Skip to content

Latest commit

 

History

History
89 lines (67 loc) · 3.44 KB

File metadata and controls

89 lines (67 loc) · 3.44 KB

Contributing

Adding a new library

  1. Fork this repository on GitHub and then git clone it to your local machine.
  2. Add a new folder containing your library files on the stdlib folder.
  3. Create this corresponding tree structure:

Tree structure

  1. Add a file inside your library's folder called README.md that contains an YAML header:
---
name: <your library's name>
display_name: 
description: 
author: 
version: <your library's version>
release: 
license: 
source: <[URL to your library's separate git repo where it is maintained]>
origin: <URL to the icon/stdlib origin website>
---

Information about the `<your library's name>` Standard Library.
  1. Make changes to the root README.md file to add your Library, describe it and add example.
  2. Optionally add one or more themes for your library in the ./stdlib/[your library's name]/themes folder
    • use the naming convention puml-theme-[theme name].puml to allow your users to use it via
      !theme [theme name] from <[your library's name]/themes>
  3. Commit your work and push it up to your fork repository
  4. Submit a Pull Request from your fork repository back to the main repository

Creating sprites

The entire process is described on the official website

Automating conversion from ready images

Linux

Dependencies: imagemagic, plantuml

#!/bin/bash

IMAGES_DIR=/path/to/images
RESULT_DIR=/path/to/results

TEMP_DIR_NAME=.plantuml.sprites

mkdir -p $TEMP_DIR_NAME
mkdir -p $RESULT_DIR

for i in `find $IMAGES_DIR -iname '*.png' -printf "%f\n" | sed 's/\.png//g'`; do
   # Convert image to include white bg and correct size
   convert $IMAGES_DIR/$i.png \
      -background "#fff" \
      -alpha remove \
      -alpha off \
      -resize 50x50 \
      $TEMP_DIR_NAME/$i.plantuml.png

   # Create sprites
   plantuml -encodesprite 16 $TEMP_DIR_NAME/$i.plantuml.png > $RESULT_DIR/$i.plantuml
done

rm -rf $TEMP_DIR_NAME

Local testing of updates to the stdlib

The correct local workflow to build a plantuml.jar that includes stuff from plantuml/plantuml-stdlib:

  • in local fork of plantuml/plantuml-stdlib
    • gradle run
    • copy files from ./output/ to ./src/main/resources/stdlib of plantuml/plantuml fork
      • cp -r ./output/* ../plantuml/src/main/resources/stdlib
  • in local fork of plantuml/plantuml
    • gradle clean
    • gradle jar
    • produces ./build/libs/plantuml-1.2025.5beta3.jar (or a different version)
  • set up PlantUML to use the produced jar (./build/libs/plantuml-1.2025.5beta3.jar, or other version in that folder)

Note: When using the IntellIJ PlantUML plugin, changing the jar setting is not enough to properly reload it, we suggest you restart IntellIJ to make sure the plugin picks up the new jar