JankariTech / web-app-presentation-viewer

ownCloud Web Presentation Viewer is an extension of ownCloud Web to create and share slide presentations rendered from MD files
Apache License 2.0
4 stars 1 forks source link

[feature] embed images #27

Open individual-it opened 4 months ago

individual-it commented 4 months ago

As a user I want to use images in my presentation So that I can have more than only text in the presentation

As a user I want to use images that are stored in oCIS in my presentation So that I don't have to upload them or base64 encode them in the presentation

As a public viewer of the presentation I want to see embedded images in the presentation So that the presentation looks the same when viewed through a public like like if viewed as logged in user

As a user I don't want a public viewer to see images that are not publicly shared So that no private data is leaked

To fulfill the requirements I suggest:

  1. allow to embed images that are stored in the same folder or its subfolders by using the markdown image syntax
  2. not allowing to embed files from a folder of higher levels
  3. require the whole folder be publicly shared if the public viewer should see the images
  4. if only the markdown file is publicly share the viewer should not be able to access the images

Open Tasks:

koebel commented 4 months ago

A benefit of this feature request is to reduce file size of the presentation .md file. Plus, if I use an image (e.g. a diagram) multiple times in the presentation and notice an error, I only need to update the source and it should update all instances where this image is used

individual-it commented 4 months ago

partly workaround for now:

![intellij.png](https://ocis.in-nepal.de/remote.php/dav/public-files/sZWQDOGTMyigDVy/intellij.png)
saw-jan commented 4 months ago

I have done some work on it and these are the findings:

  1. There's a way to convert image path to full url with revealjs and marked: ./cool.png -> https://localhost:9200/dav/spaces/<id>/cool.png
    • :x: needs authorized request
  2. Sign the image urls: (working) :heavy_check_mark: Requires:

    • Unwrap Presentation component
    • Manually add header, sidebar, and other components
    • Modify img elements' src rendered by revealjs

    Limitations:

    • only files at .md file level can be read

I will try to implement option 2 for the first iteration.

saw-jan commented 3 months ago
  • Unwrap Presentation component
  • Manually add header, sidebar, and other components

I was wrong here. works without removing AppWrapper

import {  useAppDefaults } from '@ownclouders/web-pkg'

const appDefaults = useAppDefaults({ applicationId: '<app-id>' })

// mounted
// this loads the files
await appDefaults.loadFolderForFileContext(unref(currentFileContext))