Last active
September 4, 2022 20:26
-
-
Save palashkulsh/190219a4f7f7dc4d7e29c5bbe2a26e35 to your computer and use it in GitHub Desktop.
org file to plantuml mindmap or work break down structure wbs diagram creator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#identify is part of imagemagick suite | |
echo "@startmindmap" > /tmp/.org2file.uml | |
cat $1 >> /tmp/.org2file.uml | |
echo "@endmindmap" >> /tmp/.org2file.uml | |
#if -DPLANTUML_LIMIT_SIZE=18192 is not provided then image gets cropped off | |
java -jar /home/palashkulshreshtha/bin/plantuml.jar -DPLANTUML_LIMIT_SIZE=18192 -o /tmp/ /tmp/.org2file.uml | |
dimensions=`identify /tmp/.org2file.png | awk '{print $3}'` | |
width=`echo $dimensions |awk 'BEGIN{FS="x"}{print $1}'` | |
height=`echo $dimensions | awk 'BEGIN{FS="x"}{print $2}'` | |
echo ' | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.bg { | |
background-image: url("/tmp/.org2file.png"); | |
width: '$width'px; | |
height: '$height'px; | |
background-position: top center; | |
background-repeat: no-repeat; | |
background-size: contain; | |
} | |
</style> | |
</head> | |
<div class="bg"></div>' > /tmp/org2file.html | |
chromium-browser /tmp/org2file.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment