-
Notifications
You must be signed in to change notification settings - Fork 212
Split up the about page #924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+392
−219
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ca096f9
[WIP] Split up about page
jyn514 9b486e2
Actually serve pages without giving a 404
jyn514 9a5b7f8
Fix tests
jyn514 05f60c3
Don't recompile every time a template file is changed
jyn514 fec02be
Add crappy header bar
jyn514 b85cefe
Try to make it less ugly
jyn514 d974c40
Remove `fn respond()` and allow dynamically calculating a template
jyn514 e1047ce
Make the links prettier
jyn514 c4d1322
Clean up wording
jyn514 1b69163
Link to /about/builds on a failed build
jyn514 ce0125c
Get better type errors for `impl_template`
jyn514 24c76c0
Link to /about/metadata from a failed build
jyn514 72c30e3
Fix whitespace and document `active_link`
jyn514 84095dc
Don't put macros between other macros and their documentation
jyn514 8618d55
Link to /about in main header bar
jyn514 faa1e69
Add icons
jyn514 3f9272f
Link to /about before asking users to open an issue
jyn514 241f527
Fix up redirections page
jyn514 643a43c
Cleanup whitespace
jyn514 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,23 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block header %} | ||
<div class="cratesfyi-package-container"> | ||
<div class="container about"> | ||
<h3 id="crate-title">Docs.rs documentation</h3> | ||
<div class="pure-menu pure-menu-horizontal"> | ||
<ul class="pure-menu-list"> | ||
{% set text = '<i class="fa fa-fw fa-info-circle"></i> <span class="title">About</span>' %} | ||
{{ macros::active_link(expected="index", href="/about", text=text) }} | ||
{% set text = '<i class="fa fa-fw fa-fonticons"></i> <span class="title">Badges</span>' %} | ||
{{ macros::active_link(expected="badges", href="/about/badges", text=text) }} | ||
{% set text = '<i class="fa fa-fw fa-cogs"></i> <span class="title">Builds</span>' %} | ||
{{ macros::active_link(expected="builds", href="/about/builds", text=text) }} | ||
{% set text = '<i class="fa fa-fw fa-table"></i> <span class="title">Metadata</span>' %} | ||
{{ macros::active_link(expected="metadata", href="/about/metadata", text=text) }} | ||
{% set text = '<i class="fa fa-fw fa-road"></i> <span class="title">Shorthand URLs</span>' %} | ||
{{ macros::active_link(expected="redirections", href="/about/redirections", text=text) }} | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,53 @@ | ||
{% extends "about-base.html" -%} | ||
|
||
{%- block title -%} Badges {%- endblock title -%} | ||
|
||
{%- block body -%} | ||
<h1>Badges</h1> | ||
|
||
<div class="container about"> | ||
<p> | ||
You can use badges to show state of your documentation to your users. | ||
The default badge will be pointed at the latest version of a crate. | ||
You can use <code>version</code> parameter to show status of documentation for | ||
any version you want. | ||
</p> | ||
|
||
<p> | ||
Badge will display in blue if docs.rs is successfully hosting your crate | ||
documentation, and red if building documentation failing. | ||
</p> | ||
|
||
<p>Example badges for mio crate:</p> | ||
<table class="pure-table pure-table-horizontal"> | ||
<thead> | ||
<tr> | ||
<th>URL</th> | ||
<th>Badge</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
{%- set mio_badge = "https://docs.rs/mio/badge.svg" -%} | ||
<tr> | ||
<td>Latest version: <a href="{{ mio_badge | safe }}">{{ mio_badge }}</a></td> | ||
<td><img src="{{ mio_badge | safe }}" alt="mio" /></td> | ||
</tr> | ||
|
||
<tr> | ||
<td> | ||
Version 0.4.4: <a href="{{ mio_badge | safe }}?version=0.4.4">{{ mio_badge }}?version=0.4.4</a> | ||
</td> | ||
<td><img src="{{ mio_badge | safe }}?version=0.4.4" alt="mio" /></td> | ||
</tr> | ||
|
||
<tr> | ||
<td> | ||
Version 0.1.0: <a href="{{ mio_badge | safe }}?version=0.1.0">{{ mio_badge }}?version=0.1.0</a> | ||
</td> | ||
<td><img src="{{ mio_badge | safe }}?version=0.1.0" alt="mio" /></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
{%- endblock body %} |
This file contains hidden or 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,85 @@ | ||
{% extends "about-base.html" -%} | ||
|
||
{%- block title -%} Builds {%- endblock title -%} | ||
|
||
{%- block body -%} | ||
jyn514 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{%- set docsrs_repo = "https://github.com/rust-lang/docs.rs" -%} | ||
<h1>Builds</h1> | ||
<div class="container about"> | ||
<p> | ||
Docs.rs automatically builds crates' documentation released on | ||
<a href="https://crates.io/">crates.io</a> | ||
using the nightly release of the Rust compiler. | ||
Builds can take a while depending how many crates are in <a href="/releases/queue">the queue</a>. | ||
</p> | ||
|
||
<p> | ||
{%- if rustc_version %} | ||
The current version of the Rust compiler in use is <code>{{ rustc_version }}</code>. | ||
{%- endif -%} | ||
</p> | ||
|
||
<p> | ||
The README of a crate is taken from the <code>readme</code> field defined in | ||
<code>Cargo.toml</code>. If a crate doesn't have this field, | ||
no README will be displayed. | ||
</p> | ||
|
||
<h3>Diagnosing a failed build</h3> | ||
|
||
<h4>Missing dependencies</h4> | ||
<p> | ||
Missing dependencies are a common reason for a failed build. | ||
Docs.rs dependencies are managed through | ||
<a href="https://github.com/rust-lang/crates-build-env">crates-build-env</a>; | ||
see <a href="https://forge.rust-lang.org/docs-rs/add-dependencies.html">Forge</a> for instructions | ||
on how to make a PR. You can always <a href="{{ docsrs_repo | safe }}/issues">file an issue</a> | ||
if you're having trouble. | ||
</p> | ||
|
||
<h4>Detecting Docs.rs from <code>build.rs</code></h4> | ||
<p> | ||
Docs.rs builds crates with the environment variable <code>DOCS_RS</code> set to | ||
<code>1</code>, which enables the crate to detect docs.rs and build the | ||
crate differently. This can be helpful if you need | ||
dependencies for building the library, but not for building the documentation. | ||
</p> | ||
|
||
<h4>Detecting Docs.rs from <code>#[cfg]</code> attributes</h4> | ||
<p> | ||
You can detect Docs.rs by having a <a href="https://doc.rust-lang.org/cargo/reference/features.html">feature</a> | ||
which is only set by Docs.rs. See <a href="metadata">Metadata</a> for more information. | ||
</p> | ||
|
||
<h4>Global sandbox limits</h4> | ||
|
||
<p> | ||
All the builds on docs.rs are executed inside a sandbox with limited | ||
resources. The current limits are the following: | ||
</p> | ||
|
||
{{ macros::crate_limits(limits=limits) }} | ||
|
||
<p> | ||
If a build fails because it hit one of those limits please | ||
<a href="{{ docsrs_repo | safe }}/issues/new/choose">open an issue</a> | ||
to get them increased for your crate. | ||
Note that network access will not be enabled for any crate. | ||
</p> | ||
|
||
<h4>Test crate documentation build locally</h4> | ||
{%- set build_subcommand = docsrs_repo ~ "/blob/master/README.md#build-subcommand" -%} | ||
<p> | ||
The <a href="{{ build_subcommand | safe }}">docs.rs README</a> describes how to build an | ||
unpublished crate's documentation locally using the same build environment as the build agent. | ||
</p> | ||
</div> | ||
{%- endblock body %} | ||
|
||
{% block css -%} | ||
{{ macros::highlight_css() }} | ||
{%- endblock css %} | ||
|
||
{% block javascript -%} | ||
{{ macros::highlight_js(languages=["ini"]) }} | ||
{%- endblock javascript %} |
This file contains hidden or 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,47 @@ | ||
{% extends "about-base.html" -%} | ||
|
||
{%- block title -%} About Docs.rs {%- endblock title -%} | ||
|
||
{%- block body -%} | ||
jyn514 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{%- set docsrs_repo = "https://github.com/rust-lang/docs.rs" -%} | ||
|
||
<h1 id="crate-title">About Docs.rs</h1> | ||
<div class="container about"> | ||
<p> | ||
Docs.rs is an | ||
<a href="{{ docsrs_repo | safe }}">open source</a> | ||
documentation host for crates of the | ||
<a href="https://www.rust-lang.org/">Rust Programming Language</a>. | ||
All libraries published to <a href="https://crates.io">crates.io</a> | ||
are documented. If you just published a crate, your crate is likely | ||
still in <a href="/releases/queue">the queue</a>. | ||
</p> | ||
|
||
<p> | ||
The source code of Docs.rs is available on | ||
<a href="{{ docsrs_repo | safe }}">GitHub</a>. If | ||
you ever encounter an issue, don't hesitate to report it! (And | ||
thanks in advance!) | ||
</p> | ||
|
||
|
||
<h2>More about Docs.rs</h2> | ||
<ol> | ||
<li><a href="/about/badges">Badges</a>: How to use badges generated by Docs.rs</li> | ||
<li><a href="/about/builds">Builds</a>: How Docs.rs builds documentation for a crate</li> | ||
<li><a href="/about/metadata">Metadata</a>: How you can configure a build</li> | ||
<li><a href="/about/redirections">Redirections</a>: How Docs.rs uses semantic versioning in URLs</li> | ||
</ol> | ||
|
||
<h3>Version</h3> | ||
<p>Currently running Docs.rs version is: <strong>{{ docsrs_version() }}</strong></p> | ||
|
||
<h3>Contact</h3> | ||
{%- set governance_link = "https://www.rust-lang.org/governance/teams/dev-tools#docs-rs" -%} | ||
<p> | ||
Docs.rs is run and maintained by the <a href="{{ governance_link | safe }}">Docs.rs team</a>. | ||
You can find us in #docs-rs on <a href="https://discordapp.com/invite/f7mTXPW/">Discord</a>. | ||
</p> | ||
|
||
</div> | ||
{%- endblock body %} |
This file contains hidden or 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,18 @@ | ||
{% extends "about-base.html" -%} | ||
|
||
{%- block title -%} Metadata {%- endblock title -%} | ||
|
||
{%- block body -%} | ||
jyn514 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<h1>Metadata for custom builds</h1> | ||
|
||
<div class="container about"> | ||
<p> | ||
You can customize docs.rs builds by defining <code>[package.metadata.docs.rs]</code> | ||
table in your crates' <code>Cargo.toml</code>. | ||
</p> | ||
|
||
<p>The available configuration flags you can customize are:</p> | ||
|
||
<pre><code>{%- include "core/Cargo.toml.example" -%}</code></pre> | ||
</div> | ||
{%- endblock body %} |
This file contains hidden or 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,60 @@ | ||
{% extends "about-base.html" -%} | ||
|
||
{%- block title -%} Shorthand URLs {%- endblock title -%} | ||
|
||
{%- block body -%} | ||
jyn514 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<h1>Shorthand URLs</h1> | ||
<div class="container about"> | ||
|
||
<p> | ||
Docs.rs uses semver to parse URLs. You can use this feature to access | ||
crates' documentation easily. Example of URL redirections for | ||
<code>clap</code> crate: | ||
</p> | ||
|
||
<table class="pure-table pure-table-horizontal"> | ||
<thead> | ||
<tr> | ||
<th>URL</th> | ||
<th>Redirects to documentation of</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<tr> | ||
<td><a href="https://docs.rs/clap">docs.rs/clap</a></td> | ||
<td>Latest version of clap</td> | ||
</tr> | ||
|
||
<tr> | ||
<td><a href="https://docs.rs/clap/%7E2">docs.rs/clap/~2</a></td> | ||
<td>2.* version</td> | ||
</tr> | ||
|
||
<tr> | ||
<td><a href="https://docs.rs/clap/%7E2.9">docs.rs/clap/~2.9</a></td> | ||
<td>2.9.* version</td> | ||
</tr> | ||
|
||
<tr> | ||
<td> | ||
<a href="https://docs.rs/clap/2.9.3">docs.rs/clap/2.9.3</a> | ||
</td> | ||
<td> | ||
2.9.3 version (you don't need <code>=</code> unlike semver) | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td> | ||
<a href="https://docs.rs/clap/*/clap/struct.App.html">docs.rs/clap/*/clap/struct.App.html</a> | ||
</td> | ||
<td> | ||
Latest version of this page (if it still exists). "latest" or "newest" work as well as | ||
<code>*</code>. | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
{%- endblock body %} |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.