MuckRock / documentcloud-frontend

DocumentCloud's front end source code - Please report bugs, issues and feature requests to info@documentcloud.org
https://www.documentcloud.org
GNU Affero General Public License v3.0
15 stars 5 forks source link

Document embed options #611

Closed eyeseast closed 1 week ago

eyeseast commented 1 month ago

Types of embeds:

Embeds for reference: https://muckrock.github.io/documentcloud-embed-examples/

duckduckgrayduck commented 1 month ago

### Documents

Responsive On (default) Off Width Automatic (default) Fixed Height Automatic (default) Fixed Sidebar behavior Responsive (default) Hidden Visible Title behavior Visible (default) Hidden PDF link Visible (default) Hidden Full-screen option Visible (default) Hidden Text mode Visible (default) Hidden Contributed by format User and org (default) Org only

Not implemented as toggle in front-end and also don't work, but mentioned on WordPress: page (integer): Page number to have the document scroll to by default. zoom (boolean): Hide or show zoom slider. search (boolean): Hide or show search form. format (string): Indicate to the theme that this is a wide asset by setting this to wide. Defaults normal. note (integer): ID of the note that the document should highlight by default. notes (boolean): Hide or show notes.

Notes

The note and page embeds seem to call a JS file to generate the embed instead of an oembed resource example:

From what I've tested for note embeds the only modifiable option is max-width.

Pages

For pages, it appears to have code you can change for styling

Page 1 of dcl20240801
Page 1 of dcl20240801
Contributed to DocumentCloud by Sanjin (MuckRock Staff) • View document or read text

but any time I try to make a styling or front change in my iframe tester here: https://codepen.io/SnapToPixels/pen/BjgvRM it loads the change for a second and then reverts to the defaults. Thus, there is no customization available with current implementation for pages.

Project embeds:

width height

title - allows you to set a title for the project embed on the page itself (you set the title in the src URL by appending &title=title_here). The title parameter that is already present is for accessibility, does not display on the page.

searchbar - (shows the button "Search this document collection") which links you to the project on DocumentCloud. Defaults to 0 (false).

duckduckgrayduck commented 1 month ago

Added to notion for review at next project planning: https://www.notion.so/muckrock/DocumentCloud-Embed-Options-3d942017b5794cd2ac53dec204a51bd3

eyeseast commented 3 weeks ago

Please add this to a flat page and we'll call this done.