Skip to content

Commit 2e1de53

Browse files
committed
Improvements to the docs and welcome page
1 parent 76279ad commit 2e1de53

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

docs/intro.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ Sortable is an open-source javascript and CSS library which adds sorting functio
44

55
#### Demo
66

7+
Here is a demo of the "Bootstrap" theme.
8+
79
<p style="display: none"></p>
8-
<table data-sortable> <thead> <tr> <th data-sortable="false">Browser</th> <th data-sorted="true" data-sorted-direction="descending">Usage</th> <th>Initial release</th> <th>Stable version</th> </tr> </thead> <tbody> <tr> <td>Chrome</td> <td>42.68%</td> <td data-value="2008">September 2, 2008</td> <td>31.0.1650.57</td> </tr> <tr> <td>Internet Explorer</td> <td>25.44%</td> <td data-value="1995">August 16, 1995</td> <td>11.0.1</td> </tr> <tr> <td>Firefox</td> <td>20.01%</td> <td data-value="2002">September 23, 2002</td> <td>25.0.1</td> </tr> <tr> <td>Safari</td> <td>8.39%</td> <td data-value="2003">January 7, 2003</td> <td>7.0</td> </tr> <tr> <td>Opera</td> <td>1.03%</td> <td data-value="1994">Late 1994</td> <td>18.0.1284.49</td> </tr> <tr> <td>Other</td> <td data-value="0">2.44%</td> <td data-value="-1"></td> <td></td> </tr> </tbody> </table>
10+
<table class="sortable-theme-bootstrap" data-sortable> <thead> <tr> <th data-sortable="false">Browser</th> <th data-sorted="true" data-sorted-direction="descending">Usage</th> <th>Initial release</th> <th>Stable version</th> </tr> </thead> <tbody> <tr> <td>Chrome</td> <td>42.68%</td> <td data-value="2008">September 2, 2008</td> <td>31.0.1650.57</td> </tr> <tr> <td>Internet Explorer</td> <td>25.44%</td> <td data-value="1995">August 16, 1995</td> <td>11.0.1</td> </tr> <tr> <td>Firefox</td> <td>20.01%</td> <td data-value="2002">September 23, 2002</td> <td>25.0.1</td> </tr> <tr> <td>Safari</td> <td>8.39%</td> <td data-value="2003">January 7, 2003</td> <td>7.0</td> </tr> <tr> <td>Opera</td> <td>1.03%</td> <td data-value="1994">Late 1994</td> <td>18.0.1284.49</td> </tr> <tr> <td>Other</td> <td data-value="0">2.44%</td> <td data-value="-1"></td> <td></td> </tr> </tbody> </table>
911
<p style="display: none"></p>
1012

1113
#### Features
@@ -32,19 +34,19 @@ For the most common usage of sortable, you'll want to include following:
3234

3335
```html
3436
<script src="sortable.min.js"></script>
35-
<link rel="stylesheet" href="sortable-theme-light.css" />
37+
<link rel="stylesheet" href="sortable-theme-bootstrap.css" />
3638
<script>setTimeout(function(){ sortable.init(); }, 0);</script>
3739
```
3840

3941
Now any table with the attribute `data-sortable` will be made sortable. To get the styling, you'll also need to add a class name to the table to match the theme you chose:
4042

4143
```html
42-
<table class="sortable-theme-light" data-sortable>
44+
<table class="sortable-theme-bootstrap" data-sortable>
4345
<!-- ... -->
4446
</table>
4547
```
4648

47-
This example uses the "light" theme. For a full list of supported themes, check out [Themes](/sortable/api/themes).
49+
This example uses the "bootstrap" theme. For a full list of supported themes, check out [Themes](/sortable/api/themes).
4850

4951
#### Learn More
5052

@@ -64,5 +66,13 @@ Sortable was built by [Adam Schwartz](http://twitter.com/adamfschwartz)
6466
<!-- Resources for the demos -->
6567
<p style="-webkit-transform: translateZ(0)"></p>
6668
<script src="/sortable/js/sortable.js"></script>
67-
<link rel="stylesheet" href="/sortable/css/sortable-theme-light.css" />
69+
<style>
70+
.hs-doc-content table {
71+
border: 0;
72+
}
73+
.hs-doc-content table th {
74+
background: initial;
75+
}
76+
</style>
77+
<link rel="stylesheet" href="/sortable/css/sortable-theme-bootstrap.css">
6878
<script>setTimeout(function(){ sortable.init(); }, 0);</script>

docs/welcome/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ <h2>The simplest, most elegant way to sort a table.</h2>
221221
<a class="button" href="http://github.com/hubspot/sortable">★ On Github</a> &nbsp;&nbsp;
222222
<a class="button dark" href="http://github.com/hubspot/sortable">Download</a>
223223
</p>
224-
<table data-sortable class="sortable-theme-light">
224+
<table class="sortable-theme-light" data-sortable>
225225
<thead>
226226
<tr>
227227
<th data-sortable="false">Browser</th>
@@ -284,7 +284,7 @@ <h1>How to Use</h1>
284284
<pre class=" language-markup"><code class=" language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>link</span> <span class="token attr-name">rel</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>stylesheet<span class="token punctuation">"</span></span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>sortable-theme-dark.css<span class="token punctuation">"</span></span> <span class="token punctuation">/&gt;</span></span>
285285
<span class="token script"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>sortable.min.js<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span></span></code></pre>
286286
<p>Add the attribute <code>data-sortable</code> and the theme class name to your <code>&lt;table&gt;</code> elements, and initialize them:</p>
287-
<pre class=" language-markup"><code class=" language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table</span> <span class="token attr-name">data-sortable</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>sortable-theme-dark<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
287+
<pre class=" language-markup"><code class=" language-markup"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>sortable-theme-dark<span class="token punctuation">"</span></span> <span class="token attr-name">data-sortable</span><span class="token punctuation">&gt;</span></span>
288288
<span class="token comment" spellcheck="true">&lt;!-- ... --&gt;</span>
289289
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>table</span><span class="token punctuation">&gt;</span></span>
290290
<span class="token script"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span>sortable<span class="token punctuation">.</span><span class="token function">init<span class="token punctuation">(</span></span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span></span></code></pre>
@@ -295,7 +295,7 @@ <h1>How to Use</h1>
295295
<div class="showcase-inner">
296296
<h1>Themes</h1>
297297
<h2>Sortables for every occasion.</h2>
298-
<table id="themeTable" data-sortable class="sortable-theme-bootstrap">
298+
<table id="themeTable" class="sortable-theme-bootstrap" data-sortable>
299299
<thead>
300300
<tr>
301301
<th data-sortable="false">Browser</th>

0 commit comments

Comments
 (0)