GithubHelp home page GithubHelp logo

Comments (9)

blackhole89 avatar blackhole89 commented on May 28, 2024 2

As of commit 4829902, we now render images given by ![alt text](local path) markdown. Consider this a (very simple) first step to support this.

from notekit.

blackhole89 avatar blackhole89 commented on May 28, 2024

You mean to embed images (png, bmp, whatever) into the document? Not at the moment. It's planned; I just need to figure out a good way of storing them (should they be forced inline with long data: URI blobs, or should notekit create a separate subfolder to store embedded images in?).

You should be able to copy and paste your own drawings without issue.

from notekit.

gcoimbra avatar gcoimbra commented on May 28, 2024

Yes, I meant that.
I think it would be better if they're inlined. This way if you can continue treating the .md files like a single entity. Containing all data.
Just like word, .doc documents.

from notekit.

blackhole89 avatar blackhole89 commented on May 28, 2024

Yeah, but if a big image is included, the resulting markdown file will become basically unusable in any plain text editor (like, you'd have a single line with hundreds of thousands of characters of alphanumeric garbage). #38 also suggests that some other markdown-processing tools don't play nice with them...

from notekit.

gcoimbra avatar gcoimbra commented on May 28, 2024

@blackhole89 I think you're right. Most Markdown software support images with web or local links, I think we should change to it too. The way things are now, we can't copy/paste easily the images (we get the base64 encoded image). The only way I think to get the drawings out of notekit is by screen printing them, which is really hard.

I think we can't do it like word with .doc documents without sacrificing simplicity and interoperability with other markdown editors.

I've changed my mind. The only way I see it, is to create a separate subbfolder, like you said.

from notekit.

sp1ritCS avatar sp1ritCS commented on May 28, 2024

As of commit 4829902, we now render images given by ![alt text](local path) markdown. Consider this a (very simple) first step to support this.

Cool I've been waiting for this. Obviously, this is a very early implementation and major things (like resizing) are missing, but its a first step. Something I've noticed is that it doesn't work with spaces in the file path, that's a bit annoying because gnome shell saves screenshot names with a few spaces.

from notekit.

blackhole89 avatar blackhole89 commented on May 28, 2024

resizing

How'd you even handle resizing? You'd have to store the size info in the document, but does Markdown have any standardised way of representing the size of an embedded image?

spaces

Does the Markdown spec allow those? (I took the parser from GtkSourceView's language definition, so whether it's legit is anyone's guess.) I could imagine that the image location is considered a "URL", so in particular has to be URL-encoded (representing spaces as + or %20)... (not that I'd be particularly bothered to deviate from the spec here and support spaces if it does; it seems like the parse would still be unambiguous)

By the way, the commit above might serve as a good piece of (loud scare quotes) "documentation" insofar as it represents a more or less minimal diff to add a new piece of syntax that is rendered to a widget when the cursor is not near it.

from notekit.

sp1ritCS avatar sp1ritCS commented on May 28, 2024

How'd you even handle resizing?
Well, that's a though one. I came up with these two:

  1. Abusing the alt tag, as (as far as I can tell) NoteKit isn't doing anything with it.
  2. Add some kind of block-comment infront of the image (but afaik notekit is just rendering comments currently)

from notekit.

blackhole89 avatar blackhole89 commented on May 28, 2024

Implemented in master now.

from notekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.