Skip to content

Commit

Permalink
Language categorization (common/others split) moved entirely to build.py
Browse files Browse the repository at this point in the history
  • Loading branch information
isagalaev committed Sep 19, 2011
1 parent ab921fe commit f06f3dc
Show file tree
Hide file tree
Showing 15 changed files with 11 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/languages/bash.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
Language: Bash
Author: vah <vahtenberg@gmail.com>
Category: common
*/

hljs.LANGUAGES.bash = function(){
Expand Down
1 change: 0 additions & 1 deletion src/languages/cpp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Language: C++
Category: common
*/

hljs.LANGUAGES.cpp = function(){
Expand Down
1 change: 0 additions & 1 deletion src/languages/cs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
Language: C#
Author: Jason Diamond <jason@diamond.name>
Category: common
*/

hljs.LANGUAGES.cs = {
Expand Down
1 change: 0 additions & 1 deletion src/languages/css.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Language: CSS
Category: common
*/

hljs.LANGUAGES.css = function() {
Expand Down
1 change: 0 additions & 1 deletion src/languages/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Language: Diff
Description: Unified and context diff
Author: Vasily Polovnyov <vast@whiteants.net>
Category: common
*/

hljs.LANGUAGES.diff = {
Expand Down
1 change: 0 additions & 1 deletion src/languages/ini.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Language: Ini
Category: common
*/

hljs.LANGUAGES.ini = {
Expand Down
1 change: 0 additions & 1 deletion src/languages/java.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
Language: Java
Author: Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
Category: common
*/

hljs.LANGUAGES.java = {
Expand Down
1 change: 0 additions & 1 deletion src/languages/javascript.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Language: Javascript
Category: common
*/

hljs.LANGUAGES.javascript = {
Expand Down
1 change: 0 additions & 1 deletion src/languages/perl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
Language: Perl
Author: Peter Leonov <gojpeg@yandex.ru>
Category: common
*/

hljs.LANGUAGES.perl = function(){
Expand Down
1 change: 0 additions & 1 deletion src/languages/php.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
Language: PHP
Author: Victor Karamzin <Victor.Karamzin@enterra-inc.com>
Category: common
*/

hljs.LANGUAGES.php = {
Expand Down
1 change: 0 additions & 1 deletion src/languages/python.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Language: Python
Category: common
*/

hljs.LANGUAGES.python = function() {
Expand Down
1 change: 0 additions & 1 deletion src/languages/ruby.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Language: Ruby
Author: Anton Kovalyov <anton@kovalyov.net>
Contributors: Peter Leonov <gojpeg@yandex.ru>, Vasily Polovnyov <vast@whiteants.net>, Loren Segal <lsegal@soen.ca>
Category: common
*/

hljs.LANGUAGES.ruby = function(){
Expand Down
1 change: 0 additions & 1 deletion src/languages/sql.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Language: SQL
Category: common
*/

hljs.LANGUAGES.sql = {
Expand Down
1 change: 0 additions & 1 deletion src/languages/xml.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Language: HTML, XML
Category: common
*/

hljs.LANGUAGES.xml = function(){
Expand Down
12 changes: 11 additions & 1 deletion tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
'keywordGroups': 'kG',
}

CATEGORIES = {
'common': ['bash', 'java', 'ini', 'sql', 'diff', 'php', 'cs', 'cpp', 'ruby', 'python', 'css', 'perl', 'xml', 'javascript'],
}

def compress_content(tools_path, content):
cmd = 'java -jar %s --type js' % os.path.join(tools_path, 'yuicompressor.jar')

Expand Down Expand Up @@ -102,9 +106,15 @@ def language_filenames(src_path, languages):
categories = set(l for l in languages if l.startswith(':'))
languages = set(languages) - categories
categories = set(c.strip(':') for c in categories)
cat_languages = reduce(
lambda a, b: set(a) | set(b),
[l for c, l in CATEGORIES.items() if c in categories],
set()
)
languages |= cat_languages
infos = [
(i, f) for i, f in infos
if os.path.splitext(f)[0] in languages or i.get('Category') in categories
if os.path.splitext(f)[0] in languages
]

def append(filename):
Expand Down

0 comments on commit f06f3dc

Please sign in to comment.