<commit_before>package main

import (
	"bytes"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"text/template"

	utils "github.com/shurcooL/github_flavored_markdown"
)

var (
	file string
	bind string
)

var html = `
<html>
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="./mdp.css" type="text/css" media="screen" charset="utf-8">
    <link href="https://assets-cdn.github.com/assets/frameworks-343a7fdeaa4388a32c78fff00bca4c2f2b7d112375af9b44bdbaed82c48ad4ee.css" media="all" rel="stylesheet" type="text/css" />
    <link href="https://assets-cdn.github.com/assets/github-82746a5e80e1762d01af3e079408b886361d5fe5339de04edb1cd6df16c24eb2.css" media="all" rel="stylesheet" type="text/css" />
    <link href="//cdnjs.cloudflare.com/ajax/libs/octicons/2.1.2/octicons.css" media="all" rel="stylesheet" type="text/css" />
    <style>
      body {
        width: 800px;
        margin: auto auto;
      }
    </style>
  </head>
  <body>
    <article class="markdown-body entry-content" style="padding: 30px;">
      {{.}}
    </article>
  </body>
</html>
`

func init() {
	flag.StringVar(&bind, "bind", ":8080", "interface to bind to, eg. 0.0.0.0:8080")
	flag.StringVar(&file, "file", "README.md", "file to render on web interface")
}

func main() {
	flag.Parse()
	http.HandleFunc("/", Handler)
	log.Printf("Serving file %s on interface %s\n", file, bind)
	log.Fatal(http.ListenAndServe(bind, nil))
}

func Handler(res http.ResponseWriter, req *http.Request) {
	readme, err := GetReadme()
	if err != nil {<commit_msg>Add version.<commit_after>package main

import (
	"bytes"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"text/template"

	utils "github.com/shurcooL/github_flavored_markdown"
)

const (
	VERSION = "0.1.0"
)

var (
	file    string
	bind    string
	version bool
)

var html = `
<html>
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="./mdp.css" type="text/css" media="screen" charset="utf-8">
    <link href="https://assets-cdn.github.com/assets/frameworks-343a7fdeaa4388a32c78fff00bca4c2f2b7d112375af9b44bdbaed82c48ad4ee.css" media="all" rel="stylesheet" type="text/css" />
    <link href="https://assets-cdn.github.com/assets/github-82746a5e80e1762d01af3e079408b886361d5fe5339de04edb1cd6df16c24eb2.css" media="all" rel="stylesheet" type="text/css" />
    <link href="//cdnjs.cloudflare.com/ajax/libs/octicons/2.1.2/octicons.css" media="all" rel="stylesheet" type="text/css" />
    <style>
      body {
        width: 800px;
        margin: auto auto;
      }
    </style>
  </head>
  <body>
    <article class="markdown-body entry-content" style="padding: 30px;">
      {{.}}
    </article>
  </body>
</html>
`

func init() {
	flag.StringVar(&bind, "bind", ":8080", "interface to bind to, eg. 0.0.0.0:8080")
	flag.StringVar(&file, "file", "README.md", "file to render on web interface")
	flag.BoolVar(&version, "version", false, "prints out the version")
}

func main() {
	flag.Parse()
	if version {
		fmt.Println(VERSION)
		os.Exit(0)
	}

	http.HandleFunc("/", Handler)
	log.Printf("Serving file %s on interface %s\n", file, bind)
	log.Fatal(http.ListenAndServe(bind, nil))
}

func Handler(res http.ResponseWriter, req *http.Request) {
	readme, err := GetReadme()
	if err != nil {
{'fraction_non_alphanumeric': 0.1755630978093181, 'fraction_numerical': 0.059858068497377355, 'mean_word_length': 3.9571865443425076, 'pattern_counts': {'":': 2, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5534746', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1284, 'n_words': 234}