<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div><div style="font-family : Verdana, Arial, Helvetica, sans-serif; font-size : 10pt;"><div>howdy all<br></div><div><br></div><div>location: '<a target="_blank" href="https://www.squeaksource.com/Doc">https://www.squeaksource.com/Doc</a>' is producing some very nice output for most CustomHelp subclasses.<br></div><div><br></div><div>Attached is a screenshot of DocCustomHelpToOrg toFile: PostgresV3Help<br></div><div><br></div><div>with various levels folded and un-folded.<br></div><div><br></div><div>Thanks to all who helped on the Streams approach, the code looks clean imho<br></div><div><br></div><div><br></div><div><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>toFile: aCustomHelp<br></div><div> "DocCustomHelpToOrg toFile: TerseGuideHelp."<br></div><div> |ios filename output|<br></div><div><br></div><div>filename := ((aCustomHelp name asString), '.org').<br></div><div>output := ReadWriteStream on: ''.<br></div><div>aCustomHelp allSubclassesWithLevelDo:<br></div><div> [ : eachClass : lvl |<br></div><div> <br></div><div> ios := (String streamContents:<br></div><div> [ : stream |<br></div><div> lvl timesRepeat: [ stream nextPutAll: '*' ].<br></div><div> lvl = 1<br></div><div> ifTrue:[<br></div><div> stream nextPutAll: ' '.<br></div><div> stream nextPutAll: eachClass bookName]<br></div><div> ifFalse:[<br></div><div> stream nextPutAll: ' '.<br></div><div> stream nextPutAll: eachClass bookName.<br></div><div> stream nextPutAll: ' class(' , eachClass name , ') '].<br></div><div> stream nextPut: (Character cr).<br></div><div> stream nextPutAll: (self toStream: eachClass level: (lvl +1))]).<br></div><div> output nextPutAll: (ios contents)]<br></div><div> startingLevel: 1.<br></div><div><br></div><div>StandardFileStream forceNewFileNamed: filename do: [ :file | file nextPutAll: output contents ]<br></div></blockquote><div><br></div></div><div><br></div><div><br></div><div><br></div><div>There are a couple of caveats.<br></div><div><br></div><div>First some generation errors....<br></div><div> DocCustomHelpToOrg toFile: HelpOnHelp goes into an infinite loop. (it shows up ok on <a href="http://menmachinesmaterials.com/SeasideDoc" target="_blank">http://menmachinesmaterials.com/SeasideDoc</a>)<br></div><div> DocCustomHelpToOrg toFile: MetacelloConfigurationHelp. "has a builder and pages is empty"<br></div><div><br></div><div>Second, some internal limitiations.<br></div><div> I make no allowance for a Subclass of a Help being in the superclass pages #() so some things will get rendered twice.<br></div><div> since I DO treat subclasses of a CustomHelp to be output in org.<br></div><div><br></div><div>Third, differentiating between a class and a "page" on the .org output requires a clumsy hack.<br></div><div> I preface the bookName with (class) .<br></div><div> You can see this in the screenshot.<br></div><div> Typing this, I just realized that I will need a class name in there so I will know what to name the class when I go from Org to CustomHelp . I will fix that now. (done!)<br></div><div><br></div><div>Fourth, there is some <cough>enhanced</cough> markup in some of the help pages that is Org markup and other wierd stuff.<br></div><div><br></div><div>All that said, my primary mission is to go from Org to CustomHelp.<br></div><div><br></div><div>The "Why" is that for my XTreams Parsing project I will have to learn the Monty XML packages and I want to create the help for it as I study it.<br></div><div>I run into that stuff a lot.<br></div><div>Another "Why" is Eliot and his request for Pragma design patterns help.<br></div><div><br></div><div>Its much easier to write and edit an foo.org file and then (once I write the engine) automagically write the CustomHelp classes from it.<br></div><div><br></div><div>I will start that coding tomorrow.<br></div><div>I will be making a PEG grammar for the task and the callbacks will do the class generation for me (i hope)<br></div><div><br></div><div>cheers.<br></div><div><br></div><div>t<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div><br></div></div><div><br></div></div><br></body></html>