Ticket #498 (closed task: fixed)

Opened 5 years ago

Last modified 15 months ago

ImprovedFormatter : Heading Ids

Reported by: DotMG Owned by: DotMG
Priority: normal Milestone: 1.3.1
Component: formatters Version: 1.1.6.3
Severity: normal Keywords: ported
Cc: JavaWoman

Description (last modified by DotMG) (diff)

Attachments

wakka3callback.inc.php Download (3.2 KB) - added by DotMG 5 years ago.
An enhanced version of wakka3callback

Change History

Changed 5 years ago by DotMG

An enhanced version of wakka3callback

  Changed 5 years ago by DotMG

  • owner changed from unassigned to DotMG
  • status changed from new to assigned

Because formatters/wakka.php is called almost everytime, and because wakka3callback is anyway an afterburner callback, I think that it's better to move its call inside the file handlers/show/show.php

I've tried this scheme, and haven't broken anything.

How do you think?

  Changed 5 years ago by DarTar

  • description modified (diff)

I'm not the best person to comment on the formatter, JavaWoman and TormodH can possibly give some feedback?

And shouldn't we merge this ticket with ticket #20 ?

  Changed 5 years ago by DotMG

I think tickets #20 and #498 are related but have not to be merged. #20 is about implementing the method makeId(), but #498 is about using it!

  Changed 5 years ago by Nils

Actually we need a ticket to coordinate for the creation of IDs for 'everything' i.e. forms, headings, etc. Maybe we cshould rename #20 then?

  Changed 5 years ago by DarTar

I think this could be the coordination ticket for the application of the new functionality, whereas #20 the development ticket for the method. Alternatively, we could start a new ticket for extending the current makeID functionality to other page elements.

  Changed 5 years ago by DarTar

  • cc JavaWoman added

JW, feedback welcome on this.

  Changed 5 years ago by DarTar

  • description modified (diff)

As a potential extension of this feature, I like the functionality offered by Trac to display section links next to each heading (see for example the ¶ links that appear when you hover on a heading in http://wush.net/trac/wikka/wiki)

  Changed 5 years ago by DotMG

(In [527]) refs #498

A new parameter was added to the Format() method, it is named $format_option. It is a semicolon separated list of strings, and actually, the only parameter defined is 'page', which means we are formatting an entire page, and it involves that closing tags and generating header ids should be done.

The two handlers handlers/show/show.php and handlers/edit/edit.php were just slightly edited to add this new parameter. (Closing tags and generating id are done when previewing in edit.php)

Removed the core parameter named formatter_recursion, which become obsolete.

  Changed 5 years ago by DotMG

  • status changed from assigned to closed
  • resolution set to fixed
  • description modified (diff)

Closing this one and linking to #503

follow-up: ↓ 12   Changed 5 years ago by DarTar

  • status changed from closed to reopened
  • resolution fixed deleted

DotMG, JavaWoman - I've never completely understood whether the hn_ prefix is a bug or a feature. Is it really supposed to be hn_ (I don't get what the n stands for) or should n be replaced with the corresponding heading level, e.g. h1_?

  Changed 5 years ago by DotMG

hn_ prefix is a feature. It is really supposed to be hn_. You could consider it as a simple convention to group ids generated for headers. Creating separate group h1_, h2_, ... is just overkill. n is not intended to be replaced with anything else, not materially! It just stands for a number (as you would use hn to indicate h1 thru h6, ignoring the number).

in reply to: ↑ 10   Changed 5 years ago by JavaWoman

Replying to DarTar: In addition to DotMG's reply: having the ID prefixed with hn_ also means that you can not only link to a fragment with that ID, but that the link will remain valid if someone changes the heading level, because the ID will remain the same! That's why it was designed that way - with fragment linking in mind.

  Changed 5 years ago by JavaWoman

  • status changed from reopened to closed
  • resolution set to fixed

Since headers with hn_ prefixes are working as designed, I'm re-closing this!

  Changed 3 years ago by DarTar

  • milestone changed from 1.2 to 1.3

Retargeting to 1.3, this ticket has already been closed in trunk, from which 1.3 will be branched. Consider backporting urgent issues to 1.2.X

  Changed 3 years ago by DarTar

  • keywords ported added

Ported to branches/1.2 in [1493]

  Changed 15 months ago by BrianKoontz

  • milestone changed from 1.3 to 1.3.1

Changed milestone to 1.3.1

Note: See TracTickets for help on using tickets.