Skip to content
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
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Bug report
about: Report a problem with Markdown Printer
title: ''
labels: bug
assignees: ''
---

## What happened?

<!-- A clear description of the bug. What did you expect, what happened instead? -->

## Steps to reproduce

1.
2.
3.

## Page (if applicable)

<!-- URL of the page you were trying to save, if it's public. -->

## Diagnostics

<!--
Open the Markdown Printer popup, click "Copy diagnostics" at the bottom,
and paste the JSON here. It contains:

- extension version, browser/OS string, UI language
- usage counters (saveCount, installedAt)
- the last ~200 log entries from the extension

No URLs, page content, or filenames are included.
-->

```json
PASTE DIAGNOSTICS HERE
```

## Pro version (native host) logs β€” optional

<!--
Only relevant if you have the Pro version installed. Attach or paste the
contents of the most recent file in:

~/.markdown-printer/logs/host-YYYY-MM-DD.log
-->
7 changes: 3 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v6
with:
version: 10
version: 11

- name: Setup Node.js
uses: actions/setup-node@v6
Expand Down Expand Up @@ -89,8 +89,7 @@ jobs:
--chrome-extension-id pfplfifdaaaalkefgnknfgoiabegcbmf \
--chrome-client-id "${{ vars.CHROME_CLIENT_ID }}" \
--chrome-client-secret "${{ secrets.CHROME_CLIENT_SECRET }}" \
--chrome-refresh-token "${{ secrets.CHROME_REFRESH_TOKEN }}" \
--chrome-skip-submit-review
--chrome-refresh-token "${{ secrets.CHROME_REFRESH_TOKEN }}"

- name: Skip Chrome publish
if: steps.chrome-check.outputs.needs_publish != 'true'
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
# ESLint 10 needs Node >=20.19, >=22.13, or >=24.
node-version: [20.x, 22.x, 24.x]

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v6
with:
version: 10
version: 11

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
Expand All @@ -46,7 +47,7 @@ jobs:

- name: Upload coverage reports
if: matrix.node-version == '20.x'
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v6
with:
files: ./coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ dist/
*.zip
coverage/
.env

# Generated by build.js β€” sources live in src/
extension-chrome/
extension-firefox/
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dist/
pnpm-lock.yaml
*.zip
.DS_Store
src/turndown.js
extension-*/turndown.js
21 changes: 21 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@
- Ensure all tests pass
- Verify no linting errors

## Version Bump Checklist

**ALWAYS do these before bumping version:**

1. **Update description files** with changelog for new version:
- `description.md` (English)
- `description-fr.md` (French)
- `description-he.md` (Hebrew)
- `description-hi.md` (Hindi)

2. **Bump version** in `package.json` only.
The Chrome and Firefox manifests are generated by `build.js` from
`package.json`, so no manual edits are needed (and `extension-chrome/`
and `extension-firefox/` are gitignored).

3. **Run pre-commit checks**: format, test, lint

4. **Commit and push to develop**

5. **Merge to main** to trigger auto-tag and publish

## Common Commands

```bash
Expand Down
28 changes: 7 additions & 21 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,10 @@ The workflow will automatically run and publish to outdated stores.
### Update versions across all manifests

```bash
# Update version in package.json
# Update version in package.json (the only place β€” extension manifests
# are regenerated by build.js from package.json).
npm version patch # or minor, or major

# Manually update the version in:
# - extension-chrome/manifest.json
# - extension-firefox/manifest.json

# Build and commit
pnpm run build
git add .
Expand All @@ -108,22 +105,11 @@ Publication Summary

### Auto-Submit Behavior

The workflow is configured with `--skip-submit-review` for Chrome and Edge. This means:

- **Uploads are automatic**: New versions are uploaded to the stores
- **Review submission is manual**: You must manually submit for review in each store's dashboard

This prevents errors when a version is already pending review (stores reject new submissions during review).

**To publish a new version:**

