Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Markdown Preview #298

Open
washere opened this issue Aug 19, 2023 · 13 comments
Open

Feature Request: Markdown Preview #298

washere opened this issue Aug 19, 2023 · 13 comments

Comments

@washere
Copy link

washere commented Aug 19, 2023

Hi Davo,

Long time no see. I hope you're well & having a great summer.

We had a long discussion a few years ago for mass import/export of txt & Markdown files. Which ended in your granting my wishes & creating tomboytools.

As I predicted, the rise of markdown is unstoppable. Most web content providers static-gens (jamstack.org/generators) are including markdown one by one. The consortium to unify format is also serious now, will take a few years, but no one is waiting.

After Roam Research, dozens of Markdown based knowledge-base/wiki makers like Obsidian & Logseq etc have a huge user-base each. Markdown has basically become Godzilla.

I think we need a new button on the toolbar:

Markdown Preview

This will show a live preview if the note content is markdown.

I would like you to sleep on this & think about it for a few days.
Because I think you will have ideas.

Also I have a lot more to say about the functionality of this little button at the end of toolbar. We can simply call it [.MD].

I am a long time coder & UI/UX guy (multimedia interface design).
I think you can do simple yet genius things with this little button that actually no other application has.

As I said please think about this for a few days and tell me what you think. As this needs a little brewing creatively.

Also I'm using Tomboy-NG on a couple of distros laptops much more than Windows laptop which I rarely turn on nowadays. Fedora will take over as standard from Ubuntu, it runs beautifully on Fedora and another. As does Tomboytools. Also the custom themes (setup colors) make it look stunning in dark mode. As there's no name & export/import themes by colors, that would be a mighty cool feature too bro. So I save #rgb hex values for each theme in a text file. And with the right fonts installed & chilled colors, Tomboy-NG is a honey to look at.

Anyway please think about this request & tell me what you think. Then we can take it further. Because there are several potential strategies possible.

Have a good weekend buddy & thanks again 👍

@davidbannon
Copy link
Member

Hi washere, not ignoring you, I have been travelling in some very remote places.

OK, a markdown preview ? It would have to be a viewer that is either internal to tomboy-ng or an external one that uses a application that you already have installed.

I am not sure just what you expect from an internal tomboy-ng markdown viewer, it would make exactly the same mistakes I have made in creating the markdown in the first place. So, by definition, if not in practice, it would look identical to the same note viewed in tomboy-ng format (except from the highlight that md does not support).

In tomboy-ng, I use a widget called KMemo to display a note. At present, I read tomboy's XML, convert it to what KMemo works with and do reverse when saving. So, I could make a MD to KMemo converter I guess. Cheat's way would easy, I already have a MD to XML converter, I'd take the generated MD, convert it to XML, open it with my XML to KMemo converter. Not sure how useful you would find that to be honest.

On the other hand, maybe a stand alone Kmemo based MD viewer would be a useful thing in its own right.

An external viewer might make more sense, on my system here, I have 5 or 6 apps that claim to know what to do with MD, 2 are plain text editors, they don't render it at all, just show the markup characters. Firefox looked promising but first thing it does is ask me what app I want firefox to use to open it. Ocular and Remarkable do a great job of rendering the MD. All the Libre Office apps claim to do MD but history tells me otherwise.

So, perhaps you want me to (eg) make a MD note in /tmp and then launch a predefined app to deal with it ? Should be easy too. What app do you use to look at MD ? I tend to use github's definition of MD ....

Export and import tomboy-ng's config ? Yeah, thats easy. its all in one file down in (eg) ~/.config/tomboy-ng. Includes custom colours....

Davo

@washere
Copy link
Author

washere commented Sep 8, 2023

Hi Davo,

Good to hear from you. Yes I remember you travel lots for work etc, specially in summer.

That's a lot to unpack. I need to think about it more on what you're thinking, they're all important for ways forward.

