Skip to content

Commit c204a58

Browse files
committed
Tons of changes, updated all the docs to the latest version, navigation works, webstylesheet is 99% done. Also added language config file
1 parent 6cc502e commit c204a58

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1250
-2568
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/site/index.html
22
/build
3+
/html
4+
/site/de

garden.js renamed to build.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ var format = new require('fomatto').Formatter();
1111
// ------------------------------------------------------------------------------
1212
var Garden = Class(function(options) {
1313
var languages = fs.readdirSync(options.dir);
14+
1415
this.languages = {};
1516
this.options = options;
17+
this.options.language = this.json([this.options.dir, 'language.json'].join('/'));
1618

1719
var that = this;
1820
languages.forEach(function(lang) {
@@ -111,8 +113,11 @@ var Garden = Class(function(options) {
111113

112114
toMarkdown: function(text) {
113115
text = md.Markdown(text).replace(/'/g,''');
114-
return text.replace(/<blockquote>/g, '<aside>').
116+
text = text.replace(/<blockquote>/g, '<aside>').
115117
replace(/<\/blockquote>/g, '</aside>');
118+
119+
return text.replace(/<aside>\s+<p><strong>ES5/g,
120+
'<aside class="es5"><p><strong>ES5');
116121
},
117122

118123
json: function(file) {
@@ -137,10 +142,20 @@ var Garden = Class(function(options) {
137142
var lang = this.languages[language];
138143
if (lang) {
139144
this.log('Rendering "{}" to "{}"...', language, out);
145+
146+
var languages = [];
147+
for(var i in this.languages) {
148+
if (this.languages.hasOwnProperty(i)) {
149+
if (this.options.language.listed.indexOf(i) !== -1) {
150+
languages.push(this.languages[i]);
151+
}
152+
}
153+
}
154+
140155
var options = {
141-
baseLanguage: this.options.base,
156+
baseLanguage: this.options.language.default,
142157
language: language,
143-
languages: this.languages,
158+
languages: languages,
144159
title: lang.index.title,
145160
description: lang.index.description,
146161
navigation: lang.navigation,
@@ -168,7 +183,7 @@ var Garden = Class(function(options) {
168183
var that = this;
169184

170185
var dir = [this.options.out];
171-
if (lang !== this.options.base) {
186+
if (lang !== this.options.language.default) {
172187
dir.push(lang);
173188
}
174189
dir = dir.join('/');
@@ -182,5 +197,5 @@ var Garden = Class(function(options) {
182197
}
183198
});
184199

185-
new Garden({dir: 'doc', base: 'en', template: 'garden.jade', out: 'site'});
200+
new Garden({dir: 'doc', template: 'garden.jade', out: 'site'});
186201

doc/array/constructor.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

doc/array/general.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

doc/core/eval.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

doc/core/semicolon.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

doc/core/undefined.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

doc/de/index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "JavaScript Garden",
3-
"langTitle": "JavaScript Garden auf Deutsch",
4-
"description": "Ein Guide zu JavaScript Ecken und Kanten.",
3+
"langTitle": "JavaScript Garden in Deutsch",
4+
"description": "Ein Guide über JavaScript's Ecken und Kanten.",
55
"sections": [
66
{
77
"title": "Einführung",

doc/de/intro/authors.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
This guide is the work of two lovely Stack Overflow users, [Ivo Wetzel][1]
44
(Writing) and [Zhang Yi Jiang][2] (Design).
55

6-
In case you are interested in additional guidance or reviews concerning your JavaScript
7-
projects, Ivo Wetzel offers these on a freelance basis. Please feel free to
8-
contact him via [e-mail][3] for further details.
9-
10-
[1]: http://stackoverflow.com/users/313758/yi-jiang
11-
[2]: http://stackoverflow.com/users/170224/ivo-wetzel
12-
[3]: mailto:[email protected]
6+
[1]: http://stackoverflow.com/users/170224/ivo-wetzel
7+
[2]: http://stackoverflow.com/users/313758/yi-jiang
138

doc/de/intro/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
## Einführung
22

3-
Übersetzen.
3+
Demnächst.
44

0 commit comments

Comments
 (0)