Menu:

The Headline anchor middleware

With the new headline anchor middleware all html headlines would be converted into a human readable, url safe anchor. Every anchor is a permalink to the page. So you can easy copy&paste the links for several use.

skip headlines

We use a simple regular expression to find all headlines in the html page content. The RE only matches on headlines without any attributes. So if a headline has a CSS "id" or "class" attribute it will be ignored ;)

deactivate

If you will deactivate this completely, you can easy comment the middleware entry ('PyLucid.middlewares.headline_anchor.HeadlineAnchor') in settings.MIDDLEWARE_CLASSES.

CSS

example:

CSS
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
.anchor {
  text-decoration:none;
}
.anchor:hover {
  color:#808080;
  text-decoration:underline;
}
.anchor:hover:after {
   content:" #";
}