zacharyvoase / markdoc

A lightweight Markdown-based wiki system. Current status: abandoned.
http://markdoc.org/
The Unlicense
347 stars 74 forks source link

TOC output improvement #5

Open artob opened 13 years ago

artob commented 13 years ago

There's a bit of an issue with being able to effectively use the TOC extension with Markdoc: the TOC output includes the h1-level header used as the Markdoc page title, which goes against the principle of least surprise. This means in practice that the TOC output is a little uselessly redundant, since Markdoc pages are not likely to have more than one h1. If one places the TOC directly after the page title, the redundancy really pokes one in the eye.

In case there exists some way to specify that the TOC output should only include h2-level headers and their children, that'd be fantastic. I realize this isn't really a Markdoc issue per se, but one concerning the TOC extension. However, perhaps Markdoc has some degree of control here internally, within which scope the output could be remedied? I can't really imagine that when using the TOC extension with Markdoc anyone could want the h1-level titles as part of the TOC, so it wouldn't even need to be configurable.

zacharyvoase commented 13 years ago

The TOC extension doesn’t seem to support any kind of filtering. I agree that it’s stupid to be displaying the h1 in the TOC, so perhaps I’ll hack together a custom plugin that supports this kind of filtering.

As a side-note, I’m thinking about Markdoc.rb. It would make configuration and extension a lot easier.

artob commented 13 years ago

Oh man, you just made my day: Markdoc.rb would rock, hard.

Only topic of concern: the Python Markdown implementation seems pretty awesome, with all the extensions it has. I'm not certain Ruby has (yet) anything truly comparable? Then again, I do believe that a couple of the Ruby implementations have e.g. math notation support built in - so maybe it's a question of trade-offs.

zacharyvoase commented 13 years ago

Kramdown looks promising: http://kramdown.rubyforge.org/quickref.html

The inline attribute list syntax would also be very useful for RDFa :)

zacharyvoase commented 13 years ago

Imagine this:

I love [Ruby][]{:rel="foaf:interest"}.

Kramdown is very nice indeed.

artob commented 13 years ago

Kramdown was the one that had nice inline LaTeX math support as well: http://kramdown.rubyforge.org/syntax.html#math-blocks

ifnull commented 11 years ago

I added some formatting for TOC using javascript to add classes. It also implements Foundation 4. https://github.com/blitzagency/markdoc-theme