Comments (12)
Unfortunately, this is difficult to do automatically for Preview. I'm fairly sure it would require AppleScript (at least) and it would likely be buggy.
I'll leave this open for now, but I'm not sure how best to do this.
That said, comments / patches are welcome.
from sublime_diagram_plugin.
Actually, it looks pretty easy. You can replace the contents the file Preview is currently displaying and it will re-render. The problem is how to handle the case of multiple diagrams
from sublime_diagram_plugin.
being displayed at once. I could see the algorithm being something like:
if len(last_diagrams) == 1 and len(diagrams) == 1:
reload(diagrams[0])
if lastlen != 1 and thislen == 1:
????
What's the right thing to do there?
from sublime_diagram_plugin.
It'll automatically reload, sure (kpdf does the same thing). However, how to tell if it's already open? What if they closed it?
Preview is Mac-only, so the solution doesn't have to be portable. But I'm not clear on how to ensure there's an open Preview that's viewing what you want to reload, and I don't want to accidentally suppress times that we really do need to open a Preview again to accommodate the, IMO, less important "reload" case.
from sublime_diagram_plugin.
I can't verify right now, but doesn't calling Preview on the same file raise the window that's already open, meaning it's "free" to explicitly call it again?
A second question: how to uniquely distinguish diagrams so that rendering diagram B doesn't cause preview to replace the contents of diagram A that it was already displaying? It's easy when Diagram is rendering an entire file, but less obvious when Diagram is rendering a selection within a file.
from sublime_diagram_plugin.
I had appended a new feature to solve it.
When I use a title in a diagram ,and specified the<<sub-title>>
in the title, it can generate diagram's filename instead of NamedTemplatefile
.
from sublime_diagram_plugin.
#14 does indeed address this, though not quite to my liking. Mulling this one over.
from sublime_diagram_plugin.
Why you doesn't using Sublime Text as a image viewer? On generating new diagram use the same file that was already opened in another tab and ST will automatically reload this.
from sublime_diagram_plugin.
Has this been merged in? I can't get it to work with title <> boop
from sublime_diagram_plugin.
@homeway FYI, I merged in a modified version your feature. It will come out in the next release. Basically, using a file named something like name.py
:
title <<subname>> Some File
Will output name-subname.png
and give you the title rendered as 'Some File'.
It should be on develop (as of 268f3a7).
from sublime_diagram_plugin.
@smwht When the next release comes out, title <<beep>>
boop should work.
from sublime_diagram_plugin.
I don't quite understand how this works,
I have checked out the develop branch and
made a PlantUML diagram named name.py
and added title <<subname>>
to the top.
However, when rednering, it still outputs unique png files
called name-nmg308.png
,name-tvypyt.png
, etc.
Is there something I'm missing it getting them always to overwrite the same file name?
OS X 10.9.5
SublimeText 3 (Latest)
from sublime_diagram_plugin.
Related Issues (20)
- hi, you may like the new diagram syntax HOT 3
- Installation through Package Control HOT 2
- Display a picture of ...Syntax Error?... after pressing alt-m HOT 2
- svg support for generated plantuml images HOT 4
- Package control says it's MISSING HOT 5
- Package streching HOT 1
- Collections support? HOT 1
- Error Processing Diagram HOT 3
- Request: Option to display preview in sidebar during typing HOT 5
- Unable to load configured viewer, falling back to autodetection...
- Single line comments are not escaped correctly
- Install an error under Windows HOT 1
- Sublime 3 on mac: Unable to load diagram plugin, check console for details. HOT 2
- error: No diagrams overlap selections. HOT 4
- The path problem with Package Control
- syntax highlighting triggers on apostrophe HOT 2
- Operation Instructions?
- Support adding an include file via configuration HOT 1
- can't output .png
- for update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sublime_diagram_plugin.