Monday, November 08, 2010 at 12:00 AM.
scripting2Suite.server.getPlainStoryText
on getPlainStoryText (adrstory, indentlevel, adrglossary) {
<<Changes
<<7/8/10; 7:50:24 AM by DW
<<Do glossary substitution here. Add adrglossary as a parameter.
<<6/28/10; 6:34:34 AM by DW
<<For link-blogging, if an outline node is a link, add the blue-arrow pointing to what it's linking at, so it shows up in the feed for the whole blog.
<<6/9/10; 4:24:03 AM by DW
<<Just the story text, with paragraphs, no CSS, no title, no expand-collapse.
<<This is the text we use for the RSS <description> element.
local (htmltext = "\r", adr);
local (adrsummit = scripting2Suite.server.getStorySummit (adrstory));
on add (s) {
htmltext = htmltext + string.filledstring ("\t", indentlevel) + s + "\r\n"};
on decode (s) {
return (xml.entitydecode (s, true))};
for adr in adrsummit {
if nameof (adr^) endswith "outline" {
add ("<p>" + decode (xml.getattributevalue (adr, "text")) + scripting2Suite.server.getLinkHtml (adr) + "</p>")}};
<<htmltext = string.mid (htmltext, 1, sizeof (htmltext) - 2) //get the last \r\n off
htmltext = scripting2Suite.server.glossarySubstitution (adrglossary, htmltext);
htmltext = scripting2Suite.server.glossarySubstitution (@scripting2Suite.data.systemGlossary, htmltext);
return (htmltext)};
bundle { //test code
local (adrstory = @config.scripting2.server.users.davewiner.calendar.["2010"].["05"].["12"].["03059"]);
webbrowser.displaytext (getPlainStoryText (adrstory))}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.