Our problem, and ironically strength, is that you have to think multi platform. It's not an easy job you have with ng.

Strategically, I think the long term future of ng is markdown incorporation, big time. I don't see how it can be avoided. I think also might be good to rebrand beyond tomboy. I think you could rename this project to whatever you like, and move on. I am not saying abandon tomboy concept or radically change the app, no. But you have made it much better than original. You can call it tomgirl or davoboy or whatever you fancy. But gradually will be free to expand from this basis you have wonderfully created. Anyway just an idea.

But we're not in Kansas (Tomboy) anymore with ng, but a much better place. I'm rarely using Windows nowadays. Mainly Linux & your work runs just as good. I even use Linux phones as well as Android. But even if you keep the name ng, we're well beyond the original tomboy event-horizon.

Fedora is taking over from Ubuntu as standard, and with latest gnome it's rock solid. That should be the base for testing any Linux apps now. I've also been playing with endeavorOS for a year, easy implementation of Arch by a couple of devs (telegram channel & forum) with multi desktop enviro options on login (gnome, plasma etc). But rolling release not point release, so needs updating (easy via welcome panel) every Few weeks. Zorin is good for testing Windows-ish apps too, many windows users go there.

I've tested nearly two thousand apps for productivity for my own use. I use just over 50 on Linux, Windows & Android. Multi genre: note taking, outliners, markdown, mindmaps, script writing, ide, etc. Yes on ide systems (Ms vs code, sublime text, atom, etc) there are many Markdown extensions/plugins for each.

Markdown can be learnt in a few minutes, just Google Markdown Cheatsheet & Markdown sample files. Ofc GitHub default readme files are Markdown. Yes GitHub render is just fine.

I suggest getting a few of the best apps for Markdown. Most of the best are free. On Android keep an eye on obsidian (play store) & get community plugins to play + Logseq on GitHub. Also on Play store get Joplin. Joplin also for Linux & Windows are must-haves. Qownnotes on Windows & Linux. MARKOR for Android from F-droid store. I bought typora (Windows Linux) & iAWriter (Windows Android) but they're mainly jazzy interface for fast writing, don't buy, really for professional writers.

On Android Epsilon Notes (Russian dev) is a must have, lifetime license very cheap for pro version, it's the only Android app with dual pane live preview. Joplin (French dev, gave him some ideas he did as features years ago, very popular now) & Qownnotes do dual pane live preview of Markdown on Linux & Windows, try them. Download sample MD files & Cheatsheets.

On Android get the free Zettel Notes (nice Indian dev, telegram channel & forum) from play store based on zettelkatsen concept Cross-reference etc, did few features I suggested. Netrinote is nice too on Android. You need markdown sample files with samples of markdown formatting to compare apps. Any markdown render engine you adopt from whatever library your ide systems use is ok. Jotterpad on Android (I bought premium, not subscription) has a stunning render (Singapore guys who do the famous journey app too) of markdown, used also for film script writing, fountain format for Hollywood is variation of markdown, renters both formats.

On Linux, whatever your app store (software apps, yay, discover, Pacman, flathub etc) just search for: Markdown, you'll see many apps. Just open several sample markdown files with each to see features & interface & rendering.

I think we have to forget about launching external MD apps for ng.

I think you need a standalone MD render for ng. Maybe start with a basic kmemo engine code. Then later expand it or swap it if you find something you can plug in & improve & expand later.

I see the problem you're hinting at. Maybe the .MD button can insert a hidden xml type tag to make the note MD eg:

< ngmd > blahblah note body < / ngmd >

And/or also some way to make a note .MD format. No need for switch back to txt as MD with no formatting is txt anyway. Wherever in the interface that you like, or toolbar or just as part of the function of .MD icon in toolbar. Or completely hidden & auto detected: when MD format characters are detected. Can have an option in settings to disable Markdown render in all notes. Many ways to do, whatever you like. In fact all the apps I mentioned above automatically detect & render MD.

