Macros?
Anton J Aylward
aja at si.on.ca
Tue May 2 13:31:24 EDT 2006
Is there any way to do macros in Markdown?
Or do you have any other suggestions?
I'm thinking of a few uses.
One is to read back system stuff that might be global or session settings.
Example
Tell the user where they are coming from, time etc
You are %%USERNAME%%
Logged in at %%LOGINTIME%%
Your browser is %%HTTP{"User-Agent"}%%
You are accessing from %%REMOTE_ADDR%%:%%REMOTE_PORT%%
The time is now %%TIME(timezone=%%USER{%%TZ%%}%%, fmt="HH:MM:SS")%%
The HTTP is the hash of all headers
The USER is the hash of all user parameters ... name timezone etc ...
You get the idea ...
Example:
I have support for 'twisies' in javascript but want to activate them
in the page body
a) Show/hide information
Lead in text
%TWISTYSHOW{id="sectionone" mode="div"
link=" <input type=\"button\" value=\"Click here to view\">"
}%%
%%TWISTYHIDE{id="sectionone" mode="div"
link=" <input type=\"button\" value=\"Click here to hide\">"
}%%
%TWISTYTOGGLE{id="sectionone" mode="div"}%
Text here gets toggled
%%ENDTWISTYTOGGLE%%
Expands to ..
<span id="sectiononeshow" class="twistyMakeOpaque">
<a href="#" class="twistyTrigger">
<span class="LinkLabel">
<input type="button" value="Click here to view">
</span></a></span> <span id="sectiononehide" class="twistyTransparent
twistyMakeOpaque">
<a href="#" class="twistyTrigger">
<span class="LinkLabel">
<input type="button" value="Click here to hide">
</span></a></span>
<p />
<div id="sectioonetoggle" class="twistyMakeHidden">
Text here gets toggled
</div>
A null "hide" button just unfurls the hidden text.
The "id" is so you can stack/nest them.
--------------------------
Suggestions? Ideas?
/anton
More information about the Markdown-Discuss
mailing list