Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions README.mkd → README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
Solarized Colorscheme for TextMate
=============================
==================================

See the [Solarized homepage](http://ethanschoonover.com/solarized) for screenshots,
details and colorscheme versions for Vim, Mutt, popular terminal emulators and
other applications.
See the [Solarized homepage] for screenshots, details, and
colorscheme versions for Vim, Mutt, popular terminal emulators,
and other applications.


Downloads
---------

If you have come across this page via github please visit the main [Solarized homepage](http://ethanschoonover.com/solarized)
If you have come across this page via GitHub,
please visit the [Solarized homepage].

[Solarized homepage]: http://ethanschoonover.com/solarized
[Solarized repository]: https://github.com/altercation/solarized

Contribute
---------

The goal is to get as-close-as-possible to the rendering of the same file in Vim. If you would like to help, here's how to get involved.

Contribute
----------
The goal is to get as-close-as-possible to the rendering of the same file in Vim.
If you would like to help, here's how to get involved:

1. Fork this repo and checkout your own copy.
2. Download the [sample documents](https://github.com/altercation/solarized/tree/master/utils/tests).
3. Checkout this guide to [TextMate theme development](http://manual.macromates.com/en/themes).
4. Check the [issues](https://github.com/deplorableword/textmate-solarized/issues) to see what needs working on.
3. Make your changes to files under `src/`
- Please change only one language per commit. (Changing both light & dark is okay.)
- Please specify colors using the `__«COLOR»__` convention seen throughout the files.
(This ensures color consistency with the official Solarized colors, as well as
color consistency between different languages.)

Here are a couple of useful resources:

* [Guide to TextMate theme development](http://manual.macromates.com/en/themes).
* [Issues](https://github.com/deplorableword/textmate-solarized/issues) lists what needs to be worked on.


Contributors
---------
------------
* [deplorableword](https://github.com/deplorableword)
* [fentie](https://github.com/fentie)
* [bmthykm](https://github.com/bmthykm)
Expand All @@ -39,6 +49,8 @@ Contributors
* [evanmoran](https://github.com/evanmoran)
* [iristyle](https://github.com/iristyle)
* [albertboada](https://github.com/albertboada)
* [Zearin](https://github.com/Zearin)


License
-------
Expand Down
215 changes: 215 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
#!/usr/bin/env bash
# -*- coding: utf-8 -*-


#--------------------------------------------------------------------
# Concatenates language-specific pieces of the Solarized them
# under $DIRSRC (default: ‘src’), and builds them into the
# dark and light *.tmTheme files under $DIRBUILD (default: ‘build’).
#--------------------------------------------------------------------


#--------------------------------------------------------------------
# DIRECTORIES
#
readonly DIRSRC='src'
readonly DIRBUILD='build'


#--------------------------------------------------------------------
# Solarized colors
# http://ethanschoonover.com/solarized/#the-values
#
readonly BASE03='#002b36'
readonly BASE02='#073642'
readonly BASE01='#586e75'
readonly BASE00='#657b83'

readonly BASE0='#839496'
readonly BASE1='#93a1a1'
readonly BASE2='#eee8d5'
readonly BASE3='#fdf6e3'

readonly YELLOW='#b58900'
readonly ORANGE='#cb4b16'
readonly RED='#dc322f'
readonly MAGENTA='#d33682'
readonly VIOLET='#6c71c4'
readonly BLUE='#268bd2'
readonly CYAN='#2aa198'
readonly GREEN='#859900'


#--------------------------------------------------------------------
# Array containing parts for concatenation
#
declare -a PARTS=(
'_HEAD'
'css'
'js'
'html'
'ruby'
'php'
'c'
'diff'
'markdown'
'rest'
'other'
'tex'
'python'
'shell'
'java'
'perl'
'text'
'sublimelinter'
'_TAIL'
);


#--------------------------------------------------------------------
# Returns path and filename for a theme being built
#
getBuildFile ()
{
local _DIRBUILD=$1
local THEMESTYLE=$2

outfile="${_DIRBUILD}"/"Solarized (${THEMESTYLE}).tmTheme"

echo "${outfile}"
}


#--------------------------------------------------------------------
# Cleans previous builds
#
clean ()
{
echo "Cleaning ‘${DIRBUILD}/’..."
rm -rf "$DIRBUILD" && mkdir "$DIRBUILD"
}


#--------------------------------------------------------------------
# Accepts either 'light' or 'dark' argument,
# concatenates files under $DIRSRC with that suffix,
# and outputs result to $DIRBUILD.
#
concat ()
{
echo "Concatenating ‘${outfile}’..."

outfile=$1

if [[ $outfile = '' ]]; then
echo "ERROR: no outfile to concat()"
exit 1
fi

for i in "${PARTS[@]}"
do
infile="${DIRSRC}/${i}"
cat "${infile}" >> "${outfile}"
done
}


#--------------------------------------------------------------------
# Replace variables with Solarized color values
#
colorize ()
{
style=$1
filename=$2



echo "Colorizing ‘${filename}’..."

# Solarized (dark) is the default color palette;
# For (light), swap the four "base" colors by
# "toggling" a leading zero for each of them.
case $style in

"dark")
STYLE='dark'
UUID='A4299D9B-1DE5-4BC4-87F6-A757E71B1597'
sed -i '' \
-e "s/__STYLE__/"$STYLE"/g" \
-e "s/__BASE03__/"$BASE03"/g" \
-e "s/__BASE02__/"$BASE02"/g" \
-e "s/__BASE01__/"$BASE01"/g" \
-e "s/__BASE00__/"$BASE00"/g" \
-e "s/__BASE0__/"$BASE0"/g" \
-e "s/__BASE1__/"$BASE1"/g" \
-e "s/__BASE2__/"$BASE2"/g" \
-e "s/__BASE3__/"$BASE3"/g" \
-e "s/__YELLOW__/"$YELLOW"/g" \
-e "s/__ORANGE__/"$ORANGE"/g" \
-e "s/__RED__/"$RED"/g" \
-e "s/__MAGENTA__/"$MAGENTA"/g"\
-e "s/__VIOLET__/"$VIOLET"/g" \
-e "s/__BLUE__/"$BLUE"/g" \
-e "s/__CYAN__/"$CYAN"/g" \
-e "s/__GREEN__/"$GREEN"/g" \
-e "s/__UUID__/"$UUID"/g" \
-- "${filename}"
;;

"light")
STYLE='light'
UUID='38E819D9-AE02-452F-9231-ECC3B204AFD7'
sed -i '' \
-e "s/__STYLE__/"$STYLE"/g" \
-e "s/__BASE03__/"$BASE3"/g" \
-e "s/__BASE02__/"$BASE2"/g" \
-e "s/__BASE01__/"$BASE1"/g" \
-e "s/__BASE00__/"$BASE0"/g" \
-e "s/__BASE0__/"$BASE00"/g" \
-e "s/__BASE1__/"$BASE01"/g" \
-e "s/__BASE2__/"$BASE02"/g" \
-e "s/__BASE3__/"$BASE03"/g" \
-e "s/__YELLOW__/"$YELLOW"/g" \
-e "s/__ORANGE__/"$ORANGE"/g" \
-e "s/__RED__/"$RED"/g" \
-e "s/__MAGENTA__/"$MAGENTA"/g"\
-e "s/__VIOLET__/"$VIOLET"/g" \
-e "s/__BLUE__/"$BLUE"/g" \
-e "s/__CYAN__/"$CYAN"/g" \
-e "s/__GREEN__/"$GREEN"/g" \
-e "s/__UUID__/"$UUID"/g" \
-- "${filename}"
;;

*)
echo "ERROR in colorize()!"
echo "The first argument must be 'light' or 'dark'"
exit 1
;;
esac
}


#--------------------------------------------------------------------
# Cleans $DIRBUILD and regenerates theme files
#
run ()
{
clean
for style in "light" "dark"
do
outfile=$( getBuildFile "${DIRBUILD}" "${style}" )
concat "${outfile}"
colorize "${style}" "${outfile}"
done

echo "Done!" && exit 0
}


#--------------------------------------------------------------------
# It’s run() time
#
run && exit 0

exit 1
40 changes: 40 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# `src/`


## How this directory is organized

Files in this directory each contain a piece of the Solarized code.
Each file is named for a specific language, and contains the instructions
for syntax highlights according to Solarized.

The only exceptions to this naming scheme are the `_HEAD` and `_TAIL` files.
These contain the beginning and end of each `*.tmTheme` file, and the only files
that do not contain language-specific code.

The build process automatically generates both the “dark” and “light” flavors
of the Solarized theme from this single set of files. The files in this
directory contain the colors for the “dark” flavor. The “light” Solarized theme
is generated by the `build.sh` script, which flips the 4 base pairs of colors.


### Files here are **not** valid (or well-formed) XML

To build the two `*.tmTheme` files, these files are simply concatenated together.
Therefore, they’re *not* valid (or well-formed), but the build results are.

(There are other XML tools, like XInclude, that could combine these files together, as well.
However, they often require Java, and they're more complicated than necessary here.
The current build method is a nice simple shell script.)


## Use `__«COLOR»__`s

In this directory, nearly all color values are specified using the form `__«COLOR»__`,
where `__«COLOR»__` is one of the color names as seen on
[the official Solarized color table](http://ethanschoonover.com/solarized#the-values).

During the build process, these placeholders are replaced with their hex color values.

There are a few places where a literal color value is used.
Occasionally this is desireable--but it should always be the exception, not the rule.
Use your best judgment.
Loading