Skip to content

Instantly share code, notes, and snippets.

Created October 5, 2012 19:18
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Show as part of a project summary in Gitweb
# Convert (Markdown file) to HTML and include in output #using external Markdown
if (!$prevent_xss) {
$file_name = "";
my $proj_head_hash = git_get_head_hash($project);
my $readme_blob_hash = git_get_hash_by_path($proj_head_hash, "", "blob");
if ($readme_blob_hash) { # if 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 $_;
print "</div>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment