---
# Copyright (C) 2009, Progress Software Corporation and/or its 
# subsidiaries or affiliates.  All rights reserved.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

title: Home
in_menu: true
sort_info: 1
--- name:overview pipeline:haml,tags

%h1 Home
{project_slogan:}

--- name:content pipeline:haml,tags

.left
  %h1 What is Jansi?
.right
  %p
    Jansi is a small java library that allows you to use ANSI escape sequences 
    to format your console output which works even on windows.  
  %p
    Using jansi is easy.  Before you start sending ANSI escape sequences to
    %code System.out
    make sure you run:
        
  :plain
    {coderay::java}
    AnsiConsole.systemInstall();
    {coderay}

  %p
    If you would rather not mess with the System.out settings, you can use the
    %code AnsiConsole.out
    PrintStream instead.  For example:
    
  :plain
    {coderay::java}
    AnsiConsole.out.println("Hello World");
    {coderay} 
    
.left
  %h1 Windows Examples
.right
  %p
    Most unix terminals support rendering ANSI escape sequences when Java
    sends them via 
    %code System.out
    but when this is done on Windows, they don't get interpreted and you get
    garbage on the console similar to:
  %img.example{:src=>"images/before-windows.png"}
  
  %p
    If the application uses the jansi libary, things start to look
    much better:
  %img.example{:src=>"images/after-jansi-windows.png"}
        
  %p
    But wait, it gets better.  If you also add the JNA library to the 
    classpath, then jansi provides an even better ANSI handling implementation
    which use a few windows Native methods to properly apply color attributes
    and more precise cursor support.
  %img.example{:src=>"images/after-jansi-jna-windows.png"}
    
    
    