You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DocumentationStandard.md
+12-8
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,10 @@ This is a standard for contributing to this documentation ([SeLite.github.io](ht
10
10
# Format
11
11
Having documentation in one large piece would make its structure too rigid. Maintenance and online navigation would be impractical. Instead, it's split into small pages. Therefore it doesn't exist in other formats. Offline viewing is easy in Firefox:
* clone [documentation from GitHub](https://github.com/selite/selite.github.io) or [download it as a zip](https://github.com/selite/selite.github.io/archive/master.zip).
* clone [documentation from GitHub](https://github.com/selite/selite.github.io) or [download it as a zip](https://github.com/selite/selite.github.io/archive/master.zip).
15
+
* for navigation open [custom 404 page](404)
16
+
* note that Markdown Viewer is not 100% proof
17
17
18
18
Alternatively, run [Jekyll locally](https://help.github.com/articles/using-jekyll-with-pages/). Install Jekyll 3.0 or newer (so that it is [Github-compatible](https://github.com/jekyll/jekyll/pull/3452)).
19
19
@@ -79,12 +79,16 @@ but rather as a value of a defined constant.
79
79
# Headers IDs must be the same as their text
80
80
Don't use [Kramdown-specific header IDs](http://kramdown.gettalong.org/syntax.html#specifying-a-header-id), since they don't work in Markdown Viewer in Firefox..
81
81
82
-
# Generating raw links
83
-
GitHub doesn't serve raw versions of most file types with their MIME, except for images. So we use [htmlpreview.github.io](http://htmlpreview.github.io) for `.html` files. For any other files, e.g. `.xml, .xsl` or `.js`, use [rawgit.com](http://rawgit.com).
82
+
# Raw content from GitHub
83
+
GitHub doesn't serve raw versions of most file types with their MIME, except for images.
84
84
85
-
In detail: Use _htmlpreview.github.io_ rather than _rawgit.com_ for `.html`, because if you pass a generic Github URL (rather than a commit hash or a tag), _htmlpreview.github.io_ fetches the latest commit of that file. Therefore we don't have to update those _htmlpreview.github.io_ links. However, production _cdn.rawgit.com_ caches the files. If you change e.g. `component's-name/src/chrome/content/reference.xml` or `extension-sequencer/src/chrome/content/selenese_reference_to_html.xsl`, then update its _cdn.rawgit.com_ URLs to use the new commit hash or tag.
85
+
* Use [htmlpreview.github.io](http://htmlpreview.github.io) only for displaying `.html` files (but not for processing them programatically). It fetches the latest commit of that file. Therefore you don't have to update those links (unless you move the file).
86
+
* For any other files (e.g. `.xml, .xsl` or `.js`), and for processing `.html` files programatically, use [rawgit.com](http://rawgit.com)
87
+
* only development only use _https://rawgit.com_ -based URLs. They fetch the latest commit.
88
+
* in production use _https://cdn.rawgit.com_ -based URLs. They are cached. Hence (re)generate a unique link for the commit you need. See below. Then update any existing links.
89
+
* Don't use _raw.githubusercontent.com_, because it doesn't serve the right MIME type (SEC7112 - `'blocked due to mime type mismatch'`).
86
90
87
-
## Updating links to cdn.rawgit.com
91
+
## Generating _cdn.rawgit.com_-based URLs
88
92
The most difficult part is to locate the 'Raw' link (on GitHub) for a chosen commit.
89
93
90
94
* Locating by commit first: Navigate to [github.com/selite/selite](https://github.com/selite/selite) > 'latest commit XYZ...' link near middle top > 'Browse files' button near the right top > locate the file > 'Raw' button.
0 commit comments