diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c37ad084..00000000 --- a/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -/build -/html -/log -/node_modules -/.idea/* - -/site -!/site/favicon.ico -!/site/image -!/site/javascript -!/site/style -!/site/style - -*.md~ -*.src.md -*.DS_store diff --git a/.lvimrc b/.lvimrc deleted file mode 100644 index 23b445a9..00000000 --- a/.lvimrc +++ /dev/null @@ -1,4 +0,0 @@ -set wildignore=node_modules -set tabstop=2 -set shiftwidth=2 -set softtabstop=2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index fe3c6b6f..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,19 +0,0 @@ -# Contributing to Javascript Garden - -1. We're about Javascript AKA [ECMA script](http://www.ecma-international.org/ecma-262/5.1/) not a specific implementation. So we don't cover issues specific to one environment or interpreter, like browsers or V8 for node. -1. Micro-performance is out of scope: anything that's not a result of essential algorithmic complexity (e.g O(log n) vs O(n^2)) is down to a specific version of a specific interpreter (see 1). -1. Please test code examples to ensure they work, there's nothing more confusing than incorrect examples! -1. Contributing to JS Garden makes you a fantastic person, and Brendan Eich will find you immensely attractive. - -Thank you for being kind enough to help out! - -## Testing locally - -1. Run `npm run build` to build -1. Run a webserver from the root of the repo to view - -## Getting changes merged - -1. Squash your changes into one commit -1. Make sure the site still works :) -1. Make a PR diff --git a/JavaScript-Garden b/JavaScript-Garden deleted file mode 120000 index dcc6db5e..00000000 --- a/JavaScript-Garden +++ /dev/null @@ -1 +0,0 @@ -./site \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 89d4396c..00000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2010 Ivo Wetzel. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/README.md b/README.md deleted file mode 100644 index be02cfd5..00000000 --- a/README.md +++ /dev/null @@ -1,55 +0,0 @@ -JavaScript Garden -================= - -2024 update: this project has not been actively maintained in years. The original author -[took the site down](https://github.com/BonsaiDen/JavaScript-Garden/commit/93278fbcafa569fd193f8784abc267e9db09c645) -in 2022 (no judgement - updating it would be a big project!). At that point it was already long out of date, e.g. missing -the new language features from ES6 onwards. - -Many excellent modern guides exist, e.g. [Eloquent Javascript](https://eloquentjavascript.net/), or -the [MDN guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript). - -Thanks for all the maintainers and translators over the years! - ------ - -**JavaScript Garden** is a growing collection of documentation about the most -quirky parts of the JavaScript programming language. It gives advice to -avoid common mistakes, subtle bugs, as well as performance issues and bad -practices that non-expert JavaScript programmers may encounter on their -endeavours into the depths of the language. - -JavaScript Garden does **not** aim to teach you JavaScript. Former knowledge -of the language is strongly recommended in order to understand the topics covered -in this guide. In order to learn the basics of the language, please head over to -the excellent [guide][1] on the Mozilla Developer Network. - -### The authors - -This guide is the work of two lovely Stack Overflow users, [Ivo Wetzel][6] -(Original English Language Version) and [Zhang Yi Jiang][5] (Design), and -[many others](https://github.com/BonsaiDen/JavaScript-Garden/graphs/contributors) -who've worked hard to provide translations or fixes. - -It was maintained by [Tim Ruffles](http://twitter.com/timruffles) from 2013-2020ish. - -## Contributing - -Please submit fixes and translations as [pull requests](https://help.github.com/articles/using-pull-requests). - -### License - -JavaScript Garden is published under the [MIT license][2] and hosted on -[GitHub][4]. If you find errors or typos please [file an issue][3] or a pull -request on the repository. You can also find us in the [JavaScript room][10] on -Stack Overflow chat. - -[1]: https://developer.mozilla.org/en/JavaScript/Guide -[2]: https://github.com/BonsaiDen/JavaScript-Garden/blob/next/LICENSE -[3]: https://github.com/BonsaiDen/JavaScript-Garden/issues -[4]: https://github.com/BonsaiDen/JavaScript-Garden -[5]: http://stackoverflow.com/users/313758/yi-jiang -[6]: http://stackoverflow.com/users/170224/ivo-wetzel -[8]: https://github.com/caio -[9]: https://github.com/blixt -[10]: http://chat.stackoverflow.com/rooms/17/javascript diff --git a/build.js b/build.js deleted file mode 100644 index 0c7be50a..00000000 --- a/build.js +++ /dev/null @@ -1,106 +0,0 @@ -var fs = require("fs"); -var _ = require("lodash"); -var jade = require('jade'); -var md = require("marked"); - -function main(opts) { - loadLanguages(opts.languagesDir) - .sort(function(a,b) { - return a.id > b.id ? 1 : -1 - }) - .forEach(function(lang,_,languages) { - outputLanguage(lang,languages,opts); - }); -} - -function loadLanguages(path) { - var index = readJson(path + "/language.json"); - var availableListedLanguages = _.intersection(index.listed,fs.readdirSync(path)); - return availableListedLanguages.reduce(function(all,lang) { - var langPath = path + "/" + lang; - if(!fs.statSync(langPath).isDirectory()) return all; - var data = _.extend(loadLanguage(langPath),{id: lang}); - return all.concat(data); - },[]); -} - -function loadLanguage(path) { - var index = readJson(path + '/index.json'); - var language = _.extend(index,{ - sections: index.sections.map(function(section) { - return _.extend(section,{ - link: section.dir, - isIntro: section.dir == "intro", - articles: section.articles.map(function(article) { - return _.extend({ - link: section.dir + "." + article - },loadArticle(path + "/" + section.dir + "/" + article + ".md")); - }) - }) - }) - }); - language.navigation = language.sections; - return language; -} - -function loadArticle(path) { - var text = fs.readFileSync(path,"utf8"); - var title = text.substring(0, text.indexOf('\n')); - text = text.substring(title.length); - title = md(title.replace(/\#/g, '').trim()); - var titleText = title.substring(3, title.length - 5); - text = processArticleBody(text); - - var parts = text.split('

'); - var subs = parts.map(function(sub,i) { - return (i > 0 ? '

' : '') + sub; - }); - - return { - title: titleText, - text: text, - subs: subs - }; -} - -function processArticleBody(text) { - text = md(text).replace(/'/g,'''); - text = text.replace(/
/g, ''); - - return text.replace(/