treesheets icon indicating copy to clipboard operation
treesheets copied to clipboard

Code highlighting or markdown?

Open VegaDeftwing opened this issue 6 years ago • 7 comments

I found this project nearly perfect for my needs with a few expections I'm much more used to markdown style formating, that is *like this* to bold (like this) and similarly for italics and such. Furthermore, markdown docs usually support code highlighting with three backticks

while(1){
useMarkdown()
}

and this would be a very welcome feature here as well I see where this runs into more issues with schools of thought and implimention problems though, namely as far as I can tell all text in a cell right now is the same size and hierarchy is to be input via cells, where as inputing hierachy via things like markdown headers

as such

and such

would sort of defeat that purpose What do you think?

VegaDeftwing avatar Mar 10 '20 22:03 VegaDeftwing

Furthering this in what should also probably be its own issue and definitely a more obtuse request, generic HTML and CSS styling wouldn't be unwelcome additions either. It may even solve some of the issues that come with image resizing/sampling that other issues mentioned, and adding HTML support would make supporting the more 'markdown-y' features listed here easier.

If it were implemented a live preview such as in Marktext or Typora would be great, though I do certainly recognize the difficulty there, so I'd be greatful for even the generic 'render on save' approach

VegaDeftwing avatar Mar 10 '20 22:03 VegaDeftwing

Style inside cells is unlikely to happen, as that would be a fair bit of work (except for a preview, but I don't see the point of that). TreeSheets was really designed with the idea that cells would be small, so they could be styled all at once.

aardappel avatar Mar 11 '20 00:03 aardappel

If I or someone else submitted a pull with good code would you accept it?

VegaDeftwing avatar Mar 11 '20 00:03 VegaDeftwing

Generally a fan or PRs, but it really depends on the complexity it adds to code and UI.

aardappel avatar Mar 11 '20 02:03 aardappel

I think it can be done semi-reasonably for everything but code syntax highlighting. ~~The easiest way to add syntax highlighting would likely be adding Google's V8 as a dep and using https://github.com/codemirror/CodeMirror/tree/master/mode but that has licence implications as well. Clearly adding V8 alone would have a MASSIVE impact on the binary size and potentially performance as well. In an ideal world I (or whoever) would rewrite all the highlighting code in C++ but that sounds like a true pain. Maybe put everything but code/syntax highlighting in one branch and spit out an 'at your own risk, unmaintained' branch/repo/fork with highlighting so that you don't have to worry about it. On the other hand, adding v8 as a dep could also mean you'd get things like GIF and video playback as in other pulls much easier. I suppose this is a question of design goals and philosophy of the project.~~

edit, yeah, no. There do appear to be decent C++ based syntax highlighting libraries out there that I missed upon my first few attempts of searching. Maybe something like https://www.gnu.org/software/src-highlite/

But, yeah, don't worry about it. I'll submit a PR if I get anywhere

VegaDeftwing avatar Mar 11 '20 02:03 VegaDeftwing

What about just adding text style code? Although the typewriter text style probably reflects the code style but the font difference is barely noticeable. The shortcut key CTRL+ALT+T is badly chosen as same key combination usually opens terminal in most Linux distributions. Can I choose font per text style separately? Would be appreciated.

edmundlaugasson avatar Mar 11 '20 22:03 edmundlaugasson

I think syntax highlighting for code is the point though. For me to use treesheets as my primary notes replacement over markdown I'd basically need to be able to save code snippits in way that's user friendly.

VegaDeftwing avatar Mar 11 '20 22:03 VegaDeftwing