nextcloud / nextcloud/text

Embeddable public text preview page

Open
#1,501 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
659
Forks
133
Avg merge
1d 20h
Merged PRs (30d)
110

Description

Hi there 👋,

This is a feature request to be able to have a similar feature as the NC calendar app and be able to iframe embed a public file.

Indeed, the Text application can display beautiful markdown previews and thus a file can be shared with a public URL such as https://nextcloud.example.org/s/filePublicId.

Would it be possible to have an embeddable preview available at the URL (for instance) https://nextcloud.example.org/s/filePublicId/embed?

Similarly to the Calendar app (https://nextcloud.example.org/apps/calendar/embed/publicId) the page would allow embedding via an iframe on other domains and remove NC's header and footer.

This implies:

  • Adding a CSP policy (similarly to the Calendar app) in a new dedicated embeddable route in the backend
  • Making sure to remove NC header and footer on the embedded preview

What do you think?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing public Text file preview flow and the Calendar app's lib/Controller/PublicViewController.php example linked in the issue. Trace the /s/filePublicId route, then define the dedicated embed route and its page behavior; done means a public preview can load in an iframe, uses an appropriate CSP, and omits the Nextcloud header and footer.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend, frontend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.