Skip to content

Commit 9699793

Browse files
authored
Merge pull request #7496 from Turbo87/policy-styling
Improve styling of the policy pages
2 parents 03b6579 + 7ee8637 commit 9699793

File tree

5 files changed

+264
-251
lines changed

5 files changed

+264
-251
lines changed

app/components/rendered-html.hbs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
This component renders raw HTML. Be very careful with this since it
33
can enable cross-site scripting attacks!
44
--}}
5-
<div
6-
local-class="wrapper"
5+
<TextContent
76
...attributes
87
{{highlight-syntax selector="pre > code:not(.language-mermaid)"}}
98
{{render-mermaids}}
109
>
1110
{{html-safe @html}}
12-
</div>
11+
</TextContent>

app/components/text-content.hbs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div local-class="wrapper {{if @boxed "boxed"}}" ...attributes>
2+
{{yield}}
3+
</div>

app/components/rendered-html.module.css renamed to app/components/text-content.module.css

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
.boxed {
2+
padding: var(--space-m);
3+
background-color: white;
4+
margin-bottom: var(--space-s);
5+
border-radius: 5px;
6+
}
7+
18
.wrapper {
29
line-height: 1.5;
310
overflow-wrap: break-word;

app/templates/data-access.hbs

+90-88
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,92 @@
11
<PageHeader @title="Accessing crates.io data" />
22

3-
<p>
4-
crates.io provides several ways of accessing crate data and metadata,
5-
depending on what you specifically need. Please try them in the order below.
6-
</p>
7-
8-
<h2 id="crate-index"><a href="#crate-index">Crate index</a></h2>
9-
10-
<p>
11-
The crates.io sparse index is available at
12-
<a href="https://index.crates.io">index.crates.io</a>, which adheres to the
13-
<a href="https://doc.rust-lang.org/cargo/reference/registry-index.html">Cargo index format</a>.
14-
The sparse index provides an extremely efficient way of accessing metadata on
15-
a single or small number of crates.
16-
</p>
17-
18-
<p>
19-
Each index file provides newline delimited JSON metadata on all published
20-
versions of the crate, organised into
21-
<a href="https://doc.rust-lang.org/cargo/reference/registry-index.html#index-files">index files</a>.
22-
For example, information on the <code>base64</code> crate can be found at
23-
<a href="https://index.crates.io/ba/se/base64">https://index.crates.io/ba/se/base64</a>.
24-
</p>
25-
26-
<p>
27-
No rate limits are required to use data from the sparse crate index.
28-
</p>
29-
30-
<h3 id="legacy-git-index"><a href="#legacy-git-index">Legacy Git crate index</a></h3>
31-
32-
<p>
33-
Older versions of Cargo use the crate index provided in the
34-
<a href="https://github.com/rust-lang/crates.io-index"><code>rust-lang/crates.io-index</code> repository on GitHub</a>.
35-
This remains available for use, and may be a more efficient way of accessing
36-
crate metadata for projects that require most or all crates to be included
37-
than the sparse index.
38-
</p>
39-
40-
<p>
41-
As the Git index is hosted on GitHub, GitHub's
42-
<a href="https://docs.github.com/en/site-policy/acceptable-use-policies/github-acceptable-use-policies">Acceptable Use Policies</a>
43-
apply.
44-
</p>
45-
46-
<h2 id="database-dumps"><a href="#database-dumps">Database dumps</a></h2>
47-
48-
<p>
49-
crates.io database dumps contain all information available through the
50-
crates.io API in a single download. They are updated every 24 hours.
51-
</p>
52-
53-
<p>
54-
The latest dump is available at the address
55-
<a href="https://static.crates.io/db-dump.tar.gz">https://static.crates.io/db-dump.tar.gz</a>.
56-
Information on using the dump is contained in the tarball. You can find the changelog for database dumps in
57-
<a href="https://github.com/rust-lang/crates.io/issues/3617">GitHub issue #3617</a>.
58-
</p>
59-
60-
<h2 id="api"><a href="#api">crates.io API</a></h2>
61-
62-
<p>
63-
crates.io provides an API that is a superset of the functionality required by
64-
the
65-
<a href="https://doc.rust-lang.org/cargo/reference/registry-web-api.html">Cargo Web API</a>.
66-
Should you be unable to use one of the previous options, you are welcome to
67-
use the crates.io API provided you abide by the same limits as
68-
<LinkTo @route="policies">the crawling policy</LinkTo>. In summary:
69-
</p>
70-
71-
<ol>
72-
<li>A maximum of 1 request per second, and</li>
73-
<li>
74-
A <code>user-agent</code> header that identifies your application. We
75-
strongly suggest providing a way for us to contact you (whether through a
76-
repository, or an e-mail address, or whatever is appropriate) so that we can
77-
reach out to work with you should there be issues.
78-
</li>
79-
</ol>
80-
81-
<h2 id="questions"><a href="#questions">Questions</a></h2>
82-
83-
<p>
84-
If none of the above options suit your needs, please contact the crates.io
85-
team either at <a href="mailto:[email protected]">[email protected]</a>, or by
86-
starting
87-
<a href="https://github.com/rust-lang/crates.io/discussions">a discussion on GitHub</a>,
88-
and we'll be happy to discuss solutions that might exist outside of the above
89-
guidelines.
90-
</p>
3+
<TextContent @boxed={{true}}>
4+
<p>
5+
crates.io provides several ways of accessing crate data and metadata,
6+
depending on what you specifically need. Please try them in the order below.
7+
</p>
8+
9+
<h2 id="crate-index"><a href="#crate-index">Crate index</a></h2>
10+
11+
<p>
12+
The crates.io sparse index is available at
13+
<a href="https://index.crates.io">index.crates.io</a>, which adheres to the
14+
<a href="https://doc.rust-lang.org/cargo/reference/registry-index.html">Cargo index format</a>.
15+
The sparse index provides an extremely efficient way of accessing metadata on
16+
a single or small number of crates.
17+
</p>
18+
19+
<p>
20+
Each index file provides newline delimited JSON metadata on all published
21+
versions of the crate, organised into
22+
<a href="https://doc.rust-lang.org/cargo/reference/registry-index.html#index-files">index files</a>.
23+
For example, information on the <code>base64</code> crate can be found at
24+
<a href="https://index.crates.io/ba/se/base64">https://index.crates.io/ba/se/base64</a>.
25+
</p>
26+
27+
<p>
28+
No rate limits are required to use data from the sparse crate index.
29+
</p>
30+
31+
<h3 id="legacy-git-index"><a href="#legacy-git-index">Legacy Git crate index</a></h3>
32+
33+
<p>
34+
Older versions of Cargo use the crate index provided in the
35+
<a href="https://github.com/rust-lang/crates.io-index"><code>rust-lang/crates.io-index</code> repository on GitHub</a>.
36+
This remains available for use, and may be a more efficient way of accessing
37+
crate metadata for projects that require most or all crates to be included
38+
than the sparse index.
39+
</p>
40+
41+
<p>
42+
As the Git index is hosted on GitHub, GitHub's
43+
<a href="https://docs.github.com/en/site-policy/acceptable-use-policies/github-acceptable-use-policies">Acceptable Use Policies</a>
44+
apply.
45+
</p>
46+
47+
<h2 id="database-dumps"><a href="#database-dumps">Database dumps</a></h2>
48+
49+
<p>
50+
crates.io database dumps contain all information available through the
51+
crates.io API in a single download. They are updated every 24 hours.
52+
</p>
53+
54+
<p>
55+
The latest dump is available at the address
56+
<a href="https://static.crates.io/db-dump.tar.gz">https://static.crates.io/db-dump.tar.gz</a>.
57+
Information on using the dump is contained in the tarball. You can find the changelog for database dumps in
58+
<a href="https://github.com/rust-lang/crates.io/issues/3617">GitHub issue #3617</a>.
59+
</p>
60+
61+
<h2 id="api"><a href="#api">crates.io API</a></h2>
62+
63+
<p>
64+
crates.io provides an API that is a superset of the functionality required by
65+
the
66+
<a href="https://doc.rust-lang.org/cargo/reference/registry-web-api.html">Cargo Web API</a>.
67+
Should you be unable to use one of the previous options, you are welcome to
68+
use the crates.io API provided you abide by the same limits as
69+
<LinkTo @route="policies">the crawling policy</LinkTo>. In summary:
70+
</p>
71+
72+
<ol>
73+
<li>A maximum of 1 request per second, and</li>
74+
<li>
75+
A <code>user-agent</code> header that identifies your application. We
76+
strongly suggest providing a way for us to contact you (whether through a
77+
repository, or an e-mail address, or whatever is appropriate) so that we can
78+
reach out to work with you should there be issues.
79+
</li>
80+
</ol>
81+
82+
<h2 id="questions"><a href="#questions">Questions</a></h2>
83+
84+
<p>
85+
If none of the above options suit your needs, please contact the crates.io
86+
team either at <a href="mailto:[email protected]">[email protected]</a>, or by
87+
starting
88+
<a href="https://github.com/rust-lang/crates.io/discussions">a discussion on GitHub</a>,
89+
and we'll be happy to discuss solutions that might exist outside of the above
90+
guidelines.
91+
</p>
92+
</TextContent>

0 commit comments

Comments
 (0)