olivierkes / manuskript

A open-source tool for writers
http://www.theologeek.ch/manuskript
GNU General Public License v3.0
1.75k stars 230 forks source link

Add images to project #22

Open vmpajares opened 8 years ago

vmpajares commented 8 years ago

I'm using manuskript to make game design documents. So it could be useful to add images to some sections, so readers (and myself if I reopen and old document) can use them as references. Like characters, world items, etc..

olivierkes commented 8 years ago

Do you need the images do be visible in manuskript, or only at export? (will the documents be read outside of manuskript?)

vmpajares commented 8 years ago

I need them to be visible in the character / world when I select them and in the export.

The readers will read the export, but I need to refresh my mind when I open a document after some time.

olivierkes commented 8 years ago

OK, part of the roadmap for 0.4.0 is the research folder. It will be possible to add images.

I guess you'll be able to reference them as usual (see right-click > insert reference in world, this is not implemented in characters yet I think.) Then if the reference is an image, then the tooltip will display the image, and when you click on it it will either open in the research folder (but then you leave the character / world tab, so not good), or open in the cheat-sheet, where the image could be displayed.

Would that be good enough for you?

An other (and compatible) option would be to add images using markdown syntax (![Title](url)), and manuskript could open them up just like references, as noted above.

vmpajares commented 8 years ago

Inserting references from the research folder would be great. Thanks.

ramonskovitch commented 7 years ago

Is this implemented? If i right-click > insert reference it lists what is inside the MSK file. How can I create a reference directory inside to add say images? Also if i use Markdown instead, (which is good) what is the correct URL for an image immediately outside the .msk file in the same folder?

olivierkes commented 7 years ago

This is not implemented yet, but still in the pipeline.

If you use markdown, you can reference images relative to the place where you will export the html document in the end. So ![alt text](img.png) will display correctly if you export the html to the same folder.

As of now, I fixed the preview from the Compile dialog (in the develop branch) so that it will properly display images relative to the project path. So if you MSK file is stored in ~/manuskript/project.msk, then ![alt text](img.png) will be shown if ~/manuskript/img.png exists.

olivierkes commented 6 years ago

If you have markdown references to images in your project, manuskript can now show them as tooltips:

image

This works for local images (with absolute path only, though), and external images.

If you CTRL+Click the reference, it will open with the default system application.

gedakc commented 5 years ago

See How to Add Images to a Project.

jjhaggar commented 3 years ago

Is this feature still being worked on? It would be really great to be able to see images linked with relative paths just from the editor (not having to export to html). This software is already great, but with that it would be perfect! :D

TheShadowOfHassen commented 1 year ago

@TheJackiMonster, we'll want to add support for images in the new back end. Have you already figured out how you want to do it? If not, I do have some ideas.

TheJackiMonster commented 1 year ago

@TheJackiMonster, we'll want to add support for images in the new back end. Have you already figured out how you want to do it? If not, I do have some ideas.

The problem is not really how to store images but how to embed them properly into the application as well as exported documents.

For example we currently use Markdown as default to write text and Markdown generally allows the embedding of images. However these need to be placed with relative or absolute paths. Using relative paths might work but it could also cause issues when moving files around in the project structure.

So I think it would be better to store images in a separate subfolder than the texts. However this would likely decrease the ability to use the Markdown feature or paths will need to be very annoying to write. It's really a question of using images at all within readable text formats or will it only be usable in a WYSIWYG view. Then this would need to be implemented first.

TheShadowOfHassen commented 1 year ago

So let's say for the context just for an image gallery for the characters, that wouldn't be too hard would it? I think the only thing we'd have to do is expose an accessible path for the project and then copy the images to that path and then load them in a gallery. A text file could store the metadata for names/notes

In the editor though it'd be more tricky. I honestly don't see prose writers needing it, (much) and it would require a lot of finicking maybe buttons would make it easier instead of markdown commands?

obw commented 1 year ago

I think, as a first step, a simple media manager, would be enough. We should plan it so, that we can add later some features, like grouping (character images, World, Places, Creatures and so on) and tagging.

I think something like:

  1. An add image Icon / menu entry
  2. Select new image somewhere from your storage, which copy it, into a media directory.
  3. Select the image and Manusskript insert it into the text, as Markdown, with a relative path!

If the Image exists, we only need to use Step 3.!

Regards

TheJackiMonster commented 1 year ago

I think one thing I definitely worry about is that images are simply put binary data which can't be embedded into our human readable files. That means we can only link/point to them. However if they get moved, replaced, renamed or altered which might happen, those links are unaffected. Same goes for changes in the links which not affect the images.

That's likely the main problem we have to consider, no matter how the UI presents the usage of images.

It gets complicated when we address the fact that Manuskript allows managing projects as directories to easily organize them from within any file browser. Finding characters or scenes is quite trivial because they are just text documents, named regarding their context. Finding images in a similar way would be very useful if you just want to adjust an image for a character or replace it quickly using different software.

However naming files obvious can cause collisions (for example when we have multiple images in a gallery of a single character, sure we can add indices to each image but in case one gets removed we might want to update names and such).

I'm also not sure yet how images would affect the integration of Git to use it for a revision system. Because with Git you probably want to use git-lfs for binary files like images.

In general I think we need a solution to track links between different resources in a Manuskript project anyway. For example when adding references to a scene. Currently we don't really track whether these references are actually valid or not when applying changes to related files and I think that's not ideal. So once we can properly track references, this should also apply to linked images and managing them should work.