Kevin Vance - Here is some sample output from my vim S2 syntax highlighter. It's…

Entries | Archive | Friends | Friends' Friends | User Info

11:53 pm

Thursday, September 29th, 2005
Previous Entry Share Next Entry
Here is some sample output from my vim S2 syntax highlighter. It's Classic truncated to fit in an LJ entry. Looks okay to me, but I have not written a line of S2 yet...

# -*-s2-*-

layerinfo type = "layout";
layerinfo name = "Classic";
layerinfo redist_uniq = "classic/layout";
layerinfo previews = "classic/classic.jpg";
layerinfo des = "The original LiveJournal style: simple and effective.";

propgroup colors {
  property Color body_bgcolor {
      des = "Background color of page";
      s1color = "stronger_back";
  }
  property Color main_bgcolor {
      des = "Background color of main text area";
      s1color = "page_back";
  }
  property Color main_fgcolor {
      des = "Color of text on main text areas";
      s1color = "page_text";
  }
  property Color headerbar_bgcolor {
      des = "Background color of header bars";
      s1color = "strong_back";
  }
  property Color headerbar_fgcolor {
      des = "Color of text on header bars";
      s1color = "strong_text";
  }
  property Color metabar_bgcolor {
      des = "Background color of side bar";
      s1color = "weak_back";
  }
  property Color metabar_fgcolor {
      des = "Color of text on side bar";
      s1color = "weak_text";
  }
  property Color page_title_color {
      des = "Text color of the page's main title";
      s1color = "page_text_title";
  }
  property Color page_subtitle_color {
      des = "Text color of the page's subtitles";
      s1color = "page_text_em";
  }
  property Color link_color {
      des = "Text color of links";
      s1color = "page_link";
  }
  property Color vlink_color {
      des = "Text color of visited links";
      s1color = "page_vlink";
  }
  property Color alink_color {
      des = "Text color of active links";
      s1color = "page_alink";
  }
  property Color comment_bar_one_bgcolor {
      des = "Alternating background color for comment bars (one)";
  }
  property Color comment_bar_two_fgcolor {
      des = "Text color on alternating comment bars (one)";
  }
  property Color comment_bar_two_bgcolor {
      des = "Alternating background color for comment bars (two)";
  }
  property Color comment_bar_one_fgcolor {
      des = "Text color on alternating comment bars (two)";
  }
  property Color comment_bar_screened_bgcolor {
      des = "Background bar color for screened comments";
  }
  property Color comment_bar_screened_fgcolor {
      des = "Text color on background bar for screened comments";
  }
}
set body_bgcolor = "#6666cc";
set main_bgcolor = "#ffffff";
set main_fgcolor = "#000000";
set headerbar_bgcolor = "#c0c0ff";
set headerbar_fgcolor = "#000000";
set metabar_bgcolor = "#eeeeff";
set metabar_fgcolor = "#000000";
set page_title_color = "#8b1a1a";
set page_subtitle_color = "#c00000";
set link_color = "#000050";
set vlink_color = "#500050";
set alink_color = "#ff00c0";
set comment_bar_one_bgcolor = "#c0c0ff";
set comment_bar_one_fgcolor = "#000000";
set comment_bar_two_bgcolor = "#eeeeff";
set comment_bar_two_fgcolor = "#000000";
set comment_bar_screened_bgcolor = "#dddddd";
set comment_bar_screened_fgcolor = "#000000";
set tags_aware = true;

propgroup presentation {
  property bool show_entry_userpic {
      des = "Show your userpic with your journal's entries?";
  }
  property use font_base;
  property use font_fallback;
  property use page_recent_items;
  property use page_friends_items;
  property use view_entry_disabled;
  property use use_shared_pic;
  property bool show_entrynav_icons {
    des = "Toggle to show the next, memory, edit, etc icons on the entry view page";
  }
  property string page_background_image {
    des = "URL to an image to be used for the page background";
  }
  property use external_stylesheet;
}
set show_entry_userpic = false;
set font_base = "Arial, Helvetica";
set font_fallback = "sans-serif";
set page_recent_items = 20;
set page_friends_items = 25;
set view_entry_disabled = false;
set show_entrynav_icons = true;
set page_background_image = "";

propgroup text {
  property use text_post_comment;
  property use text_read_comments;
  property use text_post_comment_friends;
  property use text_read_comments_friends;
  property use text_website_default_name;
}

