README.markdown @ 1758d8b993d0

Tear out almost everything, add /readme endpoint
author Steve Losh <>
date Wed, 15 Jan 2020 18:38:21 -0500
parents (none)
children (none)

A fork of <> that tears out
most of its guts and just adds a single thing: a `/readme` endpoint that will
display the repository's `README`.  If the `README` ends with `.md` or
`.markdown` it will be rendered with `python-markdown`, otherwise it will just
display the raw text in a `<pre>`.


1. Install [`python-markdown`](
2. Clone this repository to `/example/hgext.readme`
3. Add the following to your hgweb config:


       # optional; 'tip' is default value.
       markdown.changeid = tip

4. Create a `readme` template in whatever templates directory you're using and
   install it in the `map` file (e.g. `readme = readme.tmpl`).
5. Create the `readme.tmpl` and make it look like you want.  Inside the
   template, `{readme_content}` will contain the HTML of the README.
6. Optional: update the `default` in `map` to make `readme` the endpoint served at `/`.


This extension enables users with commit/push access to the repos to create
arbitrary html content that may be browsed by other users.  At this time no
attempt has been made to detect or prevent attacks such as cross-site scripting
(xss) and other types of attacks.  In general this extension should only be used
if you trust all users with push access.