History

Clean up docs directory and fix links

Jed Fox committed 7 years ago

Commit 73eab0b1 parent 676f4f67 files · +133 −135Browse files

Showing the changes to docs (6 of 7 files). Show all

Unified · Split

6 files
  1. docs/Filter-Reference.md +42 −44
  2. docs/Home.md +0 −23
  3. docs/Scraper-Reference.md +57 −59
  4. docs/_Footer.md +0 −1
  5. docs/adding-docs.md +7 −7
  6. docs/maintainers.md +0 −0
docs/Filter-Reference.md+42−44
@@ -1,13 +1,11 @@
1---
2
3**Table of contents:**1**Table of contents:**
4 2
5* [Overview](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#overview)3* [Overview](#overview)
6* [Instance methods](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#instance-methods)4* [Instance methods](#instance-methods)
7* [Core filters](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#core-filters)5* [Core filters](#core-filters)
8* [Custom filters](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#custom-filters)6* [Custom filters](#custom-filters)
9 - [CleanHtmlFilter](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#cleanhtmlfilter)7 - [CleanHtmlFilter](#cleanhtmlfilter)
10 - [EntriesFilter](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#entriesfilter)8 - [EntriesFilter](#entriesfilter)
11 9
12## Overview10## Overview
13 11
@@ -25,52 +23,52 @@ module Docs · 11 unmodified lines
25end23end
26```24```
27 25
28Filters which manipulate the Nokogiri node object (`doc` and related methods) are _HTML filters_ and must not manipulate the HTML string (`html`). Vice-versa, filters which manipulate the string representation of the document are _text filters_ and must not manipulate the Nokogiri node object. The two types are divided into two stacks within the scrapers. These stacks are then combined into a pipeline that calls the HTML filters before the text filters (more details [here](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference#filter-stacks)). This is to avoid parsing the document multiple times.26Filters which manipulate the Nokogiri node object (`doc` and related methods) are _HTML filters_ and must not manipulate the HTML string (`html`). Vice-versa, filters which manipulate the string representation of the document are _text filters_ and must not manipulate the Nokogiri node object. The two types are divided into two stacks within the scrapers. These stacks are then combined into a pipeline that calls the HTML filters before the text filters (more details [here](./scraper-reference.md#filter-stacks)). This is to avoid parsing the document multiple times.
29 27
30The `call` method must return either `doc` or `html`, depending on the type of filter.28The `call` method must return either `doc` or `html`, depending on the type of filter.
31 29
32## Instance methods30## Instance methods
33 31
34* `doc` [Nokogiri::XML::Node] 32* `doc` [Nokogiri::XML::Node]
35 The Nokogiri representation of the container element. 33 The Nokogiri representation of the container element.
36 See [Nokogiri's API docs](http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/Node) for the list of available methods.34 See [Nokogiri's API docs](http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/Node) for the list of available methods.
37 35
38* `html` [String] 36* `html` [String]
39 The string representation of the container element.37 The string representation of the container element.
40 38
41* `context` [Hash] **(frozen)** 39* `context` [Hash] **(frozen)**
42 The scraper's `options` along with a few additional keys: `:base_url`, `:root_url`, `:root_page` and `:url`.40 The scraper's `options` along with a few additional keys: `:base_url`, `:root_url`, `:root_page` and `:url`.
43 41
44* `result` [Hash] 42* `result` [Hash]
45 Used to store the page's metadata and pass back information to the scraper. 43 Used to store the page's metadata and pass back information to the scraper.
46 Possible keys:44 Possible keys:
47 45
48 - `:path` — the page's normalized path46 - `:path` — the page's normalized path
49 - `:store_path` — the path where the page will be stored (equal to `:path` with `.html` at the end)47 - `:store_path` — the path where the page will be stored (equal to `:path` with `.html` at the end)
50 - `:internal_urls` — the list of distinct internal URLs found within the page48 - `:internal_urls` — the list of distinct internal URLs found within the page
51 - `:entries` — the [`Entry`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/core/models/entry.rb) objects to add to the index49 - `:entries` — the [`Entry`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/core/models/entry.rb) objects to add to the index
52 50
53* `css`, `at_css`, `xpath`, `at_xpath` 51* `css`, `at_css`, `xpath`, `at_xpath`
54 Shortcuts for `doc.css`, `doc.xpath`, etc.52 Shortcuts for `doc.css`, `doc.xpath`, etc.
55 53
56* `base_url`, `current_url`, `root_url` [Docs::URL] 54* `base_url`, `current_url`, `root_url` [Docs::URL]
57 Shortcuts for `context[:base_url]`, `context[:url]`, and `context[:root_url]` respectively.55 Shortcuts for `context[:base_url]`, `context[:url]`, and `context[:root_url]` respectively.
58 56
59* `root_path` [String] 57* `root_path` [String]
60 Shortcut for `context[:root_path]`.58 Shortcut for `context[:root_path]`.
61 59
62* `subpath` [String] 60* `subpath` [String]
63 The sub-path from the base URL of the current URL. 61 The sub-path from the base URL of the current URL.
64 _Example: if `base_url` equals `example.com/docs` and `current_url` equals `example.com/docs/file?raw`, the returned value is `/file`._62 _Example: if `base_url` equals `example.com/docs` and `current_url` equals `example.com/docs/file?raw`, the returned value is `/file`._
65 63
66* `slug` [String] 64* `slug` [String]
67 The `subpath` removed of any leading slash or `.html` extension. 65 The `subpath` removed of any leading slash or `.html` extension.
68 _Example: if `subpath` equals `/dir/file.html`, the returned value is `dir/file`._66 _Example: if `subpath` equals `/dir/file.html`, the returned value is `dir/file`._
69 67
70* `root_page?` [Boolean] 68* `root_page?` [Boolean]
71 Returns `true` if the current page is the root page.69 Returns `true` if the current page is the root page.
72 70
73* `initial_page?` [Boolean] 71* `initial_page?` [Boolean]
74 Returns `true` if the current page is the root page or its subpath is one of the scraper's `initial_paths`.72 Returns `true` if the current page is the root page or its subpath is one of the scraper's `initial_paths`.
75 73
76## Core filters74## Core filters
@@ -148,34 +146,34 @@ The following two models are used under the hood to represent the metadata: · 71 unmodified lines
148 146
149Each scraper must implement its own `EntriesFilter` by subclassing the [`Docs::EntriesFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/entries.rb) class. The base class already implements the `call` method and includes four methods which the subclasses can override:147Each scraper must implement its own `EntriesFilter` by subclassing the [`Docs::EntriesFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/entries.rb) class. The base class already implements the `call` method and includes four methods which the subclasses can override:
150 148
151* `get_name` [String] 149* `get_name` [String]
152 The name of the default entry (aka. the page's name). 150 The name of the default entry (aka. the page's name).
153 It is usually guessed from the `slug` (documented above) or by searching the HTML markup. 151 It is usually guessed from the `slug` (documented above) or by searching the HTML markup.
154 **Default:** modified version of `slug` (underscores are replaced with spaces and forward slashes with dots)152 **Default:** modified version of `slug` (underscores are replaced with spaces and forward slashes with dots)
155 153
156* `get_type` [String] 154* `get_type` [String]
157 The type of the default entry (aka. the page's type). 155 The type of the default entry (aka. the page's type).
158 Entries without a type can be searched for but won't be listed in the app's sidebar (unless no other entries have a type). 156 Entries without a type can be searched for but won't be listed in the app's sidebar (unless no other entries have a type).
159 **Default:** `nil`157 **Default:** `nil`
160 158
161* `include_default_entry?` [Boolean] 159* `include_default_entry?` [Boolean]
162 Whether to include the default entry. 160 Whether to include the default entry.
163 Used when a page consists of multiple entries (returned by `additional_entries`) but doesn't have a name/type of its own, or to remove a page from the index (if it has no additional entries), in which case it won't be copied on the local filesystem and any link to it in the other pages will be broken (as explained on the [Scraper Reference](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference) page, this is used to keep the `:skip` / `:skip_patterns` options to a maintainable size, or if the page includes links that can't reached from anywhere else). 161 Used when a page consists of multiple entries (returned by `additional_entries`) but doesn't have a name/type of its own, or to remove a page from the index (if it has no additional entries), in which case it won't be copied on the local filesystem and any link to it in the other pages will be broken (as explained on the [Scraper Reference](./scraper-reference.md) page, this is used to keep the `:skip` / `:skip_patterns` options to a maintainable size, or if the page includes links that can't reached from anywhere else).
164 **Default:** `true`162 **Default:** `true`
165 163
166* `additional_entries` [Array] 164* `additional_entries` [Array]
167 The list of additional entries. 165 The list of additional entries.
168 Each entry is represented by an Array of three attributes: its name, fragment identifier, and type. The fragment identifier refers to the `id` attribute of the HTML element (usually a heading) that the entry relates to. It is combined with the page's path to become the entry's path. If absent or `nil`, the page's path is used. If the type is absent or `nil`, the default `type` is used. 166 Each entry is represented by an Array of three attributes: its name, fragment identifier, and type. The fragment identifier refers to the `id` attribute of the HTML element (usually a heading) that the entry relates to. It is combined with the page's path to become the entry's path. If absent or `nil`, the page's path is used. If the type is absent or `nil`, the default `type` is used.
169 Example: `[ ['One'], ['Two', 'id'], ['Three', nil, 'type'] ]` adds three additional entries, the first one named "One" with the default path and type, the second one named "Two" with the URL fragment "#id" and the default type, and the third one named "Three" with the default path and the type "type". 167 Example: `[ ['One'], ['Two', 'id'], ['Three', nil, 'type'] ]` adds three additional entries, the first one named "One" with the default path and type, the second one named "Two" with the URL fragment "#id" and the default type, and the third one named "Three" with the default path and the type "type".
170 The list is usually constructed by running through the markup. Exceptions can also be hard-coded for specific pages. 168 The list is usually constructed by running through the markup. Exceptions can also be hard-coded for specific pages.
171 **Default:** `[]`169 **Default:** `[]`
172 170
173The following accessors are also available, but must not be overridden:171The following accessors are also available, but must not be overridden:
174 172
175* `name` [String] 173* `name` [String]
176 Memoized version of `get_name` (`nil` for the root page).174 Memoized version of `get_name` (`nil` for the root page).
177 175
178* `type` [String] 176* `type` [String]
179 Memoized version of `get_type` (`nil` for the root page).177 Memoized version of `get_type` (`nil` for the root page).
180 178
181**Notes:**179**Notes:**
@@ -223,4 +221,4 @@ end · 41 unmodified lines
223```221```
224 222
225 223
226return [[Home]]224return [[Home]]
docs/Home.md+0−23
@@ -1,23 +0,0 @@
1### Development
2
3* [Adding documentations to DevDocs](https://github.com/Thibaut/devdocs/wiki/Adding-documentations-to-DevDocs)
4* [Scraper Reference](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference)
5* [Filter Reference](https://github.com/Thibaut/devdocs/wiki/Filter-Reference)
6
7### Plugins and Extensions
8
9* [Chrome web app](https://chrome.google.com/webstore/detail/devdocs/mnfehgbmkapmjnhcnbodoamcioleeooe)
10* [Ubuntu Touch app](https://uappexplorer.com/app/devdocsunofficial.berkes)
11* [Sublime Text plugin](https://sublime.wbond.net/packages/DevDocs)
12* [Atom plugin](https://atom.io/packages/devdocs)
13* [Brackets extension](https://github.com/gruehle/dev-docs-viewer)
14* [Fluid](http://fluidapp.com) for turning DevDocs into a real OS X app
15* [GTK shell / Vim integration](https://github.com/naquad/devdocs-shell)
16* [Emacs lookup](https://github.com/skeeto/devdocs-lookup)
17* [Alfred Workflow](https://github.com/yannickglt/alfred-devdocs)
18* [Vim search plugin with Devdocs in its defaults](https://github.com/waiting-for-dev/vim-www) Just set `let g:www_shortcut_engines = { 'devdocs': ['Devdocs', '<leader>dd'] }` to have a `:Devdocs` command and a `<leader>dd` mapping.
19* [Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=akfish.vscode-devdocs ) (1)
20* [Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=deibit.devdocs) (2)
21* [Desktop application](https://github.com/egoist/devdocs-desktop)
22* [Doc Browser](https://github.com/qwfy/doc-browser) is a native Linux app that supports DevDocs docsets
23* [GNOME Application](https://github.com/hardpixel/devdocs-desktop) GTK3 application with search integrated in headerbar
docs/Scraper-Reference.md+57−59
@@ -1,12 +1,10 @@
1---
2
3**Table of contents:**1**Table of contents:**
4 2
5* [Overview](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference#overview)3* [Overview](#overview)
6* [Configuration](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference#configuration)4* [Configuration](#configuration)
7 - [Attributes](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference#attributes)5 - [Attributes](#attributes)
8 - [Filter stacks](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference#filter-stacks)6 - [Filter stacks](#filter-stacks)
9 - [Filter options](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference#filter-options)7 - [Filter options](#filter-options)
10 8
11## Overview9## Overview
12 10
@@ -34,51 +32,51 @@ Each URL is requested only once (case-insensitive). · 21 unmodified lines
34 32
35Configuration is done via class attributes and divided into three main categories:33Configuration is done via class attributes and divided into three main categories:
36 34
37* [Attributes](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference#attributes) — essential information such as name, version, URL, etc.35* [Attributes](#attributes) — essential information such as name, version, URL, etc.
38* [Filter stacks](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference#filter-stacks) — the list of filters that will be applied to each page.36* [Filter stacks](#filter-stacks) — the list of filters that will be applied to each page.
39* [Filter options](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference#filter-options) — the options passed to said filters.37* [Filter options](#filter-options) — the options passed to said filters.
40 38
41**Note:** scrapers are located in the [`lib/docs/scrapers`](https://github.com/Thibaut/devdocs/tree/master/lib/docs/scrapers/) directory. The class's name must be the [CamelCase](http://api.rubyonrails.org/classes/String.html#method-i-camelize) equivalent of the filename.39**Note:** scrapers are located in the [`lib/docs/scrapers`](https://github.com/Thibaut/devdocs/tree/master/lib/docs/scrapers/) directory. The class's name must be the [CamelCase](http://api.rubyonrails.org/classes/String.html#method-i-camelize) equivalent of the filename.
42 40
43### Attributes41### Attributes
44 42
45* `name` [String] 43* `name` [String]
46 Must be unique. 44 Must be unique.
47 Defaults to the class's name.45 Defaults to the class's name.
48 46
49* `slug` [String] 47* `slug` [String]
50 Must be unique, lowercase, and not include dashes (underscores are ok). 48 Must be unique, lowercase, and not include dashes (underscores are ok).
51 Defaults to `name` lowercased.49 Defaults to `name` lowercased.
52 50
53* `type` [String] **(required, inherited)** 51* `type` [String] **(required, inherited)**
54 Defines the CSS class name (`_[type]`) and custom JavaScript class (`app.views.[Type]Page`) that will be added/loaded on each page. Documentations sharing a similar structure (e.g. generated with the same tool or originating from the same website) should use the same `type` to avoid duplicating the CSS and JS. 52 Defines the CSS class name (`_[type]`) and custom JavaScript class (`app.views.[Type]Page`) that will be added/loaded on each page. Documentations sharing a similar structure (e.g. generated with the same tool or originating from the same website) should use the same `type` to avoid duplicating the CSS and JS.
55 Must include lowercase letters only.53 Must include lowercase letters only.
56 54
57* `release` [String] **(required)** 55* `release` [String] **(required)**
58 The version of the software at the time the scraper was last run. This is only informational and doesn't affect the scraper's behavior.56 The version of the software at the time the scraper was last run. This is only informational and doesn't affect the scraper's behavior.
59 57
60* `base_url` [String] **(required in `UrlScraper`)** 58* `base_url` [String] **(required in `UrlScraper`)**
61 The documents' location. Only URLs _inside_ the `base_url` will be scraped. "inside" more or less means "starting with" except that `/docs` is outside `/doc` (but `/doc/` is inside). 59 The documents' location. Only URLs _inside_ the `base_url` will be scraped. "inside" more or less means "starting with" except that `/docs` is outside `/doc` (but `/doc/` is inside).
62 Defaults to `localhost` in `FileScraper`. _(Note: any iframe, image, or skipped link pointing to localhost will be removed by the `CleanLocalUrls` filter; the value should be overridden if the documents are available online.)_ 60 Defaults to `localhost` in `FileScraper`. _(Note: any iframe, image, or skipped link pointing to localhost will be removed by the `CleanLocalUrls` filter; the value should be overridden if the documents are available online.)_
63 Unless `root_path` is set, the root/initial URL is equal to `base_url`.61 Unless `root_path` is set, the root/initial URL is equal to `base_url`.
64 62
65* `root_path` [String] **(inherited)** 63* `root_path` [String] **(inherited)**
66 The path from the `base_url` of the root URL.64 The path from the `base_url` of the root URL.
67 65
68* `initial_paths` [Array] **(inherited)** 66* `initial_paths` [Array] **(inherited)**
69 A list of paths (from the `base_url`) to add to the initial queue. Useful for scraping isolated documents. 67 A list of paths (from the `base_url`) to add to the initial queue. Useful for scraping isolated documents.
70 Defaults to `[]`. _(Note: the `root_path` is added to the array at runtime.)_68 Defaults to `[]`. _(Note: the `root_path` is added to the array at runtime.)_
71 69
72* `dir` [String] **(required, `FileScraper` only)** 70* `dir` [String] **(required, `FileScraper` only)**
73 The absolute path where the files are located on the local filesystem. 71 The absolute path where the files are located on the local filesystem.
74 _Note: `FileScraper` works exactly like `UrlScraper` (manipulating the same kind of URLs) except that it substitutes `base_url` with `dir` in order to read files instead of making HTTP requests._72 _Note: `FileScraper` works exactly like `UrlScraper` (manipulating the same kind of URLs) except that it substitutes `base_url` with `dir` in order to read files instead of making HTTP requests._
75 73
76* `params` [Hash] **(inherited, `UrlScraper` only)** 74* `params` [Hash] **(inherited, `UrlScraper` only)**
77 Query string parameters to append to every URL. (e.g. `{ format: 'raw' }` → `?format=raw`) 75 Query string parameters to append to every URL. (e.g. `{ format: 'raw' }` → `?format=raw`)
78 Defaults to `{}`.76 Defaults to `{}`.
79 77
80* `abstract` [Boolean] 78* `abstract` [Boolean]
81 Make the scraper abstract / not runnable. Used for sharing behavior with other scraper classes (e.g. all MDN scrapers inherit from the abstract [`Mdn`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/scrapers/mdn/mdn.rb) class). 79 Make the scraper abstract / not runnable. Used for sharing behavior with other scraper classes (e.g. all MDN scrapers inherit from the abstract [`Mdn`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/scrapers/mdn/mdn.rb) class).
82 Defaults to `false`.80 Defaults to `false`.
83 81
84### Filter stacks82### Filter stacks
@@ -122,67 +120,67 @@ Additionally: · 37 unmodified lines
122 120
123The filter options are stored in the `options` Hash. The Hash is inheritable (a recursive copy) and empty by default.121The filter options are stored in the `options` Hash. The Hash is inheritable (a recursive copy) and empty by default.
124 122
125More information about how filters work is available on the [Filter Reference](https://github.com/Thibaut/devdocs/wiki/Filter-Reference) page.123More information about how filters work is available on the [Filter Reference](./filter-reference.md) page.
126 124
127* [`ContainerFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/container.rb)125* [`ContainerFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/container.rb)
128 126
129 - `:container` [String or Proc] 127 - `:container` [String or Proc]
130 A CSS selector of the container element. Everything outside of it will be removed and become unavailable to the other filters. If more than one element match the selector, the first one inside the DOM is used. If no elements match the selector, an error is raised. 128 A CSS selector of the container element. Everything outside of it will be removed and become unavailable to the other filters. If more than one element match the selector, the first one inside the DOM is used. If no elements match the selector, an error is raised.
131 If the value is a Proc, it is called for each page with the filter instance as argument, and should return a selector or `nil`. 129 If the value is a Proc, it is called for each page with the filter instance as argument, and should return a selector or `nil`.
132 The default container is the `<body>` element. 130 The default container is the `<body>` element.
133 _Note: links outside of the container element will not be followed by the scraper. To remove links that should be followed, use a [`CleanHtml`](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#cleanhtmlfilter) filter later in the stack._131 _Note: links outside of the container element will not be followed by the scraper. To remove links that should be followed, use a [`CleanHtml`](./filter-reference.md#cleanhtmlfilter) filter later in the stack._
134 132
135* [`NormalizeUrlsFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/normalize_urls.rb) 133* [`NormalizeUrlsFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/normalize_urls.rb)
136 The following options are used to modify URLs in the pages. They are useful to remove duplicates (when the same page is accessible from multiple URLs) and fix websites that have a bunch of redirections in place (when URLs that should be scraped, aren't, because they are behind a redirection which is outside of the `base_url` — see the MDN scrapers for examples of this).134 The following options are used to modify URLs in the pages. They are useful to remove duplicates (when the same page is accessible from multiple URLs) and fix websites that have a bunch of redirections in place (when URLs that should be scraped, aren't, because they are behind a redirection which is outside of the `base_url` — see the MDN scrapers for examples of this).
137 135
138 - `:replace_urls` [Hash] 136 - `:replace_urls` [Hash]
139 Replaces all instances of a URL with another. 137 Replaces all instances of a URL with another.
140 Format: `{ 'original_url' => 'new_url' }`138 Format: `{ 'original_url' => 'new_url' }`
141 - `:replace_paths` [Hash] 139 - `:replace_paths` [Hash]
142 Replaces all instances of a sub-path (path from the `base_url`) with another. 140 Replaces all instances of a sub-path (path from the `base_url`) with another.
143 Format: `{ 'original_path' => 'new_path' }`141 Format: `{ 'original_path' => 'new_path' }`
144 - `:fix_urls` [Proc] 142 - `:fix_urls` [Proc]
145 Called with each URL. If the returned value is `nil`, the URL isn't modified. Otherwise the returned value is used as replacement.143 Called with each URL. If the returned value is `nil`, the URL isn't modified. Otherwise the returned value is used as replacement.
146 144
147 _Note: before these rules are applied, all URLs are converted to their fully qualified counterpart (http://...)._145 _Note: before these rules are applied, all URLs are converted to their fully qualified counterpart (http://...)._
148 146
149* [`InternalUrlsFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/internal_urls.rb)147* [`InternalUrlsFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/internal_urls.rb)
150 148
151 Internal URLs are the ones _inside_ the scraper's `base_url` ("inside" more or less means "starting with", except that `/docs` is outside `/doc`). They will be scraped unless excluded by one of the following rules. All internal URLs are converted to relative URLs inside the pages.149 Internal URLs are the ones _inside_ the scraper's `base_url` ("inside" more or less means "starting with", except that `/docs` is outside `/doc`). They will be scraped unless excluded by one of the following rules. All internal URLs are converted to relative URLs inside the pages.
152 150
153 - `:skip_links` [Boolean or Proc] 151 - `:skip_links` [Boolean or Proc]
154 If `false`, does not convert or follow any internal URL (creating a single-page documentation). 152 If `false`, does not convert or follow any internal URL (creating a single-page documentation).
155 If the value is a Proc, it is called for each page with the filter instance as argument.153 If the value is a Proc, it is called for each page with the filter instance as argument.
156 - `:follow_links` [Proc] 154 - `:follow_links` [Proc]
157 Called for page with the filter instance as argument. If the returned value is `false`, does not add internal URLs to the queue.155 Called for page with the filter instance as argument. If the returned value is `false`, does not add internal URLs to the queue.
158 - `:trailing_slash` [Boolean] 156 - `:trailing_slash` [Boolean]
159 If `true`, adds a trailing slash to all internal URLs. If `false`, removes it. 157 If `true`, adds a trailing slash to all internal URLs. If `false`, removes it.
160 This is another option used to remove duplicate pages.158 This is another option used to remove duplicate pages.
161 - `:skip` [Array] 159 - `:skip` [Array]
162 Ignores internal URLs whose sub-paths (path from the `base_url`) are in the Array (case-insensitive).160 Ignores internal URLs whose sub-paths (path from the `base_url`) are in the Array (case-insensitive).
163 - `:skip_patterns` [Array] 161 - `:skip_patterns` [Array]
164 Ignores internal URLs whose sub-paths match any Regexp in the Array.162 Ignores internal URLs whose sub-paths match any Regexp in the Array.
165 - `:only` [Array] 163 - `:only` [Array]
166 Ignores internal URLs whose sub-paths aren't in the Array (case-insensitive) and don't match any Regexp in `:only_patterns`.164 Ignores internal URLs whose sub-paths aren't in the Array (case-insensitive) and don't match any Regexp in `:only_patterns`.
167 - `:only_patterns` [Array] 165 - `:only_patterns` [Array]
168 Ignores internal URLs whose sub-paths don't match any Regexp in the Array and aren't in `:only`.166 Ignores internal URLs whose sub-paths don't match any Regexp in the Array and aren't in `:only`.
169 167
170 If the scraper has a `root_path`, the empty and `/` paths are automatically skipped. 168 If the scraper has a `root_path`, the empty and `/` paths are automatically skipped.
171 If `:only` or `:only_patterns` is set, the root path is automatically added to `:only`.169 If `:only` or `:only_patterns` is set, the root path is automatically added to `:only`.
172 170
173 _Note: pages can be excluded from the index based on their content using the [`Entries`](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#entriesfilter) filter. However, their URLs will still be converted to relative in the other pages and trying to open them will return a 404 error. Although not ideal, this is often better than having to maintain a long list of `:skip` URLs._171 _Note: pages can be excluded from the index based on their content using the [`Entries`](./filter-reference.md#entriesfilter) filter. However, their URLs will still be converted to relative in the other pages and trying to open them will return a 404 error. Although not ideal, this is often better than having to maintain a long list of `:skip` URLs._
174 172
175* [`AttributionFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/attribution.rb)173* [`AttributionFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/attribution.rb)
176 174
177 - `:attribution` [String] **(required)** 175 - `:attribution` [String] **(required)**
178 An HTML string with the copyright and license information. See the other scrapers for examples.176 An HTML string with the copyright and license information. See the other scrapers for examples.
179 177
180* [`TitleFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/title.rb)178* [`TitleFilter`](https://github.com/Thibaut/devdocs/blob/master/lib/docs/filters/core/title.rb)
181 179
182 - `:title` [String or Boolean or Proc] 180 - `:title` [String or Boolean or Proc]
183 Unless the value is `false`, adds a title to every page. 181 Unless the value is `false`, adds a title to every page.
184 If the value is `nil`, the title is the name of the page as determined by the [`Entries`](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#entriesfilter) filter. Otherwise the title is the String or the value returned by the Proc (called for each page, with the filter instance as argument). If the Proc returns `nil` or `false`, no title is added.182 If the value is `nil`, the title is the name of the page as determined by the [`Entries`](./filter-reference.md#entriesfilter) filter. Otherwise the title is the String or the value returned by the Proc (called for each page, with the filter instance as argument). If the Proc returns `nil` or `false`, no title is added.
185 - `:root_title` [String or Boolean] 183 - `:root_title` [String or Boolean]
186 Overrides the `:title` option for the root page only.184 Overrides the `:title` option for the root page only.
187 185
188 _Note: this filter is disabled by default._186 _Note: this filter is disabled by default._
docs/_Footer.md+0−1
@@ -1 +0,0 @@
1Feel free to edit this page or ask for improvements on the [mailing list](https://groups.google.com/d/forum/devdocs).
docs/adding-docs.mdrenamed from docs/Adding-documentations-to-DevDocs.md+7−7
@@ -1,14 +1,14 @@
1Adding a documentation may look like a daunting task but once you get the hang of it, it's actually quite simple. Don't hesitate to ask for help on the [mailing list](https://groups.google.com/d/forum/devdocs) if you ever get stuck.1Adding a documentation may look like a daunting task but once you get the hang of it, it's actually quite simple. Don't hesitate to ask for help [in Gitter](https://gitter.im/FreeCodeCamp/DevDocs) if you ever get stuck.
2 2
3**Note:** please read the [contributing guidelines](https://github.com/Thibaut/devdocs/blob/master/.github/CONTRIBUTING.md) before submitting a new documentation.3**Note:** please read the [contributing guidelines](https://github.com/Thibaut/devdocs/blob/master/.github/CONTRIBUTING.md) before submitting a new documentation.
4 4
51. Create a subclass of `Docs::UrlScraper` or `Docs::FileScraper` in the `lib/docs/scrapers/` directory. Its name should be the [PascalCase](http://api.rubyonrails.org/classes/String.html#method-i-camelize) equivalent of the filename (e.g. `my_doc` → `MyDoc`)51. Create a subclass of `Docs::UrlScraper` or `Docs::FileScraper` in the `lib/docs/scrapers/` directory. Its name should be the [PascalCase](http://api.rubyonrails.org/classes/String.html#method-i-camelize) equivalent of the filename (e.g. `my_doc` → `MyDoc`)
62. Add the appropriate class attributes and filter options (see the [Scraper Reference](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference) page).62. Add the appropriate class attributes and filter options (see the [Scraper Reference](./scraper-reference.md) page).
73. Check that the scraper is listed in `thor docs:list`.73. Check that the scraper is listed in `thor docs:list`.
84. Create filters specific to the scraper in the `lib/docs/filters/[my_doc]/` directory and add them to the class's [filter stacks](https://github.com/Thibaut/devdocs/wiki/Scraper-Reference#filter-stacks). You may create any number of filters but will need at least the following two:84. Create filters specific to the scraper in the `lib/docs/filters/[my_doc]/` directory and add them to the class's [filter stacks](./scraper-reference.md#filter-stacks). You may create any number of filters but will need at least the following two:
9 * A [`CleanHtml`](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#cleanhtmlfilter) filter whose task is to clean the HTML markup (e.g. adding `id` attributes to headings) and remove everything superfluous and/or nonessential.9 * A [`CleanHtml`](./filter-reference.md#cleanhtmlfilter) filter whose task is to clean the HTML markup (e.g. adding `id` attributes to headings) and remove everything superfluous and/or nonessential.
10 * An [`Entries`](https://github.com/Thibaut/devdocs/wiki/Filter-Reference#entriesfilter) filter whose task is to determine the pages' metadata (the list of entries, each with a name, type and path).10 * An [`Entries`](./filter-reference.md#entriesfilter) filter whose task is to determine the pages' metadata (the list of entries, each with a name, type and path).
11 The [Filter Reference](https://github.com/Thibaut/devdocs/wiki/Filter-Reference) page has all the details about filters.11 The [Filter Reference](./filter-reference.md) page has all the details about filters.
125. Using the `thor docs:page [my_doc] [path]` command, check that the scraper works properly. Files will appear in the `public/docs/[my_doc]/` directory (but not inside the app as the command doesn't touch the index). `path` in this case refers to either the remote path (if using `UrlScraper`) or the local path (if using `FileScraper`).125. Using the `thor docs:page [my_doc] [path]` command, check that the scraper works properly. Files will appear in the `public/docs/[my_doc]/` directory (but not inside the app as the command doesn't touch the index). `path` in this case refers to either the remote path (if using `UrlScraper`) or the local path (if using `FileScraper`).
136. Generate the full documentation using the `thor docs:generate [my_doc] --force` command. Additionally, you can use the `--verbose` option to see which files are being created/updated/deleted (useful to see what changed since the last run), and the `--debug` option to see which URLs are being requested and added to the queue (useful to pin down which page adds unwanted URLs to the queue).136. Generate the full documentation using the `thor docs:generate [my_doc] --force` command. Additionally, you can use the `--verbose` option to see which files are being created/updated/deleted (useful to see what changed since the last run), and the `--debug` option to see which URLs are being requested and added to the queue (useful to pin down which page adds unwanted URLs to the queue).
147. Start the server, open the app, enable the documentation, and see how everything plays out.147. Start the server, open the app, enable the documentation, and see how everything plays out.
@@ -19,4 +19,4 @@ Adding a documentation may look like a daunting task but once you get the hang o · 4 unmodified lines
19 19
20If the documentation includes more than a few hundreds pages and is available for download, try to scrape it locally (e.g. using `FileScraper`). It'll make the development process much faster and avoids putting too much load on the source site. (It's not a problem if your scraper is coupled to your local setup, just explain how it works in your pull request.)20If the documentation includes more than a few hundreds pages and is available for download, try to scrape it locally (e.g. using `FileScraper`). It'll make the development process much faster and avoids putting too much load on the source site. (It's not a problem if your scraper is coupled to your local setup, just explain how it works in your pull request.)
21 21
22Finally, try to document your scraper and filters' behavior as much as possible using comments (e.g. why some URLs are ignored, HTML markup removed, metadata that way, etc.). It'll make updating the documentation much easier.22Finally, try to document your scraper and filters' behavior as much as possible using comments (e.g. why some URLs are ignored, HTML markup removed, metadata that way, etc.). It'll make updating the documentation much easier.
docs/maintainers.mdrenamed from docs/maintainers_guide.md+0−0

File renamed without changes.