But I think a standalone Markdown render by ng is the starting point.
Search the libraries for your ide & multi platform coding system you use, I'm sure there are several Markdown libs to plug in, no need to start from scratch. Also ask on their (your closing system) forum for whatever systems you're using, I'm sure several already making MD libs. It's ubiquitous nowadays.

Yes I uploaded my ng config to Dropbox & drive to backup same day I opened this issue.

Here's some links, sample files, I collect many MD sample files for years now:

https://duckduckgo.com/?q=Markdown+sample+file

https://duckduckgo.com/?q=Markdown+Cheatsheet

https://www.google.com/search?q=readme+site:github.com+filetype:md

https://github.com/laurent22/joplin
Mobile:
https://joplinapp.org/download/

https://www.qownnotes.org/

https://github.com/pbek/QOwnNotes/releases

Linux:
https://flathub.org/en-GB/apps/search?q=Markdown

I need to think more about what you wrote too. But I think ng needs a code engine for rendering MD. Then to build upon. Modular: main control procedure + rendering lib, I/o, etc. I think you need to source the library. There are a few Render modes. Whatever is easier for you to get a hold of, be it GitHub flavor or the others doesn't really matter, they're all 95% similar, whatever you can get is fine. If kmemo has one, I strongly recommend plugging that in & building it up.

I need to read your post again carefully this weekend. So many points. Once the basis is chosen by you then the rest falls into place in time. But you have to choose carefully now to make future evolution of the work much easier & more effective & logical.

No need to answer many things I raised, just thinking aloud. But this damn Markdown is the future that can't be ignored. So might as well plan around it. Anyway thanks again Buddy & have a great weekend.

@washere
Copy link
Author

washere commented Sep 8, 2023

P.S. was swiping above comment on phone with gboard late last night.

Corrected numerous typos etc.

@davidbannon
Copy link
Member

Hmm, I see how a standalone viewer might be useful but they already exist, eg Remarkable or Ocular under Linux, I am sure there are similar things available for Windows and Mac. While it might be fun to make, eg, a new Remarkable, I fail to see what it would do that Remarkable does not already do.

So, your MD button, click it and the (previously nominated) application opens the markdown version of the current note. You could just use it to view or, depending on the application, edit it and save it elsewhere as Markdown. What else do you need ?

I value your input here washere, both past and present ! I personally think the thing that holds MD back is its very loose definition. CommonMark is a step in the right direction but still contains several ways of achieving most things and does not do highlighting.

Davo

@washere
Copy link
Author

washere commented Sep 16, 2023

Hi Davo,
Just saw your comment. Thanks.

I think I didn't make my point clear regarding standalone. I thought you saw 2 ways forward: launch external MD app or render within ng. When I say standalone I meant as part of ng. That's why I said to hunt for pre-existing libraries for your coding platform to plug-in. If you read your first post, you'll see why I thought that standalone means within ng, not to make a separate app! That'll be awful. Nothing you can do will catch up with years of the best of MD apps (most are terrible but several are great) have ahead of you.

No, I mean within ng. Then there's an advantage that they'll never have. What?
NG (currently) As a 3M style Corkboard (Tomboy idea basically) that works well in this day and age (only one IMHO), and in multi platforms too. Then they'll never have what you can achieve.

So, pressing the MD icon shows the MD render, WITHIN the SAME NG FLOATING WINDOW. Not an external app, nor your standalone app which will be still an external app which is why I never meant that.

If you remember my OP here, I said if MD render is implemented in ng, there are very subtle ways which can make it uniquely superior to anything else. But as I said, those I'll outline later if we proceed. No point discussing them now. However the starting point is, clicking the MD button: renders what is called "live view" or "preview" etc, which means showing text formatting in action.

Clicking it again, shows the text again with special MD characters, or the code view.

