Voidspace

rest2web: Building Websites Across the Known Universe

The Smilies Macro

Smilies

Introduction

Included in the example macros file is a function called smiley. This uses a modified version of smiley.py by Mark Andrews. It also requires the path module. These are both included as part of the rest2web distribution in the modules directory. If you move them elsewhere you should make sure they are on the Python search path [1]. If you don't know what I'm on about then leave them where they are Laughing

The Smilies

To use the smilies you use the smiley macro. This can be either {smiley;SMILEY} or the shorter form {sm;SMILEY}. Replace SMILEY with the symbols for the the smiley you want to display. For example {smiley;8)} becomes Cool .

Here is the full smiley set :

  • Doubt -- :doubt:
  • Confused -- :-?
  • Exclamation -- :!:
  • Laughing -- :lol:
  • Cool -- 8)
  • Sad -- :(
  • Smile -- :)
  • Surprised -- :eek:
  • Very Happy -- :-D
  • Crying or Very sad -- :cry:
  • Mad -- :-X
  • Confused -- :?
  • Evil or Very Mad -- :evil:
  • Surprised -- :-o
  • Mad -- :mad:
  • Embarassed -- :oops:
  • Very Happy -- :grin:
  • Neutral -- :-|
  • Razz -- :-p
  • Very Happy -- :biggrin:
  • Idea -- :idea:
  • Shock -- :shock:
  • Surprised -- :o
  • Question -- :?:
  • Bad Grin -- :badgrin:
  • Rolling Eyes -- :roll:
  • Arrow -- :arrow:
  • Neutral -- :|
  • Smile -- :smile:
  • Razz -- :p
  • Razz -- :razz:
  • Wink -- :wink:
  • Smile -- :-)
  • Cool -- 8-)
  • Cool -- :cool:
  • Very Happy -- :D
  • Neutral -- :neutral:
  • Sad -- :sad:
  • Confused -- :???:

The Missing Smilies

emoticon:exclaim We can't use the following smilies. ;-) and ;).

Because they contain a ";" [2], we can't yet use these smilies. They both represent the same smiley. You have to use it in its other form; :wink: -- Wink .

Alternative Smiley Sets

The nice thing about smiley.py is that it supports any smile sets with a .pak file. This is the standard for smiley sets that is used by phpbb. You can find alternative sets of smilies at the stylesdb website.

Simply replace the docs_html/images/smilies directory with an alternative set to use them. smiley.py will automatically create the right links by reading the .pak file.

You will need to edit the smiley function in macros.py to have the right path to the smilies directory (to read it) and the right final path to the smilies for your site.

Credits

  • The smilies come from a gentleman called Spider.
  • smiley.py is written by Mark Andrews. It is licensed under the BSD license, which is the same one as the Voidspace License .
  • path.py (needed by smiley.py) is written by Jason Orendorff. He has placed it in the public domain.
[1]sys.path
[2]This is a limitation of the macros system.

Return to Top
Part of the rest2web Docs
Page last modified Thu Mar 30 17:04:24 2006.


Site Built with rest2web SourceForge.net Logo Certified Open Source

Python on Voidspace