Skip to content

Commit a3ab7ee

Browse files
committed
Add basic support for package long descriptions
1 parent 0571e44 commit a3ab7ee

File tree

6 files changed

+111
-11
lines changed

6 files changed

+111
-11
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
A styled div used for highlighting important content on the site.
3+
*/
4+
5+
.callout-block {
6+
padding: 10px;
7+
border: 1px solid $border-color;
8+
border-left-color: $brand-color;
9+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
Styles the main description panel for an individual package.
3+
Needs to deal with anything a user could include in a project description file...
4+
*/
5+
6+
.release-description {
7+
margin-bottom: 40px;
8+
line-height: 1.5;
9+
10+
> :first-child,
11+
> div:first-child > :first-child {
12+
margin-top: 0 !important;
13+
}
14+
15+
h1, h2, h3, h4, h5, h6 {
16+
margin: 20px 0;
17+
}
18+
19+
strong, b {
20+
font-weight: 600;
21+
}
22+
23+
em, i {
24+
font-style: italic
25+
}
26+
27+
pre,
28+
code,
29+
tt {
30+
font-family: $code-font;
31+
background-color: lighten($base-grey, 5);
32+
border: 1px solid $border-color;
33+
padding: 0 3px 1px 3px;
34+
font-size: 85%;
35+
color: lighten($text-color, 15);
36+
}
37+
38+
pre {
39+
display: block;
40+
padding: 15px;
41+
margin-bottom: 15px;
42+
}
43+
44+
ol, ul {
45+
margin: 15px 0 15px 30px;
46+
47+
@media only screen and (max-width: 400px){
48+
margin-left: 15px;
49+
}
50+
51+
ul, ol {
52+
margin: 0 0 0 30px;
53+
54+
@media only screen and (max-width: 400px){
55+
margin-left: 15px;
56+
}
57+
}
58+
}
59+
60+
ul {
61+
list-style-type: disc;
62+
}
63+
64+
li {
65+
padding: 2px 0;
66+
}
67+
68+
blockquote {
69+
margin: 15px 0 15px 15px;
70+
border-left: 3px solid $border-color;
71+
font-style: italic;
72+
padding-left: 15px;
73+
color: lighten($text-color, 20);
74+
}
75+
76+
dl {
77+
margin: 15px 0 5px 0;
78+
79+
dt {
80+
font-weight: $bold-font-weight;
81+
}
82+
83+
dd {
84+
margin: 0 0 10px 20px;
85+
}
86+
}
87+
88+
hr {
89+
margin: 15px 0;
90+
border: 1px solid $border-color;
91+
}
92+
}

warehouse/static/sass/components/_vertical-tabs.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
float: left;
2424
width: 25%;
2525
}
26-
border-right: 2px solid $base-grey;
2726
display: none;
28-
padding: 0 30px 0 0;
27+
padding: 0 15px 0 0;
2928
}
3029

3130
.vertical-tab {
@@ -78,11 +77,6 @@
7877
padding: 20px 10px;
7978
}
8079

81-
p {
82-
color: $base-font-color;
83-
line-height: $base-line-height;
84-
}
85-
8680
@include media($vertical-tab-mode) {
8781
border: none;
8882
display: none;

warehouse/static/sass/main.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
@import "components/author-profile"; // Move this?
6767
@import "components/brand-logo";
6868
@import "components/button-set";
69+
@import "components/callout-block";
6970
@import "components/card-style";
7071
@import "components/checkbox-tree";
7172
@import "components/dark-overlay";
@@ -88,6 +89,7 @@
8889
@import "components/package-list";
8990
@import "components/package-status";
9091
@import "components/panel-overlay";
92+
@import "components/release-description";
9193
@import "components/search-form";
9294
@import "components/sidebar-section";
9395
@import "components/site-header"; // refactor

warehouse/templates/accounts/profile.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ <h1>{{ user.name|default(user.username, true) }}{% if user.name %}({{ user.usern
3131
{% for release in projects %}
3232
<div class="package-snippet">
3333
<h3 class="title"><a href="{{ request.route_path('packaging.project', name=release.project.normalized_name) }}">{{ release.project.name }}</a></h3>
34-
3534
<p class="meta">
3635
<em {{ l20n("lastReleasedOn", when=release.created|format_date()) }}>Last released on {{ release.created|format_date() }}</em>
3736
</p>
38-
3937
<p class="description">{{ release.summary }}</p>
4038
</div>
4139
{% endfor %}

warehouse/templates/packaging/detail.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ <h1>{{ release.project.name }} {{ release.version }}</h1>
4545
<span>pip install {{ release.project.normalized_name }}</span>
4646
<a href="clicking-here-copies-text">
4747
<i class="fa fa-copy"></i>
48-
<span class="sr-only">Copy PIP instructions/<span>
48+
<span class="sr-only">Copy PIP instructions<span>
4949
</a>
5050
</p>
51-
5251
<p class="help-link"><a href="#" {{ l20n("howToInstall") }}>How do I install this?</a></p>
5352
</div>
5453
</section>
@@ -128,7 +127,13 @@ <h3 {{ l20n("projectMeta") }}>Meta</h3>
128127
<a class="js-vertical-tab-accordion-heading vertical-tab-accordion-heading is-active" rel="tab1" {{ l20n("projectDescription") }}>Project Description</a>
129128
<div id="tab1" class="js-vertical-tab-content vertical-tab-content">
130129
{% if release.description %}
130+
<div class="release-description">
131131
{{ release.description|readme(format="rst") }}
132+
</div>
133+
{% else %}
134+
<div class="callout-block">
135+
<p>The author of this package has not provided a project description.</p>
136+
</div>
132137
{% endif %}
133138
</div>
134139

0 commit comments

Comments
 (0)