Now the main point here before anything else is, why I say we should decide on Markdown render implementation?

  1. This is what we call a strategic decision in the software lifecycle.
    You either take it now, or don't.

  2. if you do we proceed.

  3. if you decide not, then my estimate, in probable percentage over 50+%, is that in a few years you will implement it.

This is because of several aspects. Productivity apps are moving that way. People who are not giant corporations, are not pouring millions into Markdown apps (obsidian, roam, etc) without any return currently. That's their main business bet. They see foreseeable advantages over others by starting early.

Users are moving in that direction too.

Platforms, now mostly static generators (blogs etc) are moving that way.
That is predicted to be the backbone of future web.

Ok, so in a couple of years you might decide to do so. What's the damage?
Well you'll be behind two years.

  • Many enhancements not to mention fixing teething problems early, will be lost, maybe forever. I myself don't know if I'll have time to even check GitHub anymore next year, NVM 2 or 3 years.
    And more damage too, basically should've been done before, this is the time. Else ng will fall well behind the curve.

So that's the strategic decision you have to make.
All I can do is advise.

Sure MD or commonmatk doesn't do highlighting & much more. But that's by intention. Whole point is it's minimal. If all those old criticisms were true, Markdown world be long dead as they said. Instead it's taking over the online backbone (NVM just Wikipedia). But that, minimalism, is it's strength.

All the render libraries basically are similar 90+% and that's what matters. That's why I said whatever libraries you choose to plug-in, would be fine. I do not advise coding the render engine from scratch. So in a way there's not much to do.

Just to make further tactical decisions in the post implementation.
However the strategic decision is whether to proceed or not.

I check here every week or two.
As I said in the op, there's no rush.
No need to answer points. These are thinking aloud by you & me.
Let it brew & play around with Markdown apps.
I suggest install a few static-gens that are MD based for your test blogs, or clients, to get a feel.

Most of the best the tech gurus have been blogging in MD for years now, believe me they're not stupid, they made the whole online world in the last two decades.

