Sublime Forum

Using Sublime Text as a "frontend" for a note-taking app

#1

Hi all.

I have been using ST for a while in the past, with a paid license, and it was/is one of my favorite editors ever.

Not so long ago I started working on a pet-project Python app for quick distraction-free note taking. In the process an idea occurred to me: instead of struggling with QT framework and the likes I can just summon all the power of Sublime and let it do all the “frontend” work.

Here’s the main features I need from Sublime Text:

  • Launch it as a separate process (even when another instance is running) without displaying itself in the task bar.
  • Open multiple editor windows and control their position, size and theme.
  • Hide the main menu and other UI elements of the editor windows, such as title bar, status bar, tabs, line numbers etc.
  • Disable or remap certain hotkeys.
  • Intercept drag&drop events.
  • Display additional UI controls inside the editor windows. Specifically: buttons, drop-down lists, tree views, scroll bars, and text inputs, with custom event handlers.
  • Make portions of the text read-only.
  • Change font style for certain lines.
  • Display images inline (nice to have, but not necessary).
  • Clickable links in custom format, e.g. [this should open a new window].
  • Read-only table rendering.

So, my two questions:

  • Is all of the above possible to achieve with ST?
  • If yes, are there any ST plugins or similar projects that can serve as a good basis?

Right now I am aiming only at Windows, but Linux support would also be nice. Not a mac user anymore.

Thanks in advance.

0 Likes

#2

https://urtext.co/ https://packagecontrol.io/packages/Urtext is sophisticated.

1 Like

#3

There are some bits and pieces I’m looking for indeed.

0 Likes

#5

tend to build toolchains where ST might be one link in the chain rather than relying on plugins or new feature requests.

That’s approximately what I want o achieve. ST is an excellent editor, but I’d rather have my app/db/search logic separate from the UI, to be able to switch to another editor, if need be.

0 Likes

#7

Funny that my post got flagged as suspicious, yet this nonsense went through.

0 Likes

#11

Urtext developer here. Thanks for the mention @herr.kaste. We are no longer updating this on packagecontrol.io but we are looking for test users. @andysh you can try it using the instructions at https://urtext.co/setup/sublime-text/. It has many, though not all, the features you list. The underlying library is made to work in any editor/environment where Python 3.3+ is available, so things like managing windows/panes would be a Sublime-specific feature.

0 Likes

#12

@nbeversl How do you handle the updates. Have you code that fetches new versions, or notifies the user about new versions? Maybe you could also tell what the problem with packagecontrol was.

0 Likes

#13

@herr.kaste I was doing frequent updates in the last few months and the status of the crawler for package control was unknown. Is it now back up? The current version is public but somewhat beta quality, so I need to be able to get changes out quickly. Glad to have it back on package control if I can have more insight into the status.

0 Likes

#14

Yeah, packagecontrol was down starting with Feb 14. It is now working again. Since a week, roughly.

0 Likes

#15

I see the PR removing Urtext was merged but the package remains at https://packagecontrol.io/search/urtext. So I’m still not exactly clear. When you asked (https://packagecontrol.io/search/urtext) how I handle updates – that is also what I am trying to best decide. If I have users who are not Git-savvy or otherwise rely on package control, they become unable to update without it. Not complaining, just trying to make a choice on the best option. We are about to do a call for some more test users so I want it to be straightforward for them.

0 Likes

#16

On packagecontrol the last version is frozen. (Otherwise it would have been uninstalled for users that already have it.)

IMO it should stay on packagecontrol as it should just work for users that are not also programmers. For this package it may be also recommended to use an independent, local version of Sublime Text. (Stand-alone version) Iirc your package grabs a lot of global key bindings.

Grabbing these keys is likely not necessary as you could use contexts here so that the keys are only bound when an urtext view is currently active.

0 Likes

#17

can you please clarify

independent, local version of Sublime Text. (Stand-alone version)

I am not sure what this is.

Yes, I could move the keybindings into a context only for the syntax.

0 Likes

#18

Stand-alone is what they call the portable version. You just unzip to a folder and run from there. image

This works on all platforms.

0 Likes

#19

Note that if you want a portable version for Linux you’ll need to make a Data directory next to the executable. I’m sure something similar works on macOS.

0 Likes

#20

Sorry for the late reply. The project looks promising, I’ll definitely give it a try.

0 Likes

#21

@herr.kaste PR is submitted again. I will change the keybindings so they are not global by default.

1 Like