missing post

Started by cormullion, February 06, 2009, 04:02:09 AM

Previous topic - Next topic

cormullion

There was a post about folding from unix-techie a few days ago - I suppose it's been deleted...



It seems a nice idea to have expanding/collapsing headings, so I had a go at doing it. If I can make it look good, I'll make it happen for newLISP v6.0... :)

Ryon

#1
I think it was something about documentation?



I sure didn't delete it; I've even left up Majornic's unforgettable post from a couple of months ago. Maybe it was taken down by the OP?
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

xytroxon

#2
Quote from: "Ryon"I sure didn't delete it; I've even left up Majornic's unforgettable post from a couple of months ago. Maybe it was taken down by the OP?


I noticed a forum problem when I was looking at this thread again:

newLISP newS: Interesting problem for me

http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2574">//http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2574



Clicking on page two (start=25) of this thread doesn't show the page footer after the last post... At least not on my browser ;)

http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2574&start=25">//http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2574&start=25



I also think it dropped one of my posts... Could it be a corrupt database losing threads?



-- xytroxon
\"Many computers can print only capital letters, so we shall not use lowercase letters.\"

-- Let\'s Talk Lisp (c) 1976

Ryon

#3
Page two looks fine to me. We've always had a bug that infrequently affects the headers and footer graphics, maybe that's what you're seeing?



For now, everything looks secure and backed up. Let's all keep an eye out for trouble, though.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

unixtechie

#4
no, I deleted it myself ;))))))))



But if you liked the formatting, let me recap what was written:



I suggested another format for NewLisp documentation and offered 3 files (the Manual/Reference, Code Patterns and cormullion's Introduction) as examples



This formatting turns every section marked in the original HTML file with "h1", "h2", ...  into a "collapsible" or "folding" section: click on the title and it opens.



So the document becomes a sort of TOC of itself, and the major convenience, as I perceive it, is that one does not have to keep a huge document (800k or more) open in his browser window, but only view what he needs.

Which provides a sort of "bird's eye view" and clarifies thinking according to my homegrown theory.



I use these views on my source code when writing scripts/programs and wrote a script that dynamically creates them.



So this format is just another derivative format from the "main" full HTML source, which one does not need to change, really (a couple of inconsistensies for the automatic script to make clean output).



If you like it, put it as a sample, as an alternative view on your web site (the file I sent you is a drop-in in your "Introduction" file structure), and let's see if others find the format useful.

If so, I'll give you guys the script to create it, and we'll just have one more derivative formatting for the documentation.



Let others see it and voice their opinions in this thread.



P.S. -- and cormullion you do not need to do anything, really.

I have a script (in Perl) that does it automatically.

So let me e-mail the samples again, and I'll give you the script to create them from your documentation then too.



P.P.S .. although if you want to rewrite the script in NewLIsp I won't hold you from that  ;))

The script basically substitutes each "h1", "h2", ... with a reference to a simple javascript function, while giving the sections unique numeric IDs.

The closing links require a tiny bit of calculation to keep track which of a hierarchy of enclosed foldings they toggle

That's basically it. Plus insert your own formatting style -- /style in the "head" of your generated HTML file (can be a default inside the file and a reference to an external css in case you supply one), if you need that at all

Ryon

#5
Whew! Glad that's under control.



You had me taking so many nitroglycerine tablets, Homeland Security was going to call a purple alert.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

cormullion

#6
I have your email still...



I thought it was an interesting idea, and found a mechanism to do it (assign a class to each element in a section, and change the style of each class using Javascript) that didn't otherwise alter the appearance. Since the HTML is generated by newLISP, it wouldn't be hard to add the classes.



What's with this rapid posting and deleting, though? I too thought I'd been hallucinating about HTML outlines... :)

unixtechie

#7
Quote from: "cormullion"I ......  found a mechanism to do it (assign a class to each element in a section, and change the style of each class using Javascript) that didn't otherwise alter the appearance. Since the HTML is generated by newLISP, it wouldn't be hard to add the classes.


Err.. the basic building block of this "folding" is in setting the style of each element (there's no need for "class", you can have JUST unique IDs for toggling), toggling between element.style.display="block" (that is visible) and "none" (that is not)



Change in appearance in no way is connected to this function - I simply cut your embedded stylesheet and put in mine. You can keep yours, just change the headings to trigger the toggle as in teh sample files, and refer them to unique element IDs (in "div"s, that is easiest) :



.. where "toggleDiv" can be defined once in your page "head" or inlined with each invocation, it's small.



You'll have to keep a bit of tracking for nested folding to work, i.e.. figure out where the higher level which wraps inned subsections actually ends to put your closind </div> there, though



But my script does not NEED to change your formatting into those "fieldsets" at all. I did it just because.. ;))



I also generate  the "folding TOC", which opens/closes sections from the TOC, and an index of code chunks with can be traced to the TOC sections  (as this is used for formatting source code with commentaries in a literate program), but that most probably is not needed in case of doing simple folding docs.