"
+ revision "1.1"
+ revdate "July 16, 1999 (Friday, 18:55h)"
+ created "April 02, 1999 (Friday, 19:26h)"
+
+ Sample
+ static char *foo (const int a, const int b)
+ /*
+ * Do the foo on the bar and around again.
+ *
+ * a number of doodlefrobs
+ * b barfoo mode (0 == off)
+ *
+ * Memory will be allocated for the result.
+ * Should only be called for lines of length > 0;
+ *
+ * RETURNS: Success: Pointer to result line
+ * Error: -1 (e.g. frobs depleted)
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+ {
+ static char temp ....
+ int ii; ....
+ ends
+
+ indent "none" # alternatives: "box", "text"
+
+ shapes {
+ wnw ("/*")
+ w (" *")
+ sw ("* ", " *")
+ ssw ("*", "/")
+ s (" *", " ")
+ }
+
+ elastic (s, w)
+
+ delimiter ?"
+
+ replace "\*/" with "*\/" # quote closing comment tags
+ reverse "\*\\/" to "*/"
+
+ padding {
+ left 2
+ vertical 1
+ }
+
+ END tjc
+
+Note the `SAMPLE` block of the latter example. It shows much more than just the box itself, trying to give the user an impression of what the box would look like if used in reality. We only need half the backslashes in the `REVERSE` and `REPLACE` statements because we use `delimiter` to change the escape character from backslash to question mark.
+
+
+[ [up](index.html) \| next ]
diff --git a/_includes/docs/config-general.md b/_includes/docs/config-general.md
new file mode 100644
index 0000000..14fcd9a
--- /dev/null
+++ b/_includes/docs/config-general.md
@@ -0,0 +1,63 @@
+# Box Designs
+
+*Boxes* can draw and remove the boxes whose designs are defined in its configuration file. This page is intended to describe the concept of a *box design*, clarify some terms used to describe a box design, and how to define your own box designs.
+
+## General Box Layout
+
+A box design consists of up to 16 so-called **shapes** which are labeled in a fashion similar to the points of the compass:
+
+ +---------+---------+-----------------+---------+---------+
+ | | | | | |
+ | NW | NNW | N | NNE | NE |
+ | | | | | |
+ +---------+---------+-----------------+---------+---------+
+ | | padding | |
+ | WNW | +-- - - - - - - - - - - - - - --+ | ENE |
+ | | | | | |
+ +---------+ +---------+
+ | | | | | |
+ | | original | |
+ | W | | input | | E |
+ | | text | |
+ | | | | | |
+ +---------+ +---------+
+ | | | | | |
+ | WSW | +-- - - - - - - - - - - - - - --+ | ESE |
+ | | padding | |
+ +---------+---------+-----------------+---------+---------+
+ | | | | | |
+ | SW | SSW | S | SSE | SE |
+ | | | | | |
+ +---------+---------+-----------------+---------+---------+
+
+The sides of the box are sometimes referred to as *top* (instead of north), *right* (instead of east), *bottom* (south), and *left* (west), in order to avoid confusion with *shapes* of the same name. The group of shapes NW, NE, SE, and SW is referred to as the *corner shapes*. The groups of shapes between two corner shapes are called the *side shapes*.
+
+## Shape Restrictions
+
+A design definition does not necessarily need to include specifications for all 16 shapes. You only need to specify the shapes that you need. Of course, at least one shape must be specified.
+
+ - All shapes on a vertical side (inluding corners) must be of equal width.
+ - All shapes on a horizontal side (including corners) must be of equal height.
+
+In order to let the box have a dynamic size, certain side shapes must be drawn repeatedly. Those shapes are called **elastic** shapes.
+
+ - At least one shape per side must be elastic.
+ - Corners may not be elastic.
+ - No two neighboring shapes may be elastic, i.e. there must always be at least one static shape in between two elastic shapes.
+
+You don't really need to worry about these restrictions. *Boxes* will tell you if you violate any of them. So if *boxes* does not complain, your design is (at least syntactically) great.
+
+
+## Open Box Sides
+
+Many box designs require open box sides, for instance most regional comments. In response to that insight, it was decided to make empty box sides into a supported feature. Thus, if you define a box side to consist entirely of spaces, that side will be considered **open** and it will not appear in the output.
+
+Of course, you don't need to actually put the empty shapes into the config file, but *boxes* will automagically generate empty shapes if they are needed. (Internally, boxes always need at least 8 shapes - the corners, and one shape per side.) When the box is generated, those empty sides will be left out. Thus, boxes can be created which are open on any side.
+
+
+## Padding Area
+
+The last thing to mention about a box design is the **padding area**, which surrounds the original input text as shown in the figure above. The padding area is located inside the actual box and consists only of spaces. It is frequently used to keep the text from coming too close to the box (that might not look so good in some cases) unless absolutely necessary. "Absolutely necessary" usually means that the user has specified a very small box size. It is also possible to control the padding from the command line, which is why the above figure shows the padding area as a dotted box.
+
+
+[ [up](index.html) \| [next](config-syntax.html) ]
diff --git a/_includes/docs/config-step.md b/_includes/docs/config-step.md
new file mode 100644
index 0000000..033b290
--- /dev/null
+++ b/_includes/docs/config-step.md
@@ -0,0 +1,26 @@
+# A New Design, Step By Step
+
+Finally, we will take a brief look at the step-by-step process of creating a new design. A complex new design can be done in less than five minutes!
+
+ 1. **Create an empty box design.** The only entry so far between the `BOX` and `END` statements is an empty `SAMPLE` block.
+
+ 1. **Draw your box.** Do it inside the sample block. Just draw it like you think it should look.
+
+ 1. **Create the `SHAPE` block.** Create your shapes by pasting from the `SAMPLE` block. Remember that all lines in shape definitions must be of equal length.
+
+ 1. **Add the other entries.** You must at least add the `ELASTIC` entry, but this is also the time to add any other entries you might need.
+
+ 1. **Take care of quoting.** There are two ways to do that:
+
+ - If there are only a few double quotes or backslashes in your strings, tell your editor to double all backslashes in the `SHAPE` block for you. Do not double the backslashes before this point, or you will not be able to undo it so easily (see below).
+ Then escape the double quotes (`"`) by telling your editor to put a backslash in front of every double quote which is part of a string.
+ - If you've got a lot of double quotes or backslashes in your strings, simply choose some other characters to be the special characters. This is achieved via the [`delimiter` statement](config-syntax.html#delim).
+
+ 1. **Do not leave your editor just yet!** Instead try out your design. This is because if you made a mistake with the line lengths or something, you can still easily undo the doubling of backslashes. Otherwise, it may become difficult to judge how long a line is.
+
+ 1. **Refine your design.** Repeat appropriate steps until done.
+
+It is precision work to finalize the box design. But this needs to be done only once, and the box design can be shared and reused easily.
+
+
+[ [up](index.html) \| [next](config-complete_exp.html) ]
diff --git a/_includes/docs/config-syntax.md b/_includes/docs/config-syntax.md
new file mode 100644
index 0000000..5f02738
--- /dev/null
+++ b/_includes/docs/config-syntax.md
@@ -0,0 +1,153 @@
+# Config File Syntax
+
+The *boxes* config file is a succession of box design definitions.
+Everything following a pound sign (`#`) is considered a **comment** (unless, of course, the pound sign is part of a string or something).
+*Boxes* config files are case insensitive, i.e. upper/lower case does not matter.
+
+### Box Design
+
+BOX design_name
+ entries_and_blocks
+END design_name
+Every box design definition must have at least a `SHAPE` block, an `ELASTIC` list, and a `SAMPLE` block.
+
+### Sample Block
+
+SAMPLE
+ sample_image_of_box
+ENDS
+This is the box image used for the list of available designs. The reason why an image is not simply generated is that this way, the box can be shown in an environment in which it might actually be used, e.g. with some C code around (see the [boxes config file](https://github.com/{{ site.github }}/blob/master/boxes-config) for many examples).
+The `ENDS` statement must stand on a line of its own, although it may be indented. Such a line cannot occur as part of the sample itself.
+The `SAMPLE` block is a required entry in every box design definition.
+
+### Shape Block
+
+SHAPE {
+ shape_name (string_list)
+ shape_name (string_list)
+ ...
+}
+`shape_name` may be one of `nw`, `nnw`, `n`, `nne`, `ne`, `ene`, `e`, `ese`, `se`, `sse`, `s`, `ssw`, `sw`, `wsw`, `w`, or `wnw`, corresponding to the [figure shown earlier](config-general.html).
+The `string_list` represents the shape itself, line by line. Note that all lines must have equal length. Add extra spaces if necessary. Not also that double quotes (`"`) which appear as part of a string must be escaped by a preceding backslash, so as not to terminate the string early. Consequently, all occurrences of backslashes must also be escaped by adding additional backslashes. The recommended process for creating a string is thus:
+
+1. Type in the string as you think it should look.
+1. Make your editor double all backslashes within the string.
+1. Escape all double quotes within the string by adding more backslashes.
+
+In Vim, for example, this can be achieved by marking the block, and then typing:
+
+ :s/\\/\\\\/g
+ :s/"/\\"/g
+
+Here are a few examples of valid entries in a `SHAPE` block:
+
+ ne ("+++", "+ +", "+++")
+ SSE ("///", "\\\\\\")
+ ene ()
+ s ("\"")
+
+The [`delimiter` statement](#delim) can be used to redefine the string delimiting character and the escape character, thus eliminating the above backslash problem.
+The `SHAPE` block is a required entry in every box design definition.
+
+### Elastic List
+
+ELASTIC (shape_name, shape_name, ...)
+Simply lists the shapes which are *elastic*. Elastic shapes are repeated so that the box can grow and shrink to meet its requested size. Corner shapes may not be elastic. Naturally, there must always be at least one elastic shape per box side. No two neighboring shapes may be elastic. A typical `ELASTIC` entry would look like this:
+
+ elastic (n, e, s, w)
+
+The elastic list is a required entry in every box design definition.
+
+### Padding Block
+
+PADDING {
+ side_or_group_of_sides value
+ side_or_group_of_sides value
+ ...
+}
+Defines the default [padding area](config-general.html#padding-area). Possible values for `side_or_group_of_sides` are `all`, `horizontal`, `vertical`, `top`, `left`, `right`, or `bottom`. A padding block may contain an arbitrary number of entries. Entries are read from top to bottom, so that later entries overwrite earlier entries. In the following example:
+
+ padding {
+ vertical 3
+ horiz 2
+ left 4
+ }
+
+the padding is set to 3 blank lines above the text, 2 spaces to the right of the text, 3 blank lines below the text, and 4 spaces to the left of the text. These values can be overridden by a different specification on the command line using the **-p** option.
+
+### Replace and Reverse Statements
+
+REPLACE "search_pattern" WITH "replacement_string"
+...
+REVERSE "search_pattern" TO "replacement_string"
+...
+These statements are used to perform substitutions on the text surrounded by a box. The `REPLACE` statements are executed on the input text when a box is being created. `REVERSE` statements have the same effect as `REPLACE` statements, but they are executed after a box has been removed.
+In the simplest case, one string is replaced with another:
+
+ replace "\\*/" with "*-/"
+ reverse "\\*-/" to "*/"
+
+The `REPLACE` statement in the above example may be used to quote closing comment tags in the C programming language by inserting a dash between the asterisk and the slash. The `REVERSE` statement undoes this effect when the box is removed.
+
+The search pattern may be a regular expression, and the replacement string may include backreferences. This gives you quite a powerful means for text modification. The following example is used to insert a space between all characters of the input text:
+
+ replace "(.)" with "\\1 "
+ reverse "(.) " to "\\1"
+
+There may be many `REPLACE`/`REVERSE` statements in one design definition. They will be executed one after the other, starting from the top.
+
+Note that as in all strings, backslashes must be doubled, i.e. *boxes* "consumes one layer of backslashes". This is why in the first example, there are two backslashes at the beginning of the search pattern, when only one would have been needed to escape the star operator. Alternately, you may use the [`delimiter` statement](#delim) to change the string delimiting and escape character.
+
+For more information on how to use regular expressions, please see `man 5 regexp`, under "Basic Regular Expressions" or any other source.
+
+
+### Indentation Mode
+
+INDENT "indentmode"
+This sets the default indentation mode for a design. Possible values for `indentmode` are `"box"`, `"text"`, and `"none"`. The indent mode specifies how existing text indentation is treated.
+
+ - `"box"`, which is the default setting, will cause the box to be indented by the same number of spaces as the text was. The text itself will not be indented within the box, though.
+ - `"text"` will not indent the box, but instead retain the text indentation inside the box.
+ - `"none"` will simply throw away all indentation.
+
+For examples on all three indentation modes please refer to the [example page]({{ site.baseurl}}/examples.html#indent).
+
+
+
+### String Delimiters
+
+DELIM[ITER] chars
+*`chars`* must consist of exactly two characters, the first of which being the escape character, and the second the string delimiter. No quotes must be placed around those two characters.
+The effect is that until the end of the current design or until the next `DELIMITER` statement, all strings must be enclosed not by the usual double quotes (`"`), but instead by the character you specify.
+Also, the delimiter may be escaped not by the usual backslash (`\`), but instead by the escape character you specify.
+For example, consider the literal string `foo":"\"\\bar`:
+
+ "foo\":\"\\\"\\\\bar"
+
+Using a `DELIMITER` statement, this looks much simpler:
+
+ delimiter ?:
+ :foo"?:"\"\\bar:
+
+The escape character may be any character you choose. The string delimiter, however, may only be one out of the following:
+
+ "~'`!@%&*=:;<>?/|.\
+
+This set may change, but *boxes* will tell you your choices if you make a mistake.
+
+
+### Name of Author
+
+AUTHOR "name_of_author"
+Simply states who the ingenious guy/girl was who created the design. This entry is used when displaying the list of designs (`boxes -l`). The name should include the email address. Ideally, the entry should be usable "as is" in a `TO:` mail header, like this:
+
+ author "Thomas Jensen "
+
+
+### General Entries
+
+keyword "string_value"
+In addition to the author entry, there may be any number of other entries of the above form, giving any kind of information. The [boxes config file](https://github.com/{{ site.github }}/blob/master/boxes-config) includes the entries `CREATED`, `REVISION`, and `REVDATE`, to indicate the creation timestamp, revision number, and timestamp of the latest revision, respectively. These other entries are not yet used by *boxes*, though, and will simply be ignored.
+
+
+[ [up](index.html) \| [next](config-step.html) ]
diff --git a/_includes/docs/filters.md b/_includes/docs/filters.md
new file mode 100644
index 0000000..1a1e938
--- /dev/null
+++ b/_includes/docs/filters.md
@@ -0,0 +1,25 @@
+# What are filters?
+
+[Filters](http://en.wikipedia.org/wiki/Filter_%28software%29) are generally programs which read some input text from standard input, perform some modifications on it, and write the modified text to standard output. While a single filter can be used individually, they are frequently strung together to form a pipeline. *Boxes* is such a filter program.
+
+Some text editors *support filters*, which is to say they offer a way to let filter programs make changes to the text being edited. By pressing a key, the user tells the editor to start the filter program (e.g. *boxes*) and feed it the lines of text selected in the editor. Those lines are subsequently replaced with the output from the filter program.
+
+**Here's an example using *boxes*:**
+
+Imagine your editor (in this case, it's [Vim](http://www.vim.org/)) shows the following C code (it could be any text, of course):
+
+
+
+Now you mark some of the lines ...
+
+
+
+... and press the key which makes vim call the filter program *boxes*:
+
+
+
+Voilá! The marked lines have been fed to *boxes* and replaced by the output of *boxes*. You've got yourself a box! Of course the same mechanism works for box removal - or anything else you can find a filter for. :smile:
+
+Most major text editors support filters, among them [Vim](http://www.vim.org/), [Emacs](http://www.emacs.org/), and [Jed](http://www.jedsoft.org/jed/). There are certainly many, many more.
+
+Please see the [installation section](install.html) in the *boxes* docs for more info on how to make your editor work with *boxes*.
diff --git a/_includes/docs/index.md b/_includes/docs/index.md
new file mode 100644
index 0000000..5b589d5
--- /dev/null
+++ b/_includes/docs/index.md
@@ -0,0 +1,40 @@
+# Documentation
+
+ 1. General
+ a. [Overview]({{ site.baseurl}}/about.html) & [Features]({{ site.baseurl}}/about.html#some-of-the-features)
+ b. [News]({{ site.baseurl}}/)
+ c. [FAQ](https://github.com/{{ site.github }}/wiki/FAQ) (Frequently Asked Questions)
+
+ 1. [Legal Stuff](legal.html)
+
+ 1. [Examples]({{ site.baseurl}}/examples.html)
+ a. [Default Action]({{ site.baseurl}}/examples.html)
+ b. [Choosing a Different Design]({{ site.baseurl}}/examples.html#design)
+ c. [The "-a" option - Alignment, Positioning & Line Justification]({{ site.baseurl}}/examples.html#position)
+ d. [Size Specification]({{ site.baseurl}}/examples.html#size)
+ e. [Padding]({{ site.baseurl}}/examples.html#padding)
+ f. [Regional Comments]({{ site.baseurl}}/examples.html#comments)
+ g. [Removal of Boxes]({{ site.baseurl}}/examples.html#removal)
+ h. [Indentation Handling]({{ site.baseurl}}/examples.html#indent)
+ i. [Use of Regular Expressions]({{ site.baseurl}}/examples.html#regexp)
+
+ 1. Creating Your Own Designs
+ a. [Introduction and General Concepts](config-general.html)
+ b. [Configuration File Syntax](config-syntax.html)
+ c. [Step-by-Step Guide to a New Design](config-step.html)
+ d. [Complete examples of box designs](config-complete_exp.html)
+ e. [List of preconfigured designs]({{ site.baseurl}}/box-designs.txt)
+
+ 1. [Text Editor Integration](install.html)
+ a. [Integration with Vim](install.html)
+ b. [Integration with Jed](install.html#jed)
+ c. [Integration with Emacs](install.html#emacs)
+
+ 1. Development
+ a. [Contributing]({{ site.baseurl}}/contributing.html)
+ b. [List of Contributors]({{ site.baseurl}}/contributing.html#contributors)
+ c. [Chronological Change Log](https://github.com/{{ site.github }}/commits/master)
+
+ 1. [Download]({{ site.baseurl}}/download.html)
+
+ 1. [*Boxes* manual page](boxes-man-1.html) (also in [troff format](https://github.com/{{ site.github }}/blob/master/doc/boxes.1.in))
diff --git a/_includes/docs/install.md b/_includes/docs/install.md
new file mode 100644
index 0000000..5a8d166
--- /dev/null
+++ b/_includes/docs/install.md
@@ -0,0 +1,116 @@
+# Text Editor Integration
+
+This section assumes you already have a working binary of *boxes*. Binaries for some platforms can be obtained through the [download page]({{ site.baseurl}}/download.html). Should your platform be missing from the list, you can still download the source distribution and compile your own binary. This sounds harder than it is.
+
+Although *boxes* can be useful when used on the command line, the more frequent use case will be as a filter tied to your editor. So, how can *boxes* be tied to your editor?
+
+Example config file entries are featured so far for [Vim](http://www.vim.org/), [Jed](http://www.jedsoft.org/jed/), and [Emacs](http://www.gnu.org/software/emacs/). If you know how to to this in other editors, please drop me a line!
+
+## Integration with Vim
+
+To call filters from vim, you need to press `!` in visual mode or `!!` in normal mode. So the easiest way to tie in *boxes* with vim is by adding the following four lines to your *.vimrc*:
+
+ vmap ,mc !boxes -d c-cmt
+ nmap ,mc !!boxes -d c-cmt
+ vmap ,xc !boxes -d c-cmt -r
+ nmap ,xc !!boxes -d c-cmt -r
+
+`` should be there literally; just paste the lines directly from your browser window. This would comment out the current line or the lines you have marked when you press `,mc` (for *make comment*). Comments can be removed in the same way by pressing `,xc`. Should you feel that `,mc` is too long a combination to type, feel free to choose a shorter one. The above example assumes you are using the standard boxes config file, which features the *c-cmt* design. Of course, the same technique works for any other designs.
+
+While the above example is nice, it does not offer much convenience when you are editing different languages a lot, because you need to remember the hotkey for each different box design. Fortunately, vim has a feature called *autocommands*. They can be used to automatically change the meaning of a key combination depending on what file you edit (any many other things too, of course). Autocommand syntax is
+
+ au[tocmd] [group] {event} {pat} [nested] {cmd}
+
+We can leave out the group. For `{event}`, we choose `BufEnter`, which is generated every time you enter a new buffer, e.g. when starting vim or when switching between open files. `{pat}` is a file glob, and `{cmd}` is our call to *boxes*.
+
+The lines below are from the author's *.vimrc*. They can be pasted directly from your browser window. Their effect is that `,mc` and `,xc` always generate the correct comments for many languages, including C, C++, HTML, Java, lex, yacc, shell scripts, Perl, etc. The default key binding is to generate shell comments using a pound sign (file glob of `*` at the start).
+
+ autocmd BufEnter * nmap ,mc !!boxes -d pound-cmt
+ autocmd BufEnter * vmap ,mc !boxes -d pound-cmt
+ autocmd BufEnter * nmap ,xc !!boxes -d pound-cmt -r
+ autocmd BufEnter * vmap ,xc !boxes -d pound-cmt -r
+ autocmd BufEnter *.html nmap ,mc !!boxes -d html-cmt
+ autocmd BufEnter *.html vmap ,mc !boxes -d html-cmt
+ autocmd BufEnter *.html nmap ,xc !!boxes -d html-cmt -r
+ autocmd BufEnter *.html vmap ,xc !boxes -d html-cmt -r
+ autocmd BufEnter *.[chly],*.[pc]c nmap ,mc !!boxes -d c-cmt
+ autocmd BufEnter *.[chly],*.[pc]c vmap ,mc !boxes -d c-cmt
+ autocmd BufEnter *.[chly],*.[pc]c nmap ,xc !!boxes -d c-cmt -r
+ autocmd BufEnter *.[chly],*.[pc]c vmap ,xc !boxes -d c-cmt -r
+ autocmd BufEnter *.C,*.cpp,*.java nmap ,mc !!boxes -d java-cmt
+ autocmd BufEnter *.C,*.cpp,*.java vmap ,mc !boxes -d java-cmt
+ autocmd BufEnter *.C,*.cpp,*.java nmap ,xc !!boxes -d java-cmt -r
+ autocmd BufEnter *.C,*.cpp,*.java vmap ,xc !boxes -d java-cmt -r
+ autocmd BufEnter .vimrc*,.exrc nmap ,mc !!boxes -d vim-cmt
+ autocmd BufEnter .vimrc*,.exrc vmap ,mc !boxes -d vim-cmt
+ autocmd BufEnter .vimrc*,.exrc nmap ,xc !!boxes -d vim-cmt -r
+ autocmd BufEnter .vimrc*,.exrc vmap ,xc !boxes -d vim-cmt -r
+
+
+
+## Integration with Jed
+
+*Andreas Heiduk* (@asheiduk) kindly provided the following excerpt from his *.jedrc*:
+
+ %!% Ripped from "pipe.sl"
+
+ variable Last_Process_Command = Null_String;
+
+ define do_process_region(cmd) {
+ variable tmp;
+ tmp = make_tmp_file ("/tmp/jedpipe");
+ cmd = strncat (cmd, " > ", tmp, " 2>&1", 4);
+
+ !if (dupmark ()) error ("Mark not set.");
+
+ if (pipe_region (cmd))
+ {
+ error ("Process returned a non-zero exit status.");
+ }
+ del_region ();
+ () = insert_file (tmp);
+ () = delete_file (tmp);
+ }
+
+
+ define process_region ()
+ {
+ variable cmd;
+ cmd = read_mini ("Pipe to command:", Last_Process_Command, "");
+ !if (strlen (cmd)) return;
+
+ Last_Process_Command = cmd;
+ do_process_region(cmd);
+ }
+
+
+ %-----------------------------------------------------------------------
+
+ if( BATCH == 0 ){
+
+ setkey("process_region", "\e|"); % ESC-Pipe :-)
+ add_completion("process_region");
+
+ % define some often used filters
+ setkey("do_process_region(\"tal\")", "\et") % tal on esc-t
+ }
+
+I think it calls [tal](http://www.thomasjensen.com/software/tal/) when you press `ESC-t` (second but last line). Thus, you would have to add a similar line to call *boxes*.
+
+
+
+## Integration with Emacs
+
+[Jason L. Shiffer](mailto:jshiffer@zerotao.com) kindly submitted the following information on integrating *boxes* with Emacs:
+
+The simple interface (only a single box style, but easy):
+
+ (defun boxes-create ()
+ (interactive)
+ (shell-command-on-region (region-beginning) (region-end) "boxes -d c-cmt2" nil 1 nil))
+
+ (defun boxes-remove ()
+ (interactive)
+ (shell-command-on-region (region-beginning) (region-end) "boxes -r -d c-cmt2" nil 1 nil))
+
+Jason also wrote a [*boxes* mode for Emacs](boxes.el). Remember to update its design list when you add new designs to your config file.
diff --git a/_includes/docs/legal.md b/_includes/docs/legal.md
new file mode 100644
index 0000000..1d0095f
--- /dev/null
+++ b/_includes/docs/legal.md
@@ -0,0 +1,9 @@
+# Legal Terms
+
+*Boxes* is free software under the terms of the GNU General Public License, version 2 (GNU GPL), a copy of which you should have received with your source archive (filename of *COPYING* or *LICENSE*).
+
+Among many other things, the GNU GPL states that there is **no warranty** whatsoever. If *boxes* filters away your master's thesis that's your problem! You are using the program entirely at your own risk. On the other hand, it is free. Here is an excerpt from the GNU GPL:
+
+
+> **11.** Because the program is licensed free of charge, there is no warranty for the program, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide the program "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. Should the program prove defective, you assume the cost of all necessary servicing, repair or correction.
+> **12.** In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who may modify and/or redistribute the program as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages.
diff --git a/_includes/download.md b/_includes/download.md
new file mode 100644
index 0000000..b5d701e
--- /dev/null
+++ b/_includes/download.md
@@ -0,0 +1,33 @@
+# Download *Boxes*
+
+*Boxes* is free software under the GNU General Public License (GNU GPL), version 2.
+
+The current release is **version 1.1.1**. For older revisions, feel free to browse the [release history](https://github.com/{{ site.github }}/wiki/Release-History).
+
+
+## Sources
+
+The *boxes* sources are now all on GitHub, including previous releases:
+
+[https://github.com/{{ site.github }}](https://github.com/{{ site.github }})
+
+For the (historical) record, the source of the outdated version 1.1 is also on [metalab](ftp://metalab.unc.edu/pub/Linux/utils/text/boxes-1.1.src.tar.gz) (FTP).
+
+
+## Binaries
+
+The author supports binaries for intel/linux and intel/win32. *Boxes* has been compiled on a very wide variety of platforms, and for older releases, some of these binaries are available via the [release history](https://github.com/{{ site.github }}/wiki/Release-History). If you have binaries for different and/or new platforms, please send them in!
+
+**Windows** and **Linux** binary download:
+[https://github.com/{{ site.github }}/releases/latest](https://github.com/{{ site.github }}/releases/latest)
+
+**MacOS X**
+According to *boxes* user *Michel*, *boxes* can be installed on MacOS X (32bit) by simply typing `brew install boxes`. (Information of October 3, 2012)
+
+
+## Miscellaneous
+
+ - The current [list of available box designs]({{ site.baseurl }}/box-designs.txt).
+ Want to see your design in the official config file? Submit it as a [pull request](https://github.com/{{ site.github }}/pulls) on GitHub. If this seems too complicated, or you are not an IT person, feel free to send email, too. Emails take much longer to be processed, though.
+ - A vim syntax
+ file to enable the vim editor to use syntax highlighting with *boxes* config files (beta state).
diff --git a/_includes/examples.md b/_includes/examples.md
new file mode 100644
index 0000000..7a49e4e
--- /dev/null
+++ b/_includes/examples.md
@@ -0,0 +1,305 @@
+# Examples
+
+Remember, *boxes* is designed to be tied to your editor as a [text filter](docs/filters.html). So these examples assume you need only push a single key (or at least very few) in order to call *boxes*. Don't be worried by seemingly long argument lists - you'll only have to type them once.
+
+Unless stated otherwise, the input used for these examples is the following:
+
+ Different all twisty a
+ of in maze are you,
+ passages little.
+
+
+## Default action
+
+`boxes`
+
+ /**************************/
+ /* Different all twisty a */
+ /* of in maze are you, */
+ /* passages little. */
+ /**************************/
+
+Draws a standard box of the first valid design found in your config file. If you have the config file as it comes with the *boxes* distribution, you get a "C" box, as you can see above.
+
+
+
+
+## Choosing a different design
+
+`boxes -d parchment`
+
+ ________________________
+ /\ \
+ \_|Different all twisty a|
+ |of in maze are you, |
+ |passages little. |
+ | ___________________|_
+ \_/_____________________/
+
+The **-d** *design_name* option selects another design from your config file.
+
+
+
+
+## Positioning of text inside box
+
+`boxes -d diamonds -a hcvc`
+
+ /\ /\ /\
+ /\//\\/\ /\//\\/\ /\//\\/\
+ /\//\\\///\\/\//\\\///\\/\//\\\///\\/\
+ //\\\//\/\\///\\\//\/\\///\\\//\/\\///\\
+ \\//\/ \/\\//
+ \/ \/
+ /\ Different all twisty a /\
+ //\\ of in maze are you, //\\
+ \\// passages little. \\//
+ \/ \/
+ /\ /\
+ //\\/\ /\//\\
+ \\///\\/\//\\\///\\/\//\\\///\\/\//\\\//
+ \/\\///\\\//\/\\///\\\//\/\\///\\\//\/
+ \/\\//\/ \/\\//\/ \/\\//\/
+ \/ \/ \/
+
+The **-a** *format* option can be used to position the input text inside a box which is larger than needed for our text. `hcvc` stands for "horizontally centered, vertically centered".
+
+Note that the box was drawn in this size because the shapes that compose it are very big, so that it is not possible to fit the box tighter around our text. Note also that the input lines themselves are *not* centered; `hc` only centers the input text block as a whole.
+
+
+## Line justification
+
+`boxes -d simple -a jr`
+
+ ************************
+ *Different all twisty a*
+ * of in maze are you,*
+ * passages little.*
+ ************************
+
+This uses the third possible argument to the **-a** option, `j`. `jr` stands for "justification right".
+
+
+## Quick alignment/positioning
+
+`boxes -d dog -a c`
+
+ __ _,--="=--,_ __
+ / \." .-. "./ \
+ / ,/ _ : : _ \/` \
+ \ `| /o\ :_: /o\ |\__/
+ `-'| :="~` _ `~"=: |
+ \` (_) `/
+ .-"-. \ | / .-"-.
+ .---{ }--| /,.-'-.,\ |--{ }---.
+ ) (_)_)_) \_/`~-===-~`\_/ (_(_(_) (
+ ( Different all twisty a )
+ ) of in maze are you, (
+ ( passages little. )
+ ) (
+ '---------------------------------------'
+
+Since noone really wants to type `-a hcvcjc` only to actually center text inside a box, there are shorthand notations (`l`, `c`, and `r`).
+
+Note the blank line at the bottom of the box (after `little`, but before the dashes) which is necessary to make the bottom of the box look right. If the blank line was not there, the box would end on a closing parenthesis, thus looking broken.
+
+
+
+
+## Box size specification
+
+`boxes -d html -s 40`
+
+
+
+
+
+
+
+Using `-s 40`, we have set the box width to 40 characters.
+
+
+## Box size specification (2)
+
+`boxes -d peek -a c -s 40x11`
+
+ /* _\|/_
+ (o o)
+ +----oOO-{_}-OOo----------------------+
+ | |
+ | |
+ | Different all twisty a |
+ | of in maze are you, |
+ | passages little. |
+ | |
+ | |
+ +------------------------------------*/
+
+Using `-s 40x11`, you can set both width and height. Setting just the height is possible with `-s x11` (note the leading `x` on the argument).
+
+
+
+
+## Text Padding
+
+`boxes -d shell -p a1l2`
+
+ ###########################
+ # #
+ # Different all twisty a #
+ # of in maze are you, #
+ # passages little. #
+ # #
+ ###########################
+
+Normally, the padding values depend on the design. The "shell" design has no default padding, so we can see the effects of our command line option unchanged. `a1l2` stands for "all 1, left 2", and tells *boxes* to put one space (or empty line, in the vertical direction) around the input text block, except for the left side where two spaces shall be used.
+
+
+## Text Padding (2)
+
+`boxes -p h0v0`
+
+ /************************/
+ /*Different all twisty a*/
+ /*of in maze are you, */
+ /*passages little. */
+ /************************/
+
+This uses again the default design, which by default features a horizontal padding value of one space (as you know from the very first example). By specifying `-p h0v0`, we set all padding to zero ("horizontal 0, vertical 0"). In this case, the same could have been achieved by `-p h0` or `-p a0`.
+
+
+
+
+## Regional comments
+
+Imagine you want to comment out the following C code:
+
+ if (!s2 || *s2 == '\0')
+ return (char *) s1; /* error 1 */
+ if (!s1 || *s1 == '\0')
+ return NULL; /* error 2 */
+ if (skip < 0)
+ skip = 0; /* foo bar */
+
+`boxes -d c-cmt`
+
+ /* if (!s2 || *s2 == '\0') */
+ /* return (char *) s1; /* error 1 *\/ */
+ /* if (!s1 || *s1 == '\0') */
+ /* return NULL; /* error 2 *\/ */
+ /* if (skip < 0) */
+ /* skip = 0; /* foo bar *\/ */
+
+Note that the closing comment tags in the input text have been escaped by adding a backslash between the asterisk and the slash. This way, the comments that have been commented out along with the rest of the code will not interfere with the new comments.
+
+`boxes -r`
+
+ if (!s2 || *s2 == '\0')
+ return (char *) s1; /* error 1 */
+ if (!s1 || *s1 == '\0')
+ return NULL; /* error 2 */
+ if (skip < 0)
+ skip = 0; /* foo bar */
+
+Should you decide to reactivate the code previouly commented out, the escaped closing comment tags are changed back into normal ones.
+This is achieved by the `replace` and `reverse` statements in the config file entry describing this particular box design. If you want this to work recursively, simply add more such statements.
+
+
+
+
+## Box removal
+
+Imagine your once beautiful box in "C" style like this in your editor, after you are done editing the text inside:
+
+ /********************************************************************/
+
+ /* Generate sorted listing of available box styles.
+ Uses design name from BOX spec and sample picture plus author.
+ */
+ /* RETURNS: != 0 on error (out of memory) */
+ == 0 on success */
+ /********************************************************************/
+
+`boxes -r`
+
+ Generate sorted listing of available box styles.
+ Uses design name from BOX spec and sample picture plus author.
+
+ RETURNS: != 0 on error (out of memory)
+ == 0 on success
+
+The box is correctly removed even though it's been badly damaged by editing of the text inside. Obviously, the box design was correctly autodected as being "C".
+Note there is only a single leading space in the output text, whereas there are two leading spaces in the input text. This is because the "C" box design has a default horizontal padding of one space. Since *boxes* assumes it has added the padding space, it also attempts to removes the same number of spaces when removing the box. Thus, if you were to add a new box around the text, the box internal indentation would be retained. It is easily possible to use this feature to make an editor key mapping which repairs a box for you (see [installation]({{ site.baseurl}}/docs/install.html) in the documentation section).
+
+
+## Box removal (2)
+
+Imagine an HTML comment box like the follwing, and imagine that *boxes* does not correctly autodetect it as being an HTML box:
+
+
+
+
+
+
+
+`boxes -r -d html`
+
+ Different all twisty a
+ of in maze are you,
+ passages little.
+
+In cases where design autodetection fails, **-d** *design_name* can be added to the **-r** command in order to tell *boxes* which design exactly to remove. It is always a good thing to use the **-d** option, because it makes autodetection unnecessary. Autodetection takes more time, because the entire config file must be parsed instead of just the one design needed, and all designs must be matched against the input text in order to see which one fits best.
+
+
+
+
+## Indentation handling
+
+For this example, our input text is indented by four spaces:
+
+ Different all twisty a
+ of in maze are you,
+ passages little.
+
+`boxes -d java-cmt -i box`
+
+ // Different all twisty a
+ // of in maze are you,
+ // passages little.
+
+The default indent mode is `box`, which indents the box by the same value as the input text was indented. As shown here, this is useful when adding regional comments to your source code, e.g. when "commenting out" a large portion of your code. Most people generally prefer to indent comments by the same value as the code they refer to, so they don't upset the code structure.
+
+`boxes -d vim-cmt -i text`
+
+ " Different all twisty a
+ " of in maze are you,
+ " passages little.
+
+By specifying `-i text`, the box is made to start at column zero and any input text indentation is retained inside the box.
+
+`boxes -d pound-cmt -i none`
+
+ # Different all twisty a
+ # of in maze are you,
+ # passages little.
+
+Finally, it is also possible to throw away any indentation altogether by specifying `-i none`.
+
+
+
+
+## Use of Regular Expressions
+
+ Global Variables
+
+`boxes -d headline`
+
+ /*************************************/
+ /* G l o b a l V a r i a b l e s */
+ /*************************************/
+
+The `replace` and `reverse` statements may contain regular expressions and backreferences, which can be used for more elaborate text modifications. The example shown here, where spaces are inserted between the individual characters, is configured [like this](https://github.com/{{ site.github }}/blob/master/boxes-config#L1895-L1898).
+
+`boxes -d headline -r`
+
+ Global Variables
diff --git a/_includes/footer.html b/_includes/footer.html
new file mode 100644
index 0000000..271a738
--- /dev/null
+++ b/_includes/footer.html
@@ -0,0 +1,17 @@
+
+
+{% include disqus-counts.html %}
+{% include analytics.html %}
+
+