Skip to content

Commit

Permalink
Add metadata, documentation, logo and screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaprsd committed Apr 14, 2022
1 parent 5c43599 commit a4d10ce
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 0 deletions.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
![doqment icon](docs/logo.png)

# doqment

*doqment* (pronounced as *doc-HUE-ment*) is a custom deployment of the
[PDF.js][1] generic viewer with [*doq*][2] reader mode add-on (that lets you
change the PDF's colors) on top, packaged as an extension for Firefox. It
replaces the built-in PDF.js viewer as the default PDF viewer application.

Here is the demo PDF rendered in *Solarized Light* color scheme:

![Screenshot of doqment running in Firefox](docs/grabs/solarized-light.png)

View [more screenshots](docs/gallery.md#color-schemes).

## Development and testing

It is recommended to disable the built-in viewer while this extension is
enabled to avoid funny and weird behaviours while opening/downloading PDFs.
(Go to *Settings* -> *Files and Applications* -> set the *Action* for PDF to
something other than *Open in Firefox*).

1. Clone this repo recursively (to get the submodules)
2. Hack to your heart's content
3. Run the `pack.sh` script from the repo root
4. Install the created Zip file from `about:debugging` (or using `web-ext`)

## Limitations

Compared with the viewer baked right into Firefox's code, an extension is a lot
less previleged and hence, has certain limitations:

1. Cannot load local files via the `file:///` scheme. The user has to first
open the extension's viewer in a tab and use the viewer's UI to open them.
(hence a browser toolbar button is provided for this).
2. Cannot use the integrated Findbar to search for text in PDF.
3. The address bar shows an ugly extension URL instead of the original PDF URL.

## Rationale

As the built-in viewer of Firefox is a previleged page, extensions cannot
modify it. Thus a custom deployment is currently the only way to ship add-ons
to the viewer (other than getting your patch merged into PDF.js).

This project can also be used as a boilerplate by anyone else wishing to
develop their own awesome crazy add-on for the PDF.js viewer.

For the rationale behind reader mode see the *doq* [Readme][3].

Happy PDF Reading!

---

[1]: https://mozilla.github.io/pdf.js/web/viewer.html
[2]: https://github.com/shivaprsd/doq
[3]: https://github.com/shivaprsd/doq#why-doq
27 changes: 27 additions & 0 deletions docs/gallery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Screenshots

## Interface

### Firefox Toolbar Button

![Firefox window showing toolbar button](grabs/toolbar-button.png)

### Reader Mode Toolbar

![Screenshot of the reader mode toolbar](grabs/reader-toolbar.png)

## Color schemes

### Solarized

![PDF rendered in Solarized dark scheme](grabs/solarized-dark.png)

### Firefox Reader View

![PDF rendered in Firefox sepia scheme](grabs/firefox-sepia.png)

### Safari Reader View

![PDF rendered in Safari gray scheme](grabs/safari-gray.png)

---
Binary file added docs/grabs/firefox-sepia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/grabs/reader-toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/grabs/safari-gray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/grabs/solarized-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/grabs/solarized-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/grabs/toolbar-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "doqment",
"version": "0.1",
"description": "Mozilla's HTML5 PDF Viewer with Reader-mode add-on.",
"homepage": "https://github.com/shivaprsd/doqment",
"repository": "github:shivaprsd/doqment",
"keywords": [ "doq", "pdf.js", "browser extension", "firefox" ],
"license": "MIT",
"author": "Shiva Prasad <[email protected]>",
"contributors": [],
"dependencies": {
"doq": "shivaprsd/doq#master",
"pdfjs": "shivaprsd/pdfjs-generic#main"
}
}

0 comments on commit a4d10ce

Please sign in to comment.