hoc/static/index.html

123 lines
3.7 KiB
HTML
Raw Normal View History

2019-04-16 20:55:15 +02:00
<!DOCTYPE html>
2019-04-20 12:44:53 +02:00
<html lang="en">
2019-04-16 20:55:15 +02:00
<head>
2019-04-20 12:43:51 +02:00
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2019-04-20 14:49:14 +02:00
<meta name="keywords" content="Hits-of-Code, GitHub, Badge" />
<meta name="description" content="Hits-of-Code Badges for Git repositories" />
2019-04-20 12:43:51 +02:00
<link rel="stylesheet" href="tacit-css.min.css" />
2019-04-16 20:55:15 +02:00
<title>Hits-of-Code Badges</title>
</head>
<body>
2019-04-19 19:13:43 +02:00
<section>
2019-04-20 12:33:09 +02:00
<header>
<h1>Hits-of-Code Badges</h1>
</header>
2019-04-16 20:55:15 +02:00
2019-04-20 12:33:09 +02:00
<article>
2019-04-17 21:53:43 +02:00
<p>
2019-04-16 20:55:15 +02:00
This API offers badges for the Hits-of-Code metric for your repositories. This metric was proposed by
<a href="https://www.yegor256.com/">Yegor Bugayenko</a> as an
<a href="https://www.yegor256.com/2014/11/14/hits-of-code.html">alternative to Lines-of-Code</a>.
2019-04-17 21:53:43 +02:00
</p>
2019-04-16 20:55:15 +02:00
2019-04-17 21:53:43 +02:00
<p>
2019-04-20 12:33:09 +02:00
Instead of counting the number of existing lines in a codebase, the number of modified lines is counted. That way, the
2019-04-16 20:55:15 +02:00
metric can only grow and never shrink. While this metric still cannot give any information about the code quality, it
gives an overview about the amount of work put into a codebase.
2019-04-17 21:53:43 +02:00
</p>
2019-04-16 20:55:15 +02:00
2019-04-17 20:48:47 +02:00
<p>
2019-04-16 20:55:15 +02:00
There is a <a href="https://github.com/yegor256/hoc/">command-line tool</a> to calculate the HoC of a repository, but
some people might want a nice badge to put in their README, that's why I implemented this API. Currently the API can be
used for GitHub, GitLab and Bitbucket repositories. Just put the following code in your README:
<pre>
2019-04-20 12:38:57 +02:00
[![Hits-of-Code](https://hitsofcode.com/&lt;service&gt;/&lt;user&gt;/&lt;repo&gt;)](https://hitsofcode.com/view/&lt;service&gt;/&lt;user&gt;/&lt;repo&gt;)
2019-04-16 20:55:15 +02:00
</pre>
where <code>&lt;service&gt;</code> is one of <code>github</code>, <code>gitlab</code> or <code>bitbucket</code>. So the
following Markdown
<pre>
2019-04-19 17:59:39 +02:00
[![Hits-of-Code](https://hitsofcode.com/github/vbrandl/hoc)](https://hitsofcode.com/view/github/vbrandl/hoc)
2019-04-16 20:55:15 +02:00
</pre>
would render this badge:
<pre>
2019-04-19 17:59:39 +02:00
<a href="https://hitsofcode.com/view/github/vbrandl/hoc"><img src="https://hitsofcode.com/github/vbrandl/hoc" /></a>
2019-04-16 20:55:15 +02:00
</pre>
2019-04-20 12:33:09 +02:00
</p>
2019-04-16 20:55:15 +02:00
2019-04-19 16:00:30 +02:00
<h2>Colors</h2>
<p>
You can generate badges with custom colors via the <code>color</code> query parameter. The following predefined colors
are supported:
<pre>
<img src="/badge?color=brightgreen" />
<img src="/badge?color=green" />
<img src="/badge?color=yellowgreen" />
<img src="/badge?color=yellow" />
<img src="/badge?color=orange" />
<img src="/badge?color=red" />
<img src="/badge?color=blue" />
<img src="/badge?color=lightgrey" />
<img src="/badge?color=success" />
<img src="/badge?color=important" />
<img src="/badge?color=critical" />
<img src="/badge?color=informational" />
<img src="/badge?color=inactive" />
</pre>
2019-04-20 12:33:09 +02:00
</p>
2019-04-19 16:00:30 +02:00
<p>
You can also pass HTML color codes:
<pre>
<img src="/badge?color=ff69b4" /> <img src="/badge?color=9cf" />
</pre>
2019-04-20 12:33:09 +02:00
</p>
2019-04-19 16:00:30 +02:00
2019-04-16 20:55:15 +02:00
<h2>Source Code</h2>
2019-04-20 12:33:09 +02:00
<p>
2019-04-16 20:55:15 +02:00
The whole service is licensed under the <a href="https://opensource.org/licenses/MIT">MIT license</a> and the source
code <a href="https://github.com/vbrandl/hoc">can be found on GitHub</a>. Feature proposals or pull requests are
welcome.
2019-04-20 12:33:09 +02:00
</p>
2019-04-16 20:55:15 +02:00
<h2>Contact</h2>
2019-04-20 12:33:09 +02:00
<p>
2019-04-16 20:55:15 +02:00
You can reach me via mail: <a href="mailto:mail+hoc@vbrandl.net">mail+hoc@vbrandl.net</a> preferably using
my <a href="https://mirror.oldsql.cc/key.asc">GPG key</a>
2019-04-17 21:55:46 +02:00
(<a href="http://pool.sks-keyservers.net/pks/lookup?op=get&amp;search=0x1FFE431282F4B8CC0A7579167FB009175885FC76">from a
2019-04-16 20:55:15 +02:00
keyserver</a>), or by using any other UID from my key.
2019-04-20 12:33:09 +02:00
</p>
</article>
<footer>
<nav>
<ul>
<li>
<small>Created by <a href="https://www.vbrandl.net">Valentin Brandl</a>.</small>
</li>
</ul>
</nav>
<nav>
<ul>
<li><small><a href="https://github.com/vbrandl/hoc">GitHub</a></small></li>
<li><small><a href="https://opensource.org/licenses/MIT">MIT License</a></small></li>
</ul>
</nav>
</footer>
2019-04-19 19:13:43 +02:00
</section>
2019-04-16 20:55:15 +02:00
</body>
</html>