ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Diagram

by jvantuyl ALL

A Plug-In for Sublime Text 2 / 3 To Render Diagrams In Your Source Code

Labels diagrams, plantuml

Details

Installs

  • Total 3K
  • Win 1K
  • Mac 2K
  • Linux 462
Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6
Windows 1 0 0 0 1 2 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 1 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0
Linux 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Overview

This is a plugin that renders diagrams from your selection in Sublime Text 2 or 3.

By default, it binds the (Command / Alt)-M key and registers a command on the Command Palette. Simple select the text for your diagram and trigger the command. Multiselections are allowed. Each diagram will be generated in a uniquely named file.

If a diagram handler recognizes a diagram in the selection, it will render it and pop it up in a detected viewer. Files are rendered into the same directory as the source file as Portable Network Graphic files. They will be automatically overwritten, but not removed.

If you wish to override the viewer used, disable start-time sanity checks, or change the default character set for diagram files, create a user version of Diagram.sublime-settings file in the usual way.

Install

To install from scratch, it's necessary to have:

  • Java (download from java.sun.com) (brew cask install java)
  • Graphviz (I recommend “homebrew” on the Mac)
  • Sublime Text 2 or 3

To install, just put a checkout of this project into your Packages directory in Sublime Text.

Support

Operating Systems: MacOS X, Linux, Windows (with default system viewer) Diagram Types: PlantUML Viewers (in order of preference):

  • MacOS X Preview
  • MacOS X QuickLook
  • Eye of Gnome

Patches to support additional viewers or diagrams are welcome.

Install Instructions

Check out the source directory or download and uncompress the source tarball. Put this directoy in the Packages directory for your platform.

On Linux, it's sometimes “~/.config/sublime-text-2/Packages/”. On MacOS X, it's “~/Library/Application Support/Sublime Text 2/Packages/”.

Sublime Text should detect the plugin and automatically load it.

The source is available via git at:

https://github.com/jvantuyl/sublime_diagram_plugin.git

Or as a tarball at:

https://github.com/jvantuyl/sublime_diagram_plugin/tarball/master

Example Results

Component Diagram 1

component1

Component Diagram 2

component2

State Diagram

state1

Thanks

Special thanks to all of those who have contributed code and feedback, including:

  • Tobias Bielohlawek (Syntax Highlighting Support)
  • Julian Godesa (UX Feedback)
  • Seán Labastille (Preview Support, Multi-Diagram Support)
  • Kirk Strauser (Python 3 / SublimeText 3 Support)
  • Stanislav Vitko (PlantUML Updates)
  • Constantine ? (Windows Viewer, Charset Support, Image Size Tweaks, Output Selection Support, Various Other Fixes)
  • Marcelo Da Cruz Pinto (Windows Viewer)
  • Peter Ertel (PEP8 Cleanup, Windows Improvements)
  • Juan Cabrera (Version Updates)
  • Alexey Shashev (ST3 Plugin Loading Fixes)
  • Riley Wood (PlantUML Updates)
  • Ben Hardill (ST3 Native PNG Viewer)
  • Maksim Chartkou (File Naming Stability Improvements)
  • Timothy Zhang (File Include Support)
  • Way Wang (Python 3 Correctness Patch)