Skip to content

Commit e449eb3

Browse files
author
Tom Clark
committed
Added basic support for authors/source location/license information
1 parent ac8eee3 commit e449eb3

File tree

7 files changed

+52
-17
lines changed

7 files changed

+52
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tutorials.github.com
22
====================
33

4-
tutorials.github.com is a simple hack that uses GitHub Pages to fulfill a need of mine: easily collecting and forking programming tutorials and offering polyglot versions.
4+
tutorials.github.com is a simple hack that uses GitHub Pages to fulfill a need of mine: collecting disparate tutorials and allowing others to easily fork them so the full range of languages and systems is covered.
55

66
Examples
77
========

_layouts/default.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
<h1><a href="http://tutorials.github.com">tutorials.github.com</a></h1>
3838
<p>Decentralized polyglot tutorials</p>
3939
<nav id="sidebar"></nav>
40-
<p class="view"><a href="https://github.com/tutorials/tutorials.github.com">View the Project on GitHub <small>tutorials/tutorials.github.com</small></a></p>
4140
<ul id="download">
4241
<li><a href="https://github.com/tutorials/tutorials.github.com/zipball/master">Download <strong>ZIP File</strong></a></li>
4342
<li><a href="https://github.com/tutorials/tutorials.github.com/tarball/master">Download <strong>TAR Ball</strong></a></li>
@@ -54,7 +53,6 @@ <h1><a href="http://tutorials.github.com">tutorials.github.com</a></h1>
5453
</div>
5554
<!--[if !IE]><script>fixScale(document);</script><!--<![endif]-->
5655
<script id="sidebar_template" type="text/x-underscore" charset="utf-8">
57-
<em>(Click on us!)</em>
5856
<% _(visible).each(function(values, name) { %>
5957
<h3><%= name %> (<%= visible_counts[name] %>)</h3>
6058
<ul>

index.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ ignore: true
77
README
88
======
99

10-
tutorials.github.com is a simple hack that uses GitHub Pages to fulfill a need of mine: easily collecting and forking programming tutorials and offering polyglot versions.
11-
12-
Amazon has proven (citation needed) that faceted navigation is superior to search, so let's use that idea for education!
10+
tutorials.github.com is a simple hack that uses GitHub Pages to fulfill a need of mine: collecting disparate tutorials and allowing others to easily fork them so the full range of languages and systems is covered.
1311

1412
For now, each topic is its own page, and you use the sidebar navigation to drill down into a variant that's most useful to you. It might not look like it, but __the navigation is clickable!__ Try clicking on a language in the [Hello, World!](/pages/hello-world.html) example to get a feel for the navigation.
1513

16-
I _really_ like the idea of customized documentation. If you're looking for documentation, you no longer have to parse a generic tutorial for what's relavent to you and your setup. And if you're an author, you no longer need to inline special directions if someone's on xyz architecture. Just fork the repo, copy an existing tutorial, update the tags, and send a pull request!
17-
1814
In the future, I'll add cookies so the site will apply filters for you and a central collection of tags/values so we have some consistency across various tutorials.
1915

2016
This project originated as a full-blown rails app backed by a database, and I reached a point where I needed user accounts and git repos. Dreading that, I threw it all away for a simpler, git-based workflow to upload data. I sincerely hope you enjoy it and find it useful.
@@ -34,9 +30,4 @@ Contributing
3430
- Add a new file (or modify an existing one)
3531
- Send me a pull request
3632

37-
Hi, Hacker News!
38-
================
39-
40-
I appreciate the upvotes!
41-
4233
Note: This project is not affiliated with GitHub Inc.

javascripts/sidebar.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@ $(function() {
77
// Mark all tutorials as visible
88
tutorials.show();
99

10+
// Render license/source information
11+
_(tutorials).each(function(tutorial){
12+
t = $(tutorial)
13+
d = t.data()
14+
attribution = ""
15+
if(d.authorGithub) {
16+
attribution += '<li>Author: <a href="http://github.com/' + d.authorGithub + '">' + d.authorGithub + '</a></li>'
17+
} else if(d.author) {
18+
attribution += "<li>Author: " + d.author + "</li>"
19+
}
20+
if(d.source) {
21+
attribution += '<li><a href="' + d.source + '">Original Source</a></li>'
22+
if(d.license) {
23+
attribution += '<li><a href="' + d.license + '">License</a></li>'
24+
}
25+
}
26+
if(attribution) { t.prepend("<ul>" + attribution + "</ul>")}
27+
});
28+
1029
dict = _.chain(tutorials)
1130
.reduce(function(lookup, tutorial) {
1231
_($(tutorial).data().facets).each(function(val, key) {

pages/another_test.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ puts markdown.to_html
2727

2828
Here's a test of GFM:
2929

30+
* User: @mojombo
3031
* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
3132
* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
3233
* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2

pages/hello-world.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Hello, World!
88

99
Here are some examples of "Hello, World!" in various programming languages.
1010

11-
<div markdown="1" class="tutorial" data-author="Whitespace" data-facets='{"Language": "ActionScript", "Type System": "Static"}'>
11+
<div markdown="1" class="tutorial" data-facets='{"Language": "ActionScript", "Type System": "Static"}'>
1212
ActionScript
1313
------------
1414

pages/installing-mysql.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ title: Installing MySQL
66
Installing MySQL
77
================
88

9-
<div markdown="1" class="tutorial" data-author="Whitespace" data-facets='{"Operating System": "Ubuntu", "Package Management": "APT", "MySQL Version": "5.1"}'>
9+
<div
10+
markdown="1"
11+
class="tutorial"
12+
data-author="Ubuntu Documentation Team"
13+
data-source="https://help.ubuntu.com/11.10/serverguide/mysql.html"
14+
data-license="https://help.ubuntu.com/legal.html"
15+
data-facets='{"Operating System": "Ubuntu 11.10", "Package Management": "APT", "MySQL Version": "5.1"}'>
1016
To install MySQL, run the following command from a terminal prompt:
1117

1218
{% highlight sh %}
@@ -48,9 +54,17 @@ After making a change to `/etc/mysql/my.cnf` the __mysql__ daemon will need to b
4854
{% highlight sh %}
4955
sudo /etc/init.d/mysql restart
5056
{% endhighlight %}
57+
58+
---------------------------------------------------------
59+
5160
</div>
5261

53-
<div markdown="1" class="tutorial" data-author="Whitespace" data-facets='{"Operating System": "OS X", "Package Management": "Source", "MySQL Version": "5.1"}'>
62+
<div
63+
markdown="1"
64+
class="tutorial"
65+
data-author-github="hivelogic"
66+
data-source="http://hivelogic.com/articles/compiling-mysql-on-snow-leopard/"
67+
data-facets='{"Operating System": "OS X", "Package Management": "Source", "MySQL Version": "5.1"}'>
5468
These are instructions for compiling and installing a 64-bit version of [MySQL](http://www.mysql.com/), the world's most popular open source database, on Mac OS X 10.6 (Snow Leopard).
5569

5670
The benefits of manually building MySQL yourself in `/usr/local` are detailed [here](http://hivelogic.com/articles/using_usr_local/). I also wrote a in-depth explanation of why you might want to build MySQL yourself in my [Compiling MySQL on Leopard](http://hivelogic.com/articles/installing-mysql-on-mac-os-x/) article.
@@ -202,9 +216,17 @@ sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
202216
{% endhighlight %}
203217

204218
That should do it.
219+
220+
---------------------------------------------------------
221+
205222
</div>
206223

207-
<div markdown="1" class="tutorial" data-facets='{"Operating System": "OS X", "Package Management": "Homebrew", "MySQL Version": "5.5"}'>
224+
<div
225+
markdown="1"
226+
class="tutorial"
227+
data-author-github="trey"
228+
data-source="http://solutions.trey.cc/2010/02/28/installing-mysql-on-snow-leopard-using-homebrew/"
229+
data-facets='{"Operating System": "OS X", "Package Management": "Homebrew", "MySQL Version": "5.5"}'>
208230
If you already have a `/usr/local` folder and it's not owned by your user:
209231

210232
{% highlight sh %}
@@ -241,3 +263,7 @@ And make sure it automatically starts again on login:
241263
{% highlight sh %}
242264
launchctl load -w /usr/local/Cellar/mysql/5.1.43/com.mysql.mysqld.plist
243265
{% endhighlight %}
266+
267+
---------------------------------------------------------
268+
269+
</div>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy