docs icon indicating copy to clipboard operation
docs copied to clipboard

feat: embedded pdf previews

Open Valastiri opened this issue 1 year ago • 10 comments

Summary

Uses a new pymdonx extension -> pathconverter in our config and uses absolute paths with /docs as the root.

  • Sample documentation for a first "feature" in the SOP page.
  • Styling is done with the class pdf-embed inside of the extra.css with responsive styling for tablets + mobile phones.
  • Added PDFs to /docs/assets/ directory

Testing

Check if working and usable in modern browsers and mobile devices.

Location

  • mkdocs.yml
  • docs/pilots-corner/SOP.md
  • docs/assets/
  • docs/stylesheets/extra.css

Discord username (if different from GitHub): Valastiri#8902

Valastiri avatar Mar 22 '23 17:03 Valastiri

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2023 11:11am

vercel[bot] avatar Mar 22 '23 17:03 vercel[bot]

Need to verify mobile embeds work appropriately

Valastiri avatar Mar 24 '23 20:03 Valastiri

Need to verify mobile embeds work appropriately

That's how it is on mobile chrome, don't know what's expected.

Screenshot_20230324-214043

Sleinmaster avatar Mar 24 '23 20:03 Sleinmaster

Should pop the standard browser pdf viewer -- and that isn't it. Will have to do look at this again.

@Sleinmaster device?

Valastiri avatar Mar 24 '23 23:03 Valastiri

Pixel 4 XL Android 13

It probably looks like that because pdf in general don't open in the browser but get downloaded.

https://support.google.com/chrome/thread/68561173/android-chrome-browser-don-t-preview-pdf?hl=en

Sleinmaster avatar Mar 25 '23 06:03 Sleinmaster

On Windows Chrome it looks like that, that's probably what you expected on the phone aswell: image

Sleinmaster avatar Mar 25 '23 07:03 Sleinmaster

Some additional screenshots from the mobile: Opera: Screenshot_20230325-084533

Firefox : Screenshot_20230325-084638

Sleinmaster avatar Mar 25 '23 07:03 Sleinmaster

Ah neat -- great testing // maybe on mobile I'll block the embed preview or it could possibly be a CSS issue since the embed takes the styles from that based on what I understand.

I'll give those a try -- since downloading the PDF or having it open on a mobile is typically (on a personal level) how I view pdfs or like restaurant menus.

Valastiri avatar Mar 25 '23 09:03 Valastiri

Just an update, haven't had time to vet this further. I might draft this PR and add a TODO later today to fix some of the outstanding issues.

Valastiri avatar Apr 03 '23 10:04 Valastiri

@Sleinmaster So I made some changes but it doesn't address your comments on andriod yet as that seems unavoidable and at least on our platform unsure how to hide elements we don't want on certain devices without being hacky about it.

Here's an iOS example on a 13p max.

image

image

Valastiri avatar Apr 11 '23 11:04 Valastiri

Will revisit this in the future.

Valastiri avatar Oct 08 '24 15:10 Valastiri