Unless you see the light, there's no way for anyone to show you and you can make a decision after playing around, for a good while, that's the only & best way. So just pay around with it on one or two static-gens, on Linux not Windows (static-gens take a long time on Windows to setup & debug as I've done many & not really worth it) because they're written for Linux as most Internet servers run on Linux anyway. So, much easier, many are Linux-only anyway.

If not, at least install the good MD apps I mentioned & play with several sample files.

Anyway if you don't do it, someone will do an MD based floating notes notice-board. They're doing all the genres in MD one by one. So take your time to think about this.

Sorry about any typos as swiping on Gboard on phone again.
Have a good weekend buddy 👍

@aguador
Copy link
Contributor

aguador commented Sep 17, 2023

washere,

I have followed this thread with some interest even though MD, per sé, does not interest me in the least. I am looking for text-based notes and see -ng as in a nice niche: formatting, alternate export formats if needed, notebooks -- well beyond simple "sticky notes," shy of the glitzy graphics and incorporation of non-text formats.

I know this issue is for Davo to think about, but you have piqued my interest and hope you and he don't mind my non-programmer intrusion. A couple of questions:

  • What sort of internal viewer are you thinking about? A dual pane set up like some of the apps you cited? As far as I can see the purpose of a viewer would be (like the preview here) too verify that everything looks fine, but with quick access (another pane, a tab) to the note to edit in -ng. Beyond that the next logical step would be the ability to edit in MD directly.
  • If I have understood your last post, you are essentially arguing for a shift, ultimately, to an MD format for ng notes. Is that the idea?
  • I see two separate strands in the apps and arguments. You argue that MD is becoming dominant for website (and other?) development. Your examples of Roam/Obsidian/Zettlr suggest an interest in zettelkasten. Do you see the latter as a possible future for -ng? Do you see MD as essential for both?

Zettelkasten sparked my interest a few years back as I contemplated semi-retirement and what to do with a collection of articles I had used in teaching. COVID and changes in my personal life sidetracked that. However, I am not sure that -ng can (easily)/should go that way, not because it is not useful, but because it would be going head-to-head with dominant players. Better to have its own niche.

More important than MD, but something that requires finding a dev, is someone to produce Tomdroid-ng. It is too bad the original Tomdroid is dead (if still available and useful basically as a standalone), the code apparently undecipherable. However, given that there are now generations of people who do not touch "real computers," Android and iOS apps may be more important to -ng's future.

My two cents. Interested in learning more.

@washere
Copy link
Author

washere commented Sep 17, 2023

Hi aguador,

I'll answer your 3 questions, briefly because generally that's not the directions I'm suggesting:

  1. I'm saying to keep things simple.
    So simply: the MD button would render the file in its Markdown layout view.
    Pressing it again would show the code, as ng does currently with MD files.
    I explained this clearly. Just that. The rest is not what I meant & did clearly reject before.

  2. good opportunity to repeat that point again.
    No, as I said ng should not try to become an MD app.
    Why? Because as I said, there are many with several good ones on Linux, Windows, MacOS, Android. They're years ahead.
    As I said ng will never catch up, some have teams working on them, several full time like Obsidian, Roam etc.
    As I said ng should remain focused on being a multi floating notes app. And stick to it's current raison-d'etre.
    Then it can progress in it's current evolutionary niche & remain top dog. Otherwise something else will emerge & will use MD to become the dominant "sticky notes" app as I said.

  3. your Zettelkasten idea. Well again that's not about this thread really.
    It's a digression. However to answer your question:
    Wikipedia sort of is the modern implementation of that. And the Roam revolution with many apps now following, obsidian Logseq Athena etc etc, are basically all doing that. Markdown is the standard lingo, as it's also for the entering static-gens & new web. But at the heart of all those dozens of apps (not hundreds of general Markdown apps) is backlinks, tagging, inclusions & a few other features.
    Ng in a way does basic zettelkatsen as we can cross reference notes by auto link creation. But it's not in the league of the apps I mentioned who are different animals really to tomboy & now ng.
    Again this is completely a different subject matter & can be a huge area of discussion, irrelevant to tomboy concept. Though certain features can be implemented in ng, however not really what I'm thinking of.
    I think ng should remain close to tomboy concept. In a way you are disagreeing with me but stating just this point & in fact using my own words sometimes, which I stated clearly before here myself. So no, your projections are not what I mean & are clearly what I rejected before.

As for mobile, Android or iOS, I'd advise against it.
Whole essence of ng is based on multi floating notes. This needs big screen acreage, not tiny phones.

As for further ideas regarding ng incorporating MD live view feature, they're in keeping with tomboy concept, will be unique, very simple but profound. However I'm not going to waste time discussing them if there's no live render of MD. But they'll be specific to tomboy concept.

Anyway, not sure I'll have time to say much more here as life has a habit of interfering. But as I said this thread is for Davo to think about things I mentioned.

Sorry about any gboard typos.
Have a good week everyone 👋

@washere
Copy link
Author

washere commented Sep 17, 2023

In a few words this thread is SIMPLY requesting:

1) to have an MD button to render Markdown live preview of a window (if that note has any markdown content, as MD apps & plugins auto-detect md content ie: markdown render lib = MD parser = auto detect format (to put to rest an earlier inquiry)) in the same window.

pressing it again, toggles & shows the raw text as ng currently does anyway. So nothing to code or do on pressing it again.

2) further, as I said I suggest Davo not to reinvent the wheel & do much hard work, but try to find some markdown preview library to plug-in, which is ubiquitous these days. If he can find one for his coding platform. Asking on relevant coding forums for whatever system, often brings out people who have or know of such md libs to plug-in. So do it if you can find/inquire of such lib to plug-in easily to do the work. There are more advantages to doing this apart from nearly no work vs reinventing the wheel, but again beyond my time currently.

