diff --git a/src/extractor/generic/extract-best-node.js b/src/extractor/generic/content/extract-best-node.js similarity index 100% rename from src/extractor/generic/extract-best-node.js rename to src/extractor/generic/content/extract-best-node.js diff --git a/src/extractor/generic/extract-best-node.test.js b/src/extractor/generic/content/extract-best-node.test.js similarity index 100% rename from src/extractor/generic/extract-best-node.test.js rename to src/extractor/generic/content/extract-best-node.test.js diff --git a/src/extractor/generic/extract-clean-node.js b/src/extractor/generic/content/extract-clean-node.js similarity index 100% rename from src/extractor/generic/extract-clean-node.js rename to src/extractor/generic/content/extract-clean-node.js diff --git a/src/extractor/generic/extract-clean-node.test.js b/src/extractor/generic/content/extract-clean-node.test.js similarity index 100% rename from src/extractor/generic/extract-clean-node.test.js rename to src/extractor/generic/content/extract-clean-node.test.js diff --git a/src/extractor/generic/content-extractor.js b/src/extractor/generic/content/extractor.js similarity index 97% rename from src/extractor/generic/content-extractor.js rename to src/extractor/generic/content/extractor.js index 4c33a347..32528339 100644 --- a/src/extractor/generic/content-extractor.js +++ b/src/extractor/generic/content/extractor.js @@ -2,7 +2,7 @@ import cheerio from 'cheerio' import 'babel-polyfill' import extractBestNode from './extract-best-node' -import nodeIsSufficient from '../utils/node-is-sufficient' +import nodeIsSufficient from '../../utils/node-is-sufficient' import extractCleanNode from './extract-clean-node' import { normalizeSpaces } from './utils/text' diff --git a/src/extractor/generic/content-extractor.test.js b/src/extractor/generic/content/extractor.test.js similarity index 88% rename from src/extractor/generic/content-extractor.test.js rename to src/extractor/generic/content/extractor.test.js index c7351aac..a0ff87b0 100644 --- a/src/extractor/generic/content-extractor.test.js +++ b/src/extractor/generic/content/extractor.test.js @@ -4,7 +4,7 @@ import fs from 'fs' import { clean } from './utils/dom/test-helpers' -import GenericContentExtractor from './content-extractor' +import GenericContentExtractor from './extractor' describe('GenericContentExtractor', () => { describe('parse(html, opts)', () => { diff --git a/src/extractor/generic/index.js b/src/extractor/generic/content/index.js similarity index 100% rename from src/extractor/generic/index.js rename to src/extractor/generic/content/index.js diff --git a/src/extractor/generic/utils/constants.js b/src/extractor/generic/content/utils/constants.js similarity index 100% rename from src/extractor/generic/utils/constants.js rename to src/extractor/generic/content/utils/constants.js diff --git a/src/extractor/generic/utils/dom/brs-to-ps.js b/src/extractor/generic/content/utils/dom/brs-to-ps.js similarity index 100% rename from src/extractor/generic/utils/dom/brs-to-ps.js rename to src/extractor/generic/content/utils/dom/brs-to-ps.js diff --git a/src/extractor/generic/utils/dom/brs-to-ps.test.js b/src/extractor/generic/content/utils/dom/brs-to-ps.test.js similarity index 100% rename from src/extractor/generic/utils/dom/brs-to-ps.test.js rename to src/extractor/generic/content/utils/dom/brs-to-ps.test.js diff --git a/src/extractor/generic/utils/dom/clean-attributes.js b/src/extractor/generic/content/utils/dom/clean-attributes.js similarity index 100% rename from src/extractor/generic/utils/dom/clean-attributes.js rename to src/extractor/generic/content/utils/dom/clean-attributes.js diff --git a/src/extractor/generic/utils/dom/clean-attributes.test.js b/src/extractor/generic/content/utils/dom/clean-attributes.test.js similarity index 100% rename from src/extractor/generic/utils/dom/clean-attributes.test.js rename to src/extractor/generic/content/utils/dom/clean-attributes.test.js diff --git a/src/extractor/generic/utils/dom/clean-h-ones.js b/src/extractor/generic/content/utils/dom/clean-h-ones.js similarity index 100% rename from src/extractor/generic/utils/dom/clean-h-ones.js rename to src/extractor/generic/content/utils/dom/clean-h-ones.js diff --git a/src/extractor/generic/utils/dom/clean-h-ones.test.js b/src/extractor/generic/content/utils/dom/clean-h-ones.test.js similarity index 100% rename from src/extractor/generic/utils/dom/clean-h-ones.test.js rename to src/extractor/generic/content/utils/dom/clean-h-ones.test.js diff --git a/src/extractor/generic/utils/dom/clean-headers.js b/src/extractor/generic/content/utils/dom/clean-headers.js similarity index 100% rename from src/extractor/generic/utils/dom/clean-headers.js rename to src/extractor/generic/content/utils/dom/clean-headers.js diff --git a/src/extractor/generic/utils/dom/clean-headers.test.js b/src/extractor/generic/content/utils/dom/clean-headers.test.js similarity index 100% rename from src/extractor/generic/utils/dom/clean-headers.test.js rename to src/extractor/generic/content/utils/dom/clean-headers.test.js diff --git a/src/extractor/generic/utils/dom/clean-images.js b/src/extractor/generic/content/utils/dom/clean-images.js similarity index 100% rename from src/extractor/generic/utils/dom/clean-images.js rename to src/extractor/generic/content/utils/dom/clean-images.js diff --git a/src/extractor/generic/utils/dom/clean-images.test.js b/src/extractor/generic/content/utils/dom/clean-images.test.js similarity index 100% rename from src/extractor/generic/utils/dom/clean-images.test.js rename to src/extractor/generic/content/utils/dom/clean-images.test.js diff --git a/src/extractor/generic/utils/dom/clean-tags.js b/src/extractor/generic/content/utils/dom/clean-tags.js similarity index 100% rename from src/extractor/generic/utils/dom/clean-tags.js rename to src/extractor/generic/content/utils/dom/clean-tags.js diff --git a/src/extractor/generic/utils/dom/clean-tags.test.js b/src/extractor/generic/content/utils/dom/clean-tags.test.js similarity index 100% rename from src/extractor/generic/utils/dom/clean-tags.test.js rename to src/extractor/generic/content/utils/dom/clean-tags.test.js diff --git a/src/extractor/generic/utils/dom/convert-to-paragraphs.js b/src/extractor/generic/content/utils/dom/convert-to-paragraphs.js similarity index 100% rename from src/extractor/generic/utils/dom/convert-to-paragraphs.js rename to src/extractor/generic/content/utils/dom/convert-to-paragraphs.js diff --git a/src/extractor/generic/utils/dom/convert-to-paragraphs.test.js b/src/extractor/generic/content/utils/dom/convert-to-paragraphs.test.js similarity index 100% rename from src/extractor/generic/utils/dom/convert-to-paragraphs.test.js rename to src/extractor/generic/content/utils/dom/convert-to-paragraphs.test.js diff --git a/src/extractor/generic/utils/dom/index.js b/src/extractor/generic/content/utils/dom/index.js similarity index 100% rename from src/extractor/generic/utils/dom/index.js rename to src/extractor/generic/content/utils/dom/index.js diff --git a/src/extractor/generic/utils/dom/link-density.js b/src/extractor/generic/content/utils/dom/link-density.js similarity index 100% rename from src/extractor/generic/utils/dom/link-density.js rename to src/extractor/generic/content/utils/dom/link-density.js diff --git a/src/extractor/generic/utils/dom/link-density.test.js b/src/extractor/generic/content/utils/dom/link-density.test.js similarity index 100% rename from src/extractor/generic/utils/dom/link-density.test.js rename to src/extractor/generic/content/utils/dom/link-density.test.js diff --git a/src/extractor/generic/utils/dom/node-is-sufficient.js b/src/extractor/generic/content/utils/dom/node-is-sufficient.js similarity index 100% rename from src/extractor/generic/utils/dom/node-is-sufficient.js rename to src/extractor/generic/content/utils/dom/node-is-sufficient.js diff --git a/src/extractor/generic/utils/dom/paragraphize.js b/src/extractor/generic/content/utils/dom/paragraphize.js similarity index 100% rename from src/extractor/generic/utils/dom/paragraphize.js rename to src/extractor/generic/content/utils/dom/paragraphize.js diff --git a/src/extractor/generic/utils/dom/paragraphize.test.js b/src/extractor/generic/content/utils/dom/paragraphize.test.js similarity index 100% rename from src/extractor/generic/utils/dom/paragraphize.test.js rename to src/extractor/generic/content/utils/dom/paragraphize.test.js diff --git a/src/extractor/generic/utils/dom/remove-empty.js b/src/extractor/generic/content/utils/dom/remove-empty.js similarity index 100% rename from src/extractor/generic/utils/dom/remove-empty.js rename to src/extractor/generic/content/utils/dom/remove-empty.js diff --git a/src/extractor/generic/utils/dom/remove-empty.test.js b/src/extractor/generic/content/utils/dom/remove-empty.test.js similarity index 100% rename from src/extractor/generic/utils/dom/remove-empty.test.js rename to src/extractor/generic/content/utils/dom/remove-empty.test.js diff --git a/src/extractor/generic/utils/dom/rewrite-top-level.js b/src/extractor/generic/content/utils/dom/rewrite-top-level.js similarity index 100% rename from src/extractor/generic/utils/dom/rewrite-top-level.js rename to src/extractor/generic/content/utils/dom/rewrite-top-level.js diff --git a/src/extractor/generic/utils/dom/rewrite-top-level.test.js b/src/extractor/generic/content/utils/dom/rewrite-top-level.test.js similarity index 100% rename from src/extractor/generic/utils/dom/rewrite-top-level.test.js rename to src/extractor/generic/content/utils/dom/rewrite-top-level.test.js diff --git a/src/extractor/generic/utils/dom/strip-junk-tags.js b/src/extractor/generic/content/utils/dom/strip-junk-tags.js similarity index 100% rename from src/extractor/generic/utils/dom/strip-junk-tags.js rename to src/extractor/generic/content/utils/dom/strip-junk-tags.js diff --git a/src/extractor/generic/utils/dom/strip-junk-tags.test.js b/src/extractor/generic/content/utils/dom/strip-junk-tags.test.js similarity index 100% rename from src/extractor/generic/utils/dom/strip-junk-tags.test.js rename to src/extractor/generic/content/utils/dom/strip-junk-tags.test.js diff --git a/src/extractor/generic/utils/dom/strip-unlikely-candidates.js b/src/extractor/generic/content/utils/dom/strip-unlikely-candidates.js similarity index 100% rename from src/extractor/generic/utils/dom/strip-unlikely-candidates.js rename to src/extractor/generic/content/utils/dom/strip-unlikely-candidates.js diff --git a/src/extractor/generic/utils/dom/strip-unlikely-candidates.test.js b/src/extractor/generic/content/utils/dom/strip-unlikely-candidates.test.js similarity index 100% rename from src/extractor/generic/utils/dom/strip-unlikely-candidates.test.js rename to src/extractor/generic/content/utils/dom/strip-unlikely-candidates.test.js diff --git a/src/extractor/generic/utils/dom/test-helpers.js b/src/extractor/generic/content/utils/dom/test-helpers.js similarity index 100% rename from src/extractor/generic/utils/dom/test-helpers.js rename to src/extractor/generic/content/utils/dom/test-helpers.js diff --git a/src/extractor/generic/utils/fixtures/html.js b/src/extractor/generic/content/utils/fixtures/html.js similarity index 100% rename from src/extractor/generic/utils/fixtures/html.js rename to src/extractor/generic/content/utils/fixtures/html.js diff --git a/src/extractor/generic/utils/index.js b/src/extractor/generic/content/utils/index.js similarity index 100% rename from src/extractor/generic/utils/index.js rename to src/extractor/generic/content/utils/index.js diff --git a/src/extractor/generic/utils/scoring/add-score.js b/src/extractor/generic/content/utils/scoring/add-score.js similarity index 100% rename from src/extractor/generic/utils/scoring/add-score.js rename to src/extractor/generic/content/utils/scoring/add-score.js diff --git a/src/extractor/generic/utils/scoring/add-score.test.js b/src/extractor/generic/content/utils/scoring/add-score.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/add-score.test.js rename to src/extractor/generic/content/utils/scoring/add-score.test.js diff --git a/src/extractor/generic/utils/scoring/add-to-parent.js b/src/extractor/generic/content/utils/scoring/add-to-parent.js similarity index 100% rename from src/extractor/generic/utils/scoring/add-to-parent.js rename to src/extractor/generic/content/utils/scoring/add-to-parent.js diff --git a/src/extractor/generic/utils/scoring/add-to-parent.test.js b/src/extractor/generic/content/utils/scoring/add-to-parent.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/add-to-parent.test.js rename to src/extractor/generic/content/utils/scoring/add-to-parent.test.js diff --git a/src/extractor/generic/utils/scoring/find-top-candidate.js b/src/extractor/generic/content/utils/scoring/find-top-candidate.js similarity index 100% rename from src/extractor/generic/utils/scoring/find-top-candidate.js rename to src/extractor/generic/content/utils/scoring/find-top-candidate.js diff --git a/src/extractor/generic/utils/scoring/find-top-candidate.test.js b/src/extractor/generic/content/utils/scoring/find-top-candidate.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/find-top-candidate.test.js rename to src/extractor/generic/content/utils/scoring/find-top-candidate.test.js diff --git a/src/extractor/generic/utils/scoring/fixtures/html.js b/src/extractor/generic/content/utils/scoring/fixtures/html.js similarity index 100% rename from src/extractor/generic/utils/scoring/fixtures/html.js rename to src/extractor/generic/content/utils/scoring/fixtures/html.js diff --git a/src/extractor/generic/utils/scoring/get-or-init-score.js b/src/extractor/generic/content/utils/scoring/get-or-init-score.js similarity index 100% rename from src/extractor/generic/utils/scoring/get-or-init-score.js rename to src/extractor/generic/content/utils/scoring/get-or-init-score.js diff --git a/src/extractor/generic/utils/scoring/get-or-init-score.test.js b/src/extractor/generic/content/utils/scoring/get-or-init-score.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/get-or-init-score.test.js rename to src/extractor/generic/content/utils/scoring/get-or-init-score.test.js diff --git a/src/extractor/generic/utils/scoring/get-score.js b/src/extractor/generic/content/utils/scoring/get-score.js similarity index 100% rename from src/extractor/generic/utils/scoring/get-score.js rename to src/extractor/generic/content/utils/scoring/get-score.js diff --git a/src/extractor/generic/utils/scoring/get-score.test.js b/src/extractor/generic/content/utils/scoring/get-score.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/get-score.test.js rename to src/extractor/generic/content/utils/scoring/get-score.test.js diff --git a/src/extractor/generic/utils/scoring/get-weight.js b/src/extractor/generic/content/utils/scoring/get-weight.js similarity index 100% rename from src/extractor/generic/utils/scoring/get-weight.js rename to src/extractor/generic/content/utils/scoring/get-weight.js diff --git a/src/extractor/generic/utils/scoring/get-weight.test.js b/src/extractor/generic/content/utils/scoring/get-weight.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/get-weight.test.js rename to src/extractor/generic/content/utils/scoring/get-weight.test.js diff --git a/src/extractor/generic/utils/scoring/index.js b/src/extractor/generic/content/utils/scoring/index.js similarity index 100% rename from src/extractor/generic/utils/scoring/index.js rename to src/extractor/generic/content/utils/scoring/index.js diff --git a/src/extractor/generic/utils/scoring/score-commas.js b/src/extractor/generic/content/utils/scoring/score-commas.js similarity index 100% rename from src/extractor/generic/utils/scoring/score-commas.js rename to src/extractor/generic/content/utils/scoring/score-commas.js diff --git a/src/extractor/generic/utils/scoring/score-commas.test.js b/src/extractor/generic/content/utils/scoring/score-commas.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/score-commas.test.js rename to src/extractor/generic/content/utils/scoring/score-commas.test.js diff --git a/src/extractor/generic/utils/scoring/score-content.js b/src/extractor/generic/content/utils/scoring/score-content.js similarity index 100% rename from src/extractor/generic/utils/scoring/score-content.js rename to src/extractor/generic/content/utils/scoring/score-content.js diff --git a/src/extractor/generic/utils/scoring/score-content.test.js b/src/extractor/generic/content/utils/scoring/score-content.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/score-content.test.js rename to src/extractor/generic/content/utils/scoring/score-content.test.js diff --git a/src/extractor/generic/utils/scoring/score-length.js b/src/extractor/generic/content/utils/scoring/score-length.js similarity index 100% rename from src/extractor/generic/utils/scoring/score-length.js rename to src/extractor/generic/content/utils/scoring/score-length.js diff --git a/src/extractor/generic/utils/scoring/score-length.test.js b/src/extractor/generic/content/utils/scoring/score-length.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/score-length.test.js rename to src/extractor/generic/content/utils/scoring/score-length.test.js diff --git a/src/extractor/generic/utils/scoring/score-node.js b/src/extractor/generic/content/utils/scoring/score-node.js similarity index 100% rename from src/extractor/generic/utils/scoring/score-node.js rename to src/extractor/generic/content/utils/scoring/score-node.js diff --git a/src/extractor/generic/utils/scoring/score-node.test.js b/src/extractor/generic/content/utils/scoring/score-node.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/score-node.test.js rename to src/extractor/generic/content/utils/scoring/score-node.test.js diff --git a/src/extractor/generic/utils/scoring/score-paragraph.js b/src/extractor/generic/content/utils/scoring/score-paragraph.js similarity index 100% rename from src/extractor/generic/utils/scoring/score-paragraph.js rename to src/extractor/generic/content/utils/scoring/score-paragraph.js diff --git a/src/extractor/generic/utils/scoring/score-paragraph.test.js b/src/extractor/generic/content/utils/scoring/score-paragraph.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/score-paragraph.test.js rename to src/extractor/generic/content/utils/scoring/score-paragraph.test.js diff --git a/src/extractor/generic/utils/scoring/set-score.js b/src/extractor/generic/content/utils/scoring/set-score.js similarity index 100% rename from src/extractor/generic/utils/scoring/set-score.js rename to src/extractor/generic/content/utils/scoring/set-score.js diff --git a/src/extractor/generic/utils/scoring/set-score.test.js b/src/extractor/generic/content/utils/scoring/set-score.test.js similarity index 100% rename from src/extractor/generic/utils/scoring/set-score.test.js rename to src/extractor/generic/content/utils/scoring/set-score.test.js diff --git a/src/extractor/generic/utils/text/index.js b/src/extractor/generic/content/utils/text/index.js similarity index 100% rename from src/extractor/generic/utils/text/index.js rename to src/extractor/generic/content/utils/text/index.js diff --git a/src/extractor/generic/utils/text/normalize-spaces.js b/src/extractor/generic/content/utils/text/normalize-spaces.js similarity index 100% rename from src/extractor/generic/utils/text/normalize-spaces.js rename to src/extractor/generic/content/utils/text/normalize-spaces.js diff --git a/src/extractor/generic/utils/text/normalize-spaces.test.js b/src/extractor/generic/content/utils/text/normalize-spaces.test.js similarity index 100% rename from src/extractor/generic/utils/text/normalize-spaces.test.js rename to src/extractor/generic/content/utils/text/normalize-spaces.test.js