grim/hgwebplus

354974557969
Parents ee0e13f9d407
Children d53b79c81bdf
Finish up the readme and add another screenshot
--- a/README.md Fri Apr 10 19:17:01 2020 -0500
+++ b/README.md Fri Apr 10 19:59:36 2020 -0500
@@ -7,14 +7,19 @@
get them upstreamed. Also, due to the Bitbucket death clock, I couldn't wait
for an upstream release.
-That said, all of the changes that this extensions has done are completely
-backwards compatible and older themes will work just fine.
-
All screen shots are from my
[hgkeeper-theme](https://keep.imfreedom.org/grim/hgkeeper-theme).
# Features
+hgwebplus was created during the development of
+[hgkeeper-theme](https://keep.imfreedom.org/grim/hgkeeper-theme) as a way to
+make the theme look more like current code hosting sites.
+
+Everything has been built to be backwards compatible, to keep existing themes
+working. However, this code has only been tested on Python3 and Python2 is
+considered unsupported right now.
+
## Readme Rendering
The most notable feature is that a new template keyword named `readme` has been
@@ -22,6 +27,8 @@
will look for files named `README.md`, `README.txt`, and `README` in a case
insensitive fashion, and return their contents rendered to HTML.
+**Please note, that at this time, images do not yet work.**
+
The Markdown rendering uses [cmarkgfm](https://pypi.org/project/cmarkgfm/) to
support GitHub Flavored Markdown. However, there is no styling associated with
this render. To do that, I recommend you use [sindresorhus's
@@ -31,6 +38,22 @@
For plain text, the HTML rendering is just literally prefixing line endings
with a `<br/>`.
+## Gravatar Support
+
+This is a bit of a misnomer as there isn't actually a
+[Gravatar](https://gravatar.com/) filter/keyword, but hgwebplus adds an `md5`
+filter that allows you to create Gravatar links.
+
+With the `md5` filter you can then display a Gravatar for an author with the
+example below:
+
+```
+<img src="https://www.gravatar.com/avatar/{author|email|mailmap|strip|lower|md5}?s=36" decoding="async">
+```
+
+At some point, we'll probably build a proper function where you don't need to
+know the specifics of the Gravatar API, but for now this works.
+
## Diff Rendering
The stock diff rendering in hgweb leaves a bit to be desired. When rendering
@@ -42,3 +65,73 @@
you to create something similar to the screenshot below.
![diff screenshot](images/diff.png)
+
+## Diffstat
+
+The diffstat template has been modified to give you the number of lines added
+and removed as well as a boolean telling you if the file is binary or not.
+
+With these changes you can create something like the below screen shot:
+
+![diffstat example](images/diffstat.png)
+
+# Issues
+
+If you have any issues with this extension, please file them at
+[issues.imfreedom.org/hgwebplus](https://issues.imfreedom.org/hgwebplus).
+
+# Installation
+
+Release are done purely via [pypi](https://pypi.org/project/hgwebplus/) and
+can be installed a few ways.
+
+## Mercurial Installed via Package Manager
+
+If your Mecurial is installed via your package manager, you may choose to
+install hgwebplus to the system path, but this typically requires sudo access.
+If you choose to go this route, you can use the following command to install
+hgwebplus.
+
+```
+pip3 install hgwebplus
+```
+
+Once it's done installing, you can modify your `~/.hgrc` and add the make
+sure your `[extensions]` section contains the following:
+
+```
+[extensions]
+hgext3rd.hgwebplus =
+```
+
+If you would rather not install hgwebplus system wide, you can instead install
+it to your user directory with the following command:
+
+```
+pip3 install --user hgwebplus
+```
+
+Once this is installed, you'll have to update your `~/.hgrc` to look something
+like the following replacing the `?` with your version of Python:
+
+```
+[extensions]
+hgext3rd.evolve = ~/.local/lib/python3.?/site-packages/hgext3rd/
+```
+
+## Mercurial Installed Via pip
+
+If you've installed mercurial via `pip3 --user` then you can just install
+hgwebplus in the same manner with
+
+```
+pip3 install --user hgwebplus
+```
+
+After installation you just need to tell Mercurial about it by making sure
+that your `~/.hgrc` `[extensions]` section contains the following:
+
+```
+[extensions]
+hgext3rd.hgwebplus =
+```
Binary file images/diffstat.png has changed