BML is essentially a simple macro language. Macros are called templates in BML. Templates are defined in lookup files and are invoked in BML files. Templates accept parameters and are divided into several types according to how parameters are transmitted and how the definition of the template is able to make use of them. Definitions of templates are essentially chunks of HTML with potentially more recursive BML template invocations inside them.
For LiveJournal, the most common templates are defined in the file
; all other
schemes either replace all of the templates, or inherit whichever
is not replaced.
To write your own scheme, all you have to do is write your own
BML lookup file that uses the same templates
Then, implementing a new scheme becomes pretty painless:
Procedure 20.1. Creating a new BML scheme:
Create a new file under
labeled after the scheme name (
foo). For example:
This file should contain all of the BML directives you have written for your unique layout.
The first line in this file should be
If you don't have a local BML configuration file (
directory, you should create one now.
The contents of that file should look like:
Manually restart the Apache process.
After you have written your scheme, consider adding it to the array in
@LJ::SCHEMES, so that
your users can use their preferred scheme. You can also add a thumbnail preview image of your front page
htdocs/img/schemethumb, and link to it from that array.