Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: embedded pdf previews #769

Draft
wants to merge 7 commits into
base: primary
Choose a base branch
from

Conversation

Valastiri
Copy link
Member

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

@vercel
Copy link

vercel bot commented Mar 22, 2023

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

@Valastiri
Copy link
Member Author

Need to verify mobile embeds work appropriately

@Sleinmaster
Copy link
Collaborator

Need to verify mobile embeds work appropriately

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

Screenshot_20230324-214043

@Valastiri
Copy link
Member Author

Valastiri commented Mar 24, 2023

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

@Sleinmaster device?

@Sleinmaster
Copy link
Collaborator

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
Copy link
Collaborator

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

@Sleinmaster
Copy link
Collaborator

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

Firefox :
Screenshot_20230325-084638

@Valastiri
Copy link
Member Author

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
Copy link
Member Author

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 Valastiri marked this pull request as draft April 4, 2023 00:28
@Valastiri
Copy link
Member Author

@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
Copy link
Member Author

Will revisit this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repo Changes to Repo or Config
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants