Home
Projects
Art
Spaces
Biz
Contact
Papers
Japan Photos
SnipSnap Extensions

Search
 [txt only]

SnipSnap Extensions

Some simple but useful extensions to SnipSnap, an open source system for managing weblog (blog) and wiki type content.

A Note on Installing Macros
To give SnipSnap access to the macro, place its jar file in the correct "lib" directory and restart the SnipSnap application. For the stand-alone application that uses Jetty, the path will look something like this "<web-app-root-path>/_<snipsnap-port>_/webapp/WEB-INF/lib". If this is the first macro that you are adding, the SnipSnap application may have to be running for this path to exist. To verify that the macro has been loaded, view the help snip ("snipsnap-help") which lists the descriptions of loaded macros.


Relative Link Macro

Type: macro
Contents: RelativeLinkMacro, RelativeLinkIncludeMacroPatch, and source
Usage:
{link-rel:<text>[|<url>[|<rel>]]}
{include-rel:<snipname>}
Last Changed: May 25, 2005 RelativeLinkMacro.jar
Notes:

RelativeLinkMacro is a SnipSnap macro for snip-relative and "view"-relative links, loosely based on org.radeox.macro.LinkMacro. Snip-relative links remain relative to their containing snip when that snip is imported with {include-rel:<snip>}. View-relative links provide a way to link to anchors on the same displayed page, regardless of the snip that they reside in. SnipSnap instances with a proxy and prefix paths are also supported. Internally the macro expands a snip-relative path to the correct site relative path.

RelativeLinkIncludeMacroPatch is based on the PersonalIncludeMacro found here. This is a replacement for the {!snipname} macro that provides for the correct functioning of the RelativeLinkMacro ({link-rel}) in the included snips. At least in SnipSnap 1.0b2-uttoxeter the SnipRenderContext attribute "SnipRenderContext.snip" is not updated in the SnipRenderContext of snips included with {!snipname}. This causes the macros in snips that are included with {!snipname} to incorrectly identify the snip in which they exist, thus breaking the {link-rel} macro.


CSS Format Macro

Type: macro
Contents: CSSFormatMacro, and source
Usage:
{format:<style-class>}
Last Changed: July 26, 2004 CSSFormatMacro.jar
Notes:

CSSFormatMacro uses HTML span tags to apply arbitrary CSS style classes to SnipSnap content. (Note that block level styling can be applied with a span tag if "display: block;" is included on the style properties.)

A good way to add site wide CSS classes is to edit "SnipSnap/themes/<theme-name>/css" to add another CSS file, like "@import url(css/format.css);". Then create a new snip "SnipSnap/themes/<theme-name>/css/format.css" and add CSS styles to it such as ".highlight-yellow { padding: 2px; background: #ff0; }". Wherever you needed highlighted text, you could then use "{format:highlight-yellow}some content{format}" in your snips.

 


Copyright 2001-2006 Ben Coburn Last Updated: 1:31 May 3, 2006