function print_stylesheet ()
{
    print clean_url($*page_background_image) != "" ? "body { background-image: url($*page_background_image); }" : "";
    var string font;
    if ($*font_base) {
        $font = "\"$*font_base\"";
        if ($*font_fallback != "none") {
            $font = "$font, ";
        }
    }
    if ($*font_fallback != "none") {
        $font = "$font $*font_fallback";
    }

if ($font != "") {
"""
body, table, td, th, .page_title, #yearheader {
font-family: $font;
}
""";
}

    """
body,.body {
    background-color:    $*body_bgcolor;
    color:               $*main_fgcolor;
    padding:             5pt;
}
a, a:link {
    color:               $*link_color;
}
a:visited {
    color:               $*vlink_color;
}
a:active {
    color:               $*alink_color;
}
table.main {
    background-color:    $*main_bgcolor;
    color:               $*main_fgcolor;
}
.page_title {
    color:               $*page_title_color;
    font-size:           18pt;
}
.view_links {
    font-family:         monospace;
    white-space:         nowrap;
}
.view_links2 {
    font-family:         monospace;
    font-size:           9pt;
}
th.headerbar {
    background-color:    $*headerbar_bgcolor;
    color:               $*headerbar_fgcolor;
    font-weight:         bold;
    font-size:           16pt;
    text-align:          left;
}
td.metabar {
    text-align:          right;
    white-space:         nowrap;
    background-color:    $*metabar_bgcolor;
    color:               $*metabar_fgcolor;
}
.subject {
    color:               $*page_subtitle_color;
    font-weight:         bold;
}
.comments {
    text-align:          right;
}
#yearheader {
    color:               $*page_subtitle_color;
    font-weight:         bold;
    font-style:          italic;
    font-size:           14pt;
}
th.monthheader {
    background-color:    $*headerbar_bgcolor;
    color:               $*headerbar_fgcolor;
    font-size:           12pt;
}
th.daysheader {
    background-color:    $*metabar_bgcolor;
    color:               $*metabar_fgcolor;
    font-weight:         normal;
}
td.weekday_empty {
    background-color:    $*metabar_bgcolor;
    color:               $*metabar_fgcolor;
}
.day_id {
    font-weight:         bold;
    font-size:           10pt;
}
#archiveyearpage_nav {
    font-size:           14pt;
    font-weight:         bold;
}
    """;
}

function Page::lay_nav_blurb() { }

function Page::lay_primary_userpic() : Image {
   return $.journal.default_pic;
}

function EntryPage::lay_primary_userpic() : Image {
   return $.entry.userpic;
}

function Page::print_linklist() {
    if (size $.linklist <= 0) {
        return;
    }

    var bool section_open = false;

    println "<span class='view_links2'>";
    foreach var UserLink l ($.linklist) {
        if ($l.title) {
            if ($l.is_heading) {
                if ($section_open) {
                    println "<br />";
                }
                println """<span style="font-weight: bold;">$l.title</span> """;
                $section_open = true;
            } else {
                println """[<a href="$l.url">$l.title</a>]""";
            }
        }
    }
    if ($section_open) {
        println "</span><br /><br />";
    }
    println "";
}

function Page::print ()
{
    var string title = $this->title();
    var string userpic;
    var Image default_userpic = $this->lay_primary_userpic();
    if (defined $default_userpic)
    {
        $userpic = "<img align='right' style='padding: 2px' src='$default_userpic.url' "+
                   "width='$default_userpic.width' height='$default_userpic.height' alt='' />";
    }
    var string website_name = $.journal.website_name ? $.journal.website_name : $*text_website_default_name;
    var string website = $.journal.website_url ?
        """<td><a href="$.journal.website_url">$website_name</a></td><td class="body">&nbsp;</td>""" :
        "";
    var string links;
    foreach var string v ($.views_order) {
        $links = $links + ($.view == $v ?
                           "["+lang_viewname($v)+"]" :
                           "[<a href='$.view_url{$v}'>"+lang_viewname($v)+"</a>]");
    }
"""
<html>
  <head>
""";

    if ($*external_stylesheet) {
        println """<link rel="stylesheet" href="$.stylesheet_url" type="text/css" />""";
    } else {
        println """<style type="text/css">"""; print_stylesheet(); "</style>";
    }
    $this->print_head();

"""
  <title>$title</title>
</head>
<body>
  <table class="main" width='100%'><tr><td>
    $userpic
    <span class="page_title">$title</span>
    <p class="view_links">$links</p>
""";
if (size $.linklist > 0 and $*linklist_support) {
$this->print_linklist();
}

    $this->lay_nav_blurb();
    $this->print_body();
    "</td></tr></table>\n";

    ### Affliations

    "<table class='main' align='right'><tr>";

    print $website; "<td>"; server_sig(); "</td></tr>";

    "</table>\n</body>\n</html>";
}

...
Link )Reply )