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

add b flag to pax #36

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
[![LICENSE](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)

Access the modules on GitHub via Deno Deploy
<img src="https://twemoji.maxcdn.com/v/13.1.0/72x72/1f995.png" alt="sauropods" style="height: 1em;width: 1em;margin: 0 0.05em 0 0.1em;vertical-align: -0.1em;">
<img src="https://cdn.jsdelivr.net/gh/twitter/[email protected]/assets/72x72/1f995.png" alt="sauropods" style="height: 1em;width: 1em;margin: 0 0.05em 0 0.1em;vertical-align: -0.1em;">

"pax" represents "packs"
<img src="https://twemoji.maxcdn.com/v/13.1.0/72x72/1f4e6.png" alt="packs" style="height: 1em;width: 1em;margin: 0 0.05em 0 0.1em;vertical-align: -0.1em;">
<img src="https://cdn.jsdelivr.net/gh/twitter/[email protected]/assets/72x72/1f4e6.png" alt="packs" style="height: 1em;width: 1em;margin: 0 0.05em 0 0.1em;vertical-align: -0.1em;">

## Usage <img src="https://twemoji.maxcdn.com/v/13.1.0/72x72/2699.png" alt="gear" style="height: 1em;width: 1em;margin: 0 0.05em 0 0.1em;vertical-align: -0.1em;">
## Usage <img src="https://cdn.jsdelivr.net/gh/twitter/[email protected]/assets/72x72/2699.png" alt="gear" style="height: 1em;width: 1em;margin: 0 0.05em 0 0.1em;vertical-align: -0.1em;">

`https://pax.deno.dev/<owner>/<repo>[@branch_or_tag]/[path/to/file]` redirects
to
Expand All @@ -32,7 +32,7 @@ Use this bookmarklet in the GitHub repository page to copy URL to
javascript:((d)=>((c,b,l)=>{c.textContent=(([,r="",,,t,f=""])=>`https://pax.deno.dev/${r}${t?"@"+t:""}${f}`)((l.origin+l.pathname).match(/^https:\/\/github\.com\/([^\/]+\/[^\/]+)(\/(tree|blob)\/([^\/]+))?(\/.*)?/)||[]);b.appendChild(c);c.select();d.execCommand("copy");b.removeChild(c);})(d.createElement("textArea"),d.body,location))(document)
```

## Example <img src="https://twemoji.maxcdn.com/v/13.1.0/72x72/1f680.png" alt="rocket" style="height: 1em;width: 1em;margin: 0 0.05em 0 0.1em;vertical-align: -0.1em;">
## Example <img src="https://cdn.jsdelivr.net/gh/twitter/[email protected]/assets/72x72/1f680.png" alt="rocket" style="height: 1em;width: 1em;margin: 0 0.05em 0 0.1em;vertical-align: -0.1em;">

### `mod.ts` on the latest default branch

Expand Down Expand Up @@ -82,6 +82,16 @@ https://pax.deno.dev/owner/repo?d
# https://doc.deno.land/https/raw.githubusercontent.com/owner/repo/master/mod.ts
```

## Prior arts <img src="https://twemoji.maxcdn.com/v/13.1.0/72x72/1f3a8.png" alt="art" style="height: 1em;width: 1em;margin: 0 0.05em 0 0.1em;vertical-align: -0.1em;">
### Display PDF in browser

With the parameter `b` (mnemonic 'browser'), a pdf will be displayed in browser
instead of being downloaded. This flag does not affect other file types. The
main part of URL should follow the syntax above.

```
https://pax.deno.dev/owner/repo/somefile.pdf?b
```

## Prior arts <img src="https://cdn.jsdelivr.net/gh/twitter/[email protected]/assets/72x72/1f3a8.png" alt="art" style="height: 1em;width: 1em;margin: 0 0.05em 0 0.1em;vertical-align: -0.1em;">

- This project is heavily inspired by [Deno PKG](https://denopkg.com/).
Loading
Loading