1. Run the workflow (uploads to stores)
2. Visit each store's dashboard:
- [Chrome Web Store Developer Dashboard](https://chrome.google.com/webstore/devconsole)
- [Edge Partner Center](https://partner.microsoft.com/en-us/dashboard/microsoftedge/overview)
3. Click "Submit for review" manually
- **Chrome**: uploads are submitted for review automatically.
- **Edge**: uploads use `--edge-skip-submit-review`. Uploads are automatic, but you must click "Submit for review" in the [Edge Partner Center](https://partner.microsoft.com/en-us/dashboard/microsoftedge/overview).
- **Firefox**: automatically submits for review (cannot be skipped).

**Firefox** automatically submits for review (cannot be skipped).
**Note for Chrome:** if a previous version is still under review when the workflow runs, the publish step will fail with "Item already in review". Wait for the pending review to clear before tagging a new version.

## Troubleshooting

Expand All @@ -133,7 +119,7 @@ Wait an hour after setting up the Chrome Web Store API before generating the ref

### Chrome/Edge: "Item already in review"

This shouldn't happen with `--skip-submit-review` enabled. If you see this error, a version is currently under review. Wait for review completion before uploading a new version.
A version is currently under review. Wait for review completion before tagging a new version. (Chrome auto-submits, so this can happen on rapid successive releases.)

### Firefox: "Submission failed"

Expand Down
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ Perfect for documentation, articles, and note-taking.

### Manual Installation (For Development)

> **Note:** The `extension-chrome/` and `extension-firefox/` directories are generated by the build script. Run `pnpm install && pnpm run build` after cloning.

#### Chrome/Edge:

1. Clone or download this repository
1. Clone this repository, then run `pnpm install && pnpm run build`
2. Open Chrome/Edge and navigate to `chrome://extensions/` or `edge://extensions/`
3. Enable "Developer mode" in the top right
4. Click "Load unpacked"
Expand All @@ -43,7 +45,7 @@ Perfect for documentation, articles, and note-taking.

#### Firefox:

1. Clone or download this repository
1. Clone this repository, then run `pnpm install && pnpm run build`
2. Open Firefox and navigate to `about:debugging`
3. Click "This Firefox" in the left sidebar
4. Click "Load Temporary Add-on"
Expand Down Expand Up @@ -130,22 +132,27 @@ Contributions welcome! Feel free to open issues or submit pull requests.

### Development

The extension uses a shared codebase for Chrome and Firefox:
The extension uses a single shared source tree for Chrome and Firefox:

```
src/
background.js # Source of truth - edit this file
extension-chrome/
background.js # Copied from src/ during build
extension-firefox/
background.js # Copied from src/ during build
src/ # Source of truth β€” edit files here
background.js
popup.html
popup.js
turndown.js
icon{16,48,128}.png
_locales/ # Shared translations
build.js # Generates extension-{chrome,firefox}/ from src/

extension-chrome/ # Generated (gitignored)
extension-firefox/ # Generated (gitignored)
```

**Workflow:**

1. Edit `src/background.js`
2. Run `pnpm run build` to copy to both extensions
3. Load unpacked extension from `extension-chrome/` or `extension-firefox/`
1. Edit files in `src/`
2. Run `pnpm run build` to (re)generate `extension-chrome/` and `extension-firefox/`
3. Load the unpacked extension from `extension-chrome/` or `extension-firefox/`
4. Run `pnpm run format && pnpm run test && pnpm run lint` before committing

## πŸ”— Links
Expand Down
13 changes: 7 additions & 6 deletions SOURCE_BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,16 @@ This extension uses the following open-source library:

## Source File Locations

All source files are in the repository root and `extension-firefox/` directory:
All canonical source files live in `src/`. The `extension-firefox/` directory is generated by `build.js` and is gitignored.

- `/build.js` - Build automation script
- `/package.json` - Version and build configuration
- `/extension-firefox/background.js` - Main extension logic
- `/extension-firefox/popup.html` - Popup UI
- `/extension-firefox/popup.js` - Popup script
- `/extension-firefox/turndown.js` - Third-party library (Turndown.js v7.2.0)
- `/extension-firefox/icon*.png` - Extension icons
- `/src/background.js` - Main extension logic
- `/src/popup.html` - Popup UI
- `/src/popup.js` - Popup script
- `/src/turndown.js` - Third-party library (Turndown.js v7.2.0)
- `/src/icon*.png` - Extension icons
- `/_locales/` - Translations (copied into the extension directories by the build)

## Notes

Expand Down
56 changes: 56 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,61 @@
"contextMenuTitle": {
"message": "Save as Markdown",
"description": "Context menu item title"
},
"savingButton": {
"message": "Saving...",
"description": "Save button label while a save is in progress"
},
"savedButton": {
"message": "Saved!",
"description": "Save button label after a successful save"
},
"errorRetry": {
"message": "Error - Try again",
"description": "Save button label after a save failure"
},
"ratingPromptTitle": {
"message": "Enjoying Markdown Printer?",
"description": "Initial rating prompt title"
},
"ratingYes": {
"message": "πŸ‘ Yes",
"description": "Rating prompt positive response"
},
"ratingNo": {
"message": "πŸ‘Ž Not really",
"description": "Rating prompt negative response"
},
"ratingHappyTitle": {
"message": "Great! Mind leaving a quick review?",
"description": "Rating prompt follow-up after positive response"
},
"ratingReviewBtn": {
"message": "Leave a review",
"description": "Button that opens the store review page"
},
"ratingUnhappyTitle": {
"message": "Sorry! What went wrong?",
"description": "Rating prompt follow-up after negative response"
},
"ratingReportBtn": {
"message": "Report an issue",
"description": "Button that opens the GitHub issue tracker"
},
"ratingDismiss": {
"message": "Dismiss",
"description": "Accessible label for the rating prompt close button"
},
"copyDiagnostics": {
"message": "Copy diagnostics",
"description": "Button that copies the diagnostic bundle to the clipboard"
},
"diagnosticsCopied": {
"message": "Copied!",
"description": "Diagnostics button label after a successful copy"
},
"diagnosticsCopyFailed": {
"message": "Copy failed",
"description": "Diagnostics button label after a failed copy"
}
}
Loading