Question: Markdown is important for documentation, it is very nice to see `README.md` can be automatically show in html format in github like <https://github.com/twitter/bootstrap/blob/master/README.md>

gitweb is written in perl script, and there is plugin for markdown in perl already.

I want to check whether there is plugin/solution to let gitweb automatically show html files for markdown format.

Answer: 
Here's something you can stick somewhere under `sub git_summary` in your `gitweb.perl` or `gitweb.cgi`. Note that it depends on an external `markdown` executable.

```
if (!$prevent_xss) {
    $file_name = "README.md";
    my $proj_head_hash = git_get_head_hash($project);
    my $readme_blob_hash = git_get_hash_by_path($proj_head_hash, "README.md", "blob");

    if ($readme_blob_hash) { # if README.md exists                                                                                                                                                      
        print "<div class=\"header\">readme</div>\n";
        print "<div class=\"readme page_body\">"; # TODO find/create a better CSS class than page_body                                                                                                  

        my $cmd_markdownify = $GIT . " " . git_cmd() . " cat-file blob " . $readme_blob_hash . " | markdown |";
        open FOO, $cmd_markdownify or die_error(500, "Open git-cat-file blob '$hash' failed");
        while (<FOO>) {
            print $_;
        }
        close(FOO);

        print "</div>";
    }
}

```

I don't really know Perl, so this is a dirty hack more than anything else, but it works.
I use this tampermonkey script in chrome to render README.md files as html, directly in gitweb:
<https://gist.github.com/nemoo/ee47cd9ad2a5b4fdddfa> Works nicely even if you do not have access to the gitweb server.