Tags:
create new tag
, view all tags
This started in SectionTitles. The idea is to have automatically generated heading numbers, i.e. to get a structure (aka TOC) of:
  • 1. Food
    • 1.1 Sushi
      • 1.1.1 Maguro
      • 1.1.2 Hamachi
      • 1.1.3 Ebi
    • 2.1 Dim Sum
      • 2.1.1 Sticky Rice
      • 2.1.2 Shanghai Dumpling
  • 2. Drinks
    • 2.1 (you get the idea)

The proposed syntax is using '#' (number!) instead of '+', i.e.

You type: ---+ Food
---++ Sushi
---+++ Maguro
---+++ Hamachi
---# Food
---## Sushi
---### Maguro
---### Hamachi
You get:

Food

Sushi

Maguro

Hamachi

1. Food

1.1 Sushi

1.1.1 Maguro

1.1.2 Hamachi

-- PeterThoeny - 01 Mar 2001

The concept of headings is sth. I would like to see. But the way of indenting feels rather unnatural to me. Couldn't we leverage existing practice:

*Small heading, like H3*

__bigger heading, say H2__

### Biggest heading, a H1###

Ok, the last one isn't used in Twiki, but it think it's common in code and other ascii-only text. Advantage:

  • the ascii source is more readable
Disadvantage:
  • it's not practical to support all 6 header levels of html. For a single wiki page, 3 levels should be more than enough. But that begs a question:
Are there any ideas to extend the table of contents beyond one page?

-- PeterKlausner - 02 Mar 2001

IMO it is important to distinguish between logical markup (like bold, italic) and block-level markup (like headings). If we mix both, %TOC% would incorrectly pick up logical markup as headings.

The TOC can be extended over many topics also nested, simply use %INCLUDE{...}%.

-- PeterThoeny - 03 Mar 2001

Personally, I like the idea of being able to pick up a TOC from typing stuff as PeterKlausner suggested. After all it is more Wiki like, whereas enforcing use of HTML is kinda, well, you know what I mean smile

How about this: (pseudoperl)

if ($theLine =~ /^\*.+\*$/) { Level 3 Heading }
if ($theLine =~ /^\_\_.+\_\_$/) { Level 2 Heading }
if ($theLine =~ /^\#\#\#.+\#\#\#$/) { Level 1 Heading }

I don't currently using the latter two, but do use the first of these. Have these auto TOC'd and auto marked up would be extremely nice. -- TWikiGuest - 19 Mar 2001

Topic revision: r6 - 25 Aug 2008 - 03:53:13 - TWikiJanitor
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback