Xah Lee, 2009-12-09, 2010-06-20
This is the home page of xbbcode-mode, a emacs major mode for editing BBCode. (BBCode is a lightweight markup language used in online forums.).
Download at xbbcode-mode.el.
Open the file, then type “Alt+x eval-buffer”. You are done. When you need to work in bbcode, just type “Alt+x xbbcode-mode”, you'll see bbcode tags colored.
To have emacs automatically load the file when it restarts, and automatically load the mode when opening files whose name ends in “.bbcode”, do the following:
Place this file in the directory “~/.emacs.d/”. For example:
on Windows C:\Users\mary\.emacs.d\xbbcode-mode.el on Mac OS X /Users/mary/.emacs.d\xbbcode-mode.el
then, put the following lines in your emacs init file “~/.emacs”:
(add-to-list 'load-path "~/.emacs.d/") ;; add a dir to load path (autoload 'xbbcode-mode "xbbcode-mode" "Load xbbcode-mode for editing BBCode." t) (add-to-list 'auto-mode-alist '("\\.bbcode\\'" . xbbcode-mode)) ; optional. Make the command easier to remember. (defalias 'bbcode 'xbbcode-mode)
Then, restart emacs.
To start the mode, type “Alt+x xbbcode-mode”. Once you are in bbcode mode, all bbcode tags will be syntax colored.
When you are in xbbcode mode, there is a graphical menu named BBCode.
Press “Ctrl+c Ctrl+t” to change the word under cursor into a tag. The command name is xbbcode-insert-tag.
Press “Ctrl+c Ctrl+h” to show a list of commonly used bbcode tags. (command name is xbbcode-show-bbcode-help.)
Here's a example of output:
[b]bold[/b] [i]italic[/i] [u]underline[/u] [s]strike-thru[/s] [url]http://example.com/[/url] [quote]something[/quote] [img]http://example.com/cat.jpg[/img] [email]mary@example.com[/email] [quote="mary"]i didn't do it[/quote] [code]x = 5 print x [/code] [size=20]Features[/size] [color=#FF0000]red[/color] [color=FF0000]red[/color] [color=red]red[/color] [color=blue]blue[/color] [color=red][size=20]Want to Save Money?[/size][/color] [list] [*]A list of items [*]with bullets. [/list] [list=1] [*]numbered first item [*]second item [/list] [list=a] [*]first item. Ordered by a, b, c etc. [*]second tiem. [/list]