That's all really, simply show MD preview if can find a plug-in lib to do so in same note window.

@washere
Copy link
Author

washere commented Sep 17, 2023

Ok, just got home & cleaned up Gboard typos somewhat. I had vowed actually to abstain from online presence in all it's forms for lack of time & many other reasons as things proliferate anyway. I think I made my request clear. I'm closing this now as won't have time to regularly check GitHub & don't want to appear rude that I'm ignoring any further replies which I'd never do. Best wishes to all. 🙂

@washere washere closed this as completed Sep 17, 2023
@davidbannon
Copy link
Member

Hey, not so quick washere, still things here to look at. Your clear position -

to have an MD button to render Markdown live preview of a window (if that note has any markdown content, as MD apps & plugins auto-detect md content ie: markdown render lib = MD parser = auto detect format (to put to rest an earlier inquiry)) in the same window.

Thats now clear to me what you want but actually doing it, usefully, is harder. I know no MD parser/render in Pascal, I could use C libraries but at risk of cross platform complications. Remember, a parser alone is not enough, it needs to be show, on screen. I can do that easily, I parse the md to xml (Tomboy Format) and then I parse that into something that KMemo can understand. The last step being rendering. Its all existing code. But what you would see would be exactly what you see when viewing the note in tomboy-ng. "Exactly" to the best of my ability anyway. That does not achieve anything really.

A more useful approach, would be to use some third party parser and renderer using, by definition, someone else's view of MD. That might highlight short comings in tomboy-ng. But it cannot be integrated into tomboy-ng unless we link it, either statically or dynamically. And there comes our cross platform issues.

Again, I suggest that calling a separate, standalone viewer does achieve what you want. You click that button in -ng, it (behind the scenes) writes a MD file to ~/tmp and calls a app of your choice to look at it. I don't know if its possible to 'import' a modified version of that MD content back into tomboy-ng, I don't support even the whole CommonMark standard, let alone MD. But that really depends on your use case, thats not clear to me.

And Tomdroid ? I have to agree with aguador here, I would really like to have a viable Tomdroid Sync. I did make one, used a rather ugly ssh sync but it did work. However, as soon as I started to use it, it brought back all the memories of bad sync from the Tomboy days. Sadly, Tomdroid has (sync) bugs. I am not willing to fix it, I hate working in Java. Serveral other people have indicated they would like to try but all have walked away. The build process is, apparently, not documented, given the changes that have taken place in Android, it probably would not build with current tools.

Davo

@davidbannon davidbannon reopened this Sep 18, 2023
@davidbannon
Copy link
Member

davidbannon commented Sep 18, 2023

Hey, wait a minute, maybe I missed something here. Washere, to you mean you want to be able to include MD syntax in line in a tomboy-ng note ? Thats why you want a MD parser/render ?

Mixing the wysiwyg of Tomboy with the 'show you later' MD approach ?

Davo

@washere
Copy link
Author

washere commented Sep 18, 2023

That will be a great bonus.
As long as there's a way to see how it actually looks, hence an MD icon button.
Whatever is easier to start off for you.
Then you'll know what to do slowly & gradually through the coming years as you play with it technically, feature-wise.
Also strategically long term.
The only thing you have to do is hunt around for a good library to plug-in so you don't do the work.

If you find more than one, see which one will be around for the long term. This often depends on the personality of the dev(s)/company, which is why open source is best. Because as coders whatever softwares we choose, it's also a long time investment in our time, which is actually more expensive than money. Plus potential future growth of that software. If you only find one, or none, then no choice. Just find something that's already been made & try it. Then your decisions will gradually emerge after you play around.

@davidbannon
Copy link
Member

Anything happening here will need to be in version 0.38, I need to get 0.37 out reasonably soon for Debian/Gnome issues.
Sorry.
Davo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants