forked from mozilla/readability
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve contributing documentation and integrate release-it.
- Loading branch information
Showing
7 changed files
with
1,951 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/benchmarks/ | ||
/test/ | ||
.gitattributes | ||
.travis.yml | ||
.release-it.json | ||
.taskcluster.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"plugins": { | ||
"@release-it/keep-a-changelog": { | ||
"filename": "CHANGELOG.md" | ||
} | ||
}, | ||
"github": { | ||
"release": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Changelog | ||
|
||
Notable changes to readability will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project attempts to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
For the purposes of Semantic Versioning, the readability output object for a given | ||
input document is not considered a stable API. That is, minor version increments | ||
may change this output. Patch version increments will only do so in ways that are | ||
strict improvements (e.g. from empty strings or exceptions to something more | ||
reasonable). | ||
|
||
## [Unreleased] | ||
|
||
### Added | ||
|
||
- `isProbablyReaderable` can now take an optional options object to configure it, | ||
allowing you to specify the minimum content length, minimum score, and how to | ||
check if nodes are visible. | ||
|
||
- Better support for [deeply-nested content](https://github.com/mozilla/readability/pull/611). | ||
|
||
- Readability is now more likely to [keep tables of content](https://github.com/mozilla/readability/pull/646). | ||
|
||
- Better support for [content in `<code>` tags](https://github.com/mozilla/readability/pull/647). | ||
|
||
- Readability (finally) no longer [throws away all `<h1>` tags](https://github.com/mozilla/readability/pull/650). | ||
|
||
### Changed | ||
|
||
- JSON-LD [support for multiple authors](https://github.com/mozilla/readability/pull/618) | ||
was improved. | ||
|
||
- Elements with roles `menu`, `menubar`, `complementary`, `navigation`, `alert`, | ||
`alertdialog`, `dialog` will [all be removed](https://github.com/mozilla/readability/pull/619). | ||
|
||
|
||
## [0.3.0] - 2020-08-05 | ||
|
||
The first version that was published on NPM. | ||
|
||
Previously, we did not consistently version anything, | ||
nor did we publish to NPM. | ||
|
||
At some point, we may wish to expand this changelog into the past. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Contributing | ||
|
||
[](https://community-tc.services.mozilla.com/api/github/v1/repository/mozilla/readability/master/latest) | ||
|
||
For outstanding issues, see the issue list in this repo, as well as this [bug list](https://bugzilla.mozilla.org/buglist.cgi?component=Reader%20Mode&product=Toolkit&bug_status=__open__&limit=0). | ||
|
||
Any changes to the main code should be reviewed by an [appropriate Firefox/toolkit peer](https://wiki.mozilla.org/Modules/Firefox), such as [@gijsk](https://github.com/gijsk), since these changes will be merged to mozilla-central and shipped in Firefox. | ||
|
||
To test local changes to Readability.js, you can use the [automated tests](#tests). | ||
|
||
## Tests | ||
|
||
Please run [eslint](http://eslint.org/) as a first check that your changes are valid JS and adhere to our style guidelines: | ||
|
||
$ npm run lint | ||
|
||
|
||
To run the test suite: | ||
|
||
$ npm test | ||
|
||
To run a specific test page by its name: | ||
|
||
$ npm test -- -g 001 | ||
|
||
To run the test suite in TDD mode: | ||
|
||
$ npm test -- -w | ||
|
||
Combo time: | ||
|
||
$ npm test -- -w -g 001 | ||
|
||
### Add new tests | ||
|
||
There's a [node script](https://github.com/mozilla/readability/blob/master/test/generate-testcase.js) to help you create new tests. | ||
You can run it using: | ||
|
||
$ node test/generate-testcase.js slug https://example.com/article | ||
|
||
Replacing `slug` with the identifier the test should use, and providing a URL | ||
to an actual article on which the test should be based. | ||
|
||
## Benchmarks | ||
|
||
Benchmarks for all test pages: | ||
|
||
$ npm run perf | ||
|
||
Reference benchmark: | ||
|
||
$ npm run perf-reference | ||
|
||
## Pull Requests | ||
|
||
We're always happy to see pull requests to improve readability. | ||
|
||
Please ensure you run the linter and [tests](#tests) before submitting a PR. | ||
|
||
If you're changing the algorithm to fix a specific page/article, please | ||
[add new tests](#add-new-tests) for the case you're fixing, so we avoid | ||
breaking it in future. | ||
|
||
## Steps to release | ||
|
||
1. Ensure [CHANGELOG.md](CHANGELOG.md) is up-to-date. ``git log v`npm view . version`...master `` may help with this. | ||
2. Run `npm run release` to create a release, which should: | ||
2a. `npm version [patch | minor | major]`, depending on the nature of the changes according to | ||
[semver](https://semver.org/). This will bump the version in `package.json` and `package-lock.json` | ||
and create a commit and Git tag for the release. | ||
2b. `npm publish` to push the release to the npm registry. | ||
2c. `git push origin head --follow-tags` to push the new commit and tag to GitHub. | ||
|
||
## Keeping a changelog | ||
|
||
Ensure significant changes are added to `CHANGELOG.md`. Do not add | ||
changes that only affect tests or documentation. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.