Legacy:Wiki Development/Tree Markup - Unreal Wiki

# Legacy:Wiki Development/Tree Markup

### From Unreal Wiki, The Unreal Engine Documentation Site

< Legacy:Wiki Development

This is now online! It correctly parses a hierarchy of + into a pretty ASCII tree. There's one thing it doesn't do yet though: parse the text of the tree for wiki syntax (in particular, wiki links). I admit I have no idea how to get Wookee to do this. Mych, could you take a look at this? It's in CVS, WookeeTree.pm.

## Try it

parent
child
child
child
grandchild
ggchild
gggchild
gggchild
links don't work :(
Yes, I *said* they don't work above! – Tarquin
ggchild
child
gchild
child
awesome

## Discussion

Mychaeel: Great work. :-) – I'll have a look at the formatting problem. I don't think it's hard to solve.

## Old Discussion

Sobiwan: Is there are markup that displays hierarchy lines such as found in the Class browser? There are many pages here that use ASCII markup for this purpose.

Tarquin: Interesting idea... but I think there would be too many problems to solve, such as making it work at all font sizes.

Sobiwan: I think it would work... unless I am missing something. It would be similar to bulleted hierarchy because the markup is inherently indenteded, so it would keep the formatting at any font size. Instead of using bullets or numbers, it uses lines and plus signs like the ASCII counterpart.

Tarquin: What sort of markup do you envisage? What sort of output?

Sobiwan:Sobiwan: Since markup is supposed to affect layout and people are using ASCII to create hierarchal layout such as found on the Actor Class Hierarchy page, it would be good to include this type of layout as a markup to keep the concept of markup lauyout consistent. One could create a markup such as:

    <hierarchy>
     Actor
       +- AimedAttachment
       +- Brush
       |+- Volume
       +- Controller
    </hierarchy>

The WIKI would display the lines nicely, auto indent sub-items, auto indent word wrapped sub-items. It doesnt have to be collapsable, just make good looking layout instead of relying on ASCII.

Tarquin: well what I was thinking you'd want to write was this:

    + Parent
    ++ Child
    ++ Child2

It could output the sort of ASCII we currently do. I don't know how we can "display the lines nicely" in HTML.

Sobiwan: The only requirement for markup is ease. :) Perhaps the markup would generate a dynamic table or CSS formatting to get lines, colors, indentation and word wrap.

Tarquin: I think the current ASCII tree is fine for readers. The problem as I see it is that it is a pain for writers to create. It might be possible to create a tree-type thing with CSS but it would be a huge mess, unless there's something I've not thought of. This is all academic, as it's Mych's Wookee that has to be altered and I think it's beyond my perl skills.

Wormbo: Let's look at a typical ASCII art hierarchy:

    Parent
     +- Child 1
     |   +- Child of Child 1
     |       +- Grandchild of Child 1
     +- Child 2
         +- Child 1 of Child 2
         |   +- Grandchild of Child 2
         +- Child 2 of Child 2

That could be created with Wiki Markup like this:

    +Parent
    ++Child 1
    +++Child of Child 1
    ++++Grandchild of Child 1
    ++Child 2
    +++Child 1 of Child 2
    ++++Grandchild of Child 2
    +++Child 2 of Child 2

Wookee only has to watch out whether a vertical line is neccessary or not.

Tarquin: That's what I envisioned too. But we seem to have lost Mych – I emailed him last week to see if he had any ideas about our google problem, and no reply. :(

Mychaeel: Heh – I replied to your email yesterday. Please check your mail before complaining. :-)

Tarquin: Hi Mych! :D :D The system would be quite complex – a certain number of "+" need indentation with spaces, plus possibly vertical lines, depending on whether there are further siblings (that is, a line with the same number of "+" before the next line with fewer "+" or the end of the block. There's also the matter of the whole block needing PRE tags, but not the sub blocks. All in all, it needs the Wookee-master. But I would say this is lower priority than Jailbreak :)

Sobiwan: Yes, there is no rush on this. I wasnt arguing the ASCII tree is good or bad for readers or writers, only that I noticed it was not following the rule of markup for layout. I like how the markup idea has been refined; its easy to follow.

CSS being customizable, there should be a way to define each level of a list to display the vertical and horizontal lines. Although I'm rusty at CSS, I can take a stab at getting the layout right using simple CSS code, then Mych can figure out how to translate it to Wookie.

Tarquin: I'm currently working on this. I have tamed wookee (!!!!) and I have the + markup correctly converted into an ASCII tree. The last problem is the vertical bars that connect + signs of separated siblings – it's proving problematic, but I think I see the solution. (Of course, the best way would be a s// that works vertically.... )

OlympusMons: Ok so I thought this might be a better place for this stuff as the side bar page is kinda wrong for this piece of info. The stuff below was taken from the Object Class Hierarchy page and put here so that page is much cleaner now.

WeaponFire
* BallTarget

- FM_Turret_AltFire_Shield
- FM_Turret_AltFire_Minigun

* InstantFire
** AssualtFire

- - - link
      - link
        - link
  - ClassicSniperFire
  - FM_SpaceFighter_InstantHitLaser
  - FM_Turret_IonCannon_Fire
  - FM_Turret_Minigun_Fire
  - MinigunFire
  - ShockBeamFire
  - SniperFire

- LinkFire
- PainterFire
- PainterZoom

* ProjectileFire
** AssaultGrenade

- - BallShoot
  - BioChargedFire
  - BioFire
  - FlakAltFire
  - FlakFire
  - FM_BallTurret_Fire
  - FM_LinkTurret_Fire
  - FM_Sentinel_Fire
  - FM_SpaceFighter_AltFire
  - LinkAltFire
  - ONSAVRiLFire
  - RedeemerFire
  - RocketFire
  - RocketMultiFire
  - ShockProjFire
  - TransFire

- ShieldAltFire
- ShieldFire
- SniperZoom
- TransRecall

OlympusMons: Best I could come up with, with what I know of the tags. :P

OlympusMons: If only that graphic was a single line height and those borders where removed. Ok I had an idea, would it be possible to get some sort of sidebar Object class tree going?? Like use the functionality I have displayed above for a side bar which can be brought up, that way you could browse through the game classes a lot easier. Maybe add something to display the custom classes and where they sit on the class tree, Im not sure about the unrealated :o stuff like the mapping stuff but for the code side of things I reckon this would be a great feature.

OlympusMons: ok had a quick go but it seems as though the 1.5 line must be a standard kinda thing, maybe its just the theme I got on. Hmm well I think the whole thing would have to be reformatted to match, I think its fine the way it is at the moment. While looking over some of the formatting pages I saw that the hierarchy cant go 4 deep and still contain links, dunno if this has been fixed etc. Ok now Ive found something I think might be helpful take a look at Category:Legacy Class Tree - see how the pages with subfolders get indented, maybe something like this can be adapted for a hierarchy type command. Just a suggestion anyway tell me what you think...

Category: Legacy Class Tree

##### Views

- Legacy
- Discussion
- Current revision

##### Search