Closed moughxyz closed 7 years ago
so I have the markdown view working and it toggles but should we add a feature which we save when a note has been toggled to markdown view so that when you navigate to a note it will default to whatever mode it was in before.
for instance if you go to a note you want to see it in markdown mode first instead of having to toggle everytime you choose that note.
I'm thinking of saving that in the UserDefaults? what do you think Mobitar?
Hey @jz709u, pull request looks awesome. I'm actually reconsidering how we would do Markdown in Standard Notes. Before, when I created this issue, Markdown was to be natively supported by all SN clients. However, since then, we have introduced the concept of Editors, which are custom HTML/JS that can be loaded into the app from a URL.
See here: https://standardnotes.org/extensions/simple-markdown
After this change, I removed native Markdown support from the web app.
Now I'm deciding how to go about Markdown in mobile apps. There are two options:
What are your thoughts on option 1?
I like the idea of keeping things light but how many of your subscribers would want a markdown view supported natively? I think keeping things light is your niche I think it's common though once you start supporting a feature and people like it people will want it on all clients.
on option 1 do you mean use the extension loaded into the uiwebview within the app? or do it how I implemented it?
Well, editor extensions are made using JS/HTML and the postMessage API that web browsers support. Is it possible for a UIWebView to receive postMessage events? If so, we might be able to allow editors on iOS.
with the WKWebView I think we can but let me try it.
I just loaded the url into the webview "https://extensions.standardnotes.org/editors/simple_markdown?name=Simple%20Markdown"
can you explain to me what the flow is that you want? so load extensionurl and then what? call javascript code to set the text?
Yes we would need to use the postMessage API: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
postMessage API allows one window to send messages to another window with Javascript.
If this can work in iOS, so that iOS can receive messages from Javascript, or may check ever 0.1s for content updates, then editors can work.
Tap on title bar to toggle Markdown view?
Markdown view would ideally be a local webview, using some library to convert from Markdown to HTML.