On Thu, Oct 20, 2011 at 9:52 PM, Thomas Mortagne <[email protected]> wrote: > On Thu, Oct 20, 2011 at 7:10 PM, Ashtar Communications > <[email protected]> wrote: >> That makes sense, thank you for the clarification. Unfortunately, I am >> using the HTML macro to generate the final output - this is because I >> need to use <ul>'s with a javascript to make the div's into >> collapsible trees. >> >> Does that mean I'm out of luck? > > <ul> ? I don't see much lists in your example, did you mean div ? > > You can get div with custom parameters in pure wiki syntax the following way: > > (% class="somecssclass" %) > ((( > div content > ))) > > which produces > > <div class="somecssclass">div content</div>
It's more <div class="somecssclass"><p>div content</p></div> actually. > > And if you really mean list, list most of the wiki elements list > support custom parameters too: > > (% class="somecssclass" %) > * mylist element 1 > * mylist element 2 > > which produces > > <ul class="somecssclass"> > <li>mylist element 1</li> > <li>mylist element 2</li> > </ul > > You can put anything you want in custom parameters and html renderer > will print them as you provided them depending of the element. > > Using the html macro should always be the last resort, usually when > you get some html you don't really have control on that you need to > display or when you need to display elements not supported by the wiki > syntax (yet) like <form> related stuff. > >> >> On Thu, Oct 20, 2011 at 12:45 AM, Thomas Mortagne >> <[email protected]> wrote: >>> On Thu, Oct 20, 2011 at 8:02 AM, Ashtar Communications >>> <[email protected]> wrote: >>>> One more tonight... >>>> >>>> It seems that I am unable to use the built-in TOC macro for wiki >>>> content which is generated dynamically from a Class Sheet {{include}}. >>>> I assume this is because the TOC macro is rendered before (or >>>> simultaneously with) the include macro which actually displays the >>>> objects on the page, so as far as the TOC macro knows, there are no >>>> wiki headings on the page (yet) to create an outline from. >>> >>> Actually no, there is a concept of priority in macros and TOC macro >>> priority is very low specifically to support use case like that. But >>> TOC only support (generated or not) real wiki content which mean if >>> you have anything in a html macro it will not support it because html >>> macro produce a RawBlock which is a black box containing html syntax >>> for other macros. >>> >>> So if you use case is just what you described it should work well. >>> >>>> >>>> Does anyone have any suggestions on how to parse through the final >>>> rendered output of the wiki page to generate a table of contents for >>>> dynamically generated wiki content? If I'm missing something with the >>>> existing macro, that would be great... >>>> >>>> What I am looking to do is write some code (preferably in a panel, I >>>> think), which creates a TOC-style index of all the wiki-syntax >>>> headings contained on the fully rendered page, after the content has >>>> been generated from TextArea properties of a set of attached objects >>>> to the page. >>>> >>>> I have written custom display code that loops through every object of >>>> a custom class attached to a page and then displays some of that >>>> objects properties in a series of collapsible div's. Each object >>>> contains two TextArea properties - one for WYSIWYG data, and one for >>>> plain text, which would be formatted in wiki syntax. The result is a >>>> list of each objects name with an expandable <div> full of the >>>> wiki-rendered content contained in the TextArea properties. I would >>>> like to generate a TOC which "reads through" that content and comes up >>>> with a list of only the relevant headings under each displayed >>>> "object" >>>> >>>> For example, on a page with 3 objects, the custom display code in the >>>> Class Sheet results in this (the wiki syntax appears fully rendered, >>>> obviously): >>>> >>>> Object 1 Name - Click to expand >>>> ******Hidden until clicked******** >>>> ==Heading 2== >>>> ===Heading 3=== >>>> Normal text, etc... >>>> >>>> Object 2 Name - Click to expand >>>> ******Hidden until clicked******** >>>> ==Heading 2== >>>> ===Heading 3=== >>>> Normal text, etc... >>>> >>>> Object 3 Name - Click to expand >>>> ******Hidden until clicked******** >>>> ==Heading 2== >>>> ===Heading 3=== >>>> Normal text, etc... >>>> >>>> >>>> I would like the TOC to return: >>>> >>>> Object 1 >>>> Heading 2 >>>> Heading 3 >>>> Object 2 >>>> Heading 2 >>>> Heading 3 >>>> Object 3 >>>> Heading 2 >>>> Heading 3 >>>> >>>> Even when all the div's are initially collapsed/hidden. It would be >>>> ideal if the TOC was clickable and went to the relevant anchor... >>> >>> Are the divs done using html macro or using wiki syntax ? >>> >>>> >>>> I can obviously use getValue() with each TextArea property to return a >>>> string with that objects wiki syntax - but I don't have an easy way to >>>> parse that string to only return the heading levels... >>>> >>>> Any guidance would be appreciated. >>>> >>>> Thanks, >>>> >>>> aaron >>>> _______________________________________________ >>>> users mailing list >>>> [email protected] >>>> http://lists.xwiki.org/mailman/listinfo/users >>>> >>> >>> >>> >>> -- >>> Thomas Mortagne >>> _______________________________________________ >>> users mailing list >>> [email protected] >>> http://lists.xwiki.org/mailman/listinfo/users >>> >> _______________________________________________ >> users mailing list >> [email protected] >> http://lists.xwiki.org/mailman/listinfo/users >> > > > > -- > Thomas Mortagne > -- Thomas Mortagne _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
