In part 1 we set up our database, and implemented the rendering of wiki pages.
In the second part we saw how to add a form to edit the pages, and we ended by
showing the custom markup for links within our wiki, that we’re planning to
In this third and final part of the introduction to Luminus, we’ll
implement a custom filter to render these links, and we’ll handle
creating new pages, so that the wiki is fully functional.
This is the syntax we want to use for links. Right now that doesn’t
work yet, because they’re not valid markdown. For them to work we’ll
have to do some extra processing when rendering a page. The Selmer
templating system lets you write your own filters, so we’ll make one
wiki-links to render our links.
<!-- wiki-page.html -->
This filter isn’t defined yet, let’s fix that. The layout namespace is where
Luminus puts custom tags and filters. You can see the markdown filter that we
used earlier, as well as the
csrf-field tag we needed for the form.
Add a new filter called
wiki-links. We’ll just pass through the content for
now. Let’s test that, everything should still work as before.
(defn wiki-links [content]
(filters/add-filter! :wiki-links wiki-links)