Skip to content

Commit

Permalink
feat: update CSS background-color: white (#38)
Browse files Browse the repository at this point in the history
* feat:add new line for index page

* style: change background-color from green(#dfd) to write

* sytle: Update gitstats.css backgroud color to #ffffff
  • Loading branch information
shenxianpeng authored Jan 8, 2025
1 parent d555c6c commit 4269d26
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ help:
@echo
@echo "make image # make a docker image"
@echo "make publish-image # publish docker image to ghcr"
@echo "make install-deps" # install gnuplot on ubuntu
@echo "make preview # preview gitstats report in local"
@echo

Expand All @@ -17,9 +18,13 @@ publish-image: image
@docker tag gitstats:$(TAG) ghcr.io/shenxianpeng/gitstats:$(TAG)
@docker push ghcr.io/shenxianpeng/gitstats:$(TAG)

install-deps:
@sudo apt update -y
@sudo apt install gnuplot -y
@pip install -e .

preview:
@mkdir -p gitstats-report
@gitstats . gitstats-report
@python3 -m http.server 8000 -d gitstats-report

.PHONY: all help install release image publish-image
.PHONY: all help install-deps release image publish-image
2 changes: 1 addition & 1 deletion gitstats/gitstats.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
body {
color: black;
background-color: #dfd;
background-color: #ffffff;
}

dt {
Expand Down
9 changes: 9 additions & 0 deletions gitstats/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,24 +899,28 @@ def create(self, data, path):

f.write("<dl>")
f.write("<dt>Project name</dt><dd>%s</dd>" % (data.projectname))
f.write("<br>")
f.write(
"<dt>Generated</dt><dd>%s (in %d seconds)</dd>"
% (
datetime.datetime.now().strftime(format),
time.time() - data.getStampCreated(),
)
)
f.write("<br>")
f.write(
'<dt>Generator</dt><dd><a href="https://github.com/shenxianpeng/gitstats">GitStats</a> (version %s), %s, %s</dd>'
% (getversion(), getgitversion(), getgnuplotversion())
)
f.write("<br>")
f.write(
"<dt>Report Period</dt><dd>%s to %s</dd>"
% (
data.getFirstCommitDate().strftime(format),
data.getLastCommitDate().strftime(format),
)
)
f.write("<br>")
f.write(
"<dt>Age</dt><dd>%d days, %d active days (%3.2f%%)</dd>"
% (
Expand All @@ -925,11 +929,14 @@ def create(self, data, path):
(100.0 * len(data.getActiveDays()) / data.getCommitDeltaDays()),
)
)
f.write("<br>")
f.write("<dt>Total Files</dt><dd>%s</dd>" % data.getTotalFiles())
f.write("<br>")
f.write(
"<dt>Total Lines of Code</dt><dd>%s (%d added, %d removed)</dd>"
% (data.getTotalLOC(), data.total_lines_added, data.total_lines_removed)
)
f.write("<br>")
f.write(
"<dt>Total Commits</dt><dd>%s (average %.1f commits per active day, %.1f per all days)</dd>"
% (
Expand All @@ -938,13 +945,15 @@ def create(self, data, path):
float(data.getTotalCommits()) / data.getCommitDeltaDays(),
)
)
f.write("<br>")
f.write(
"<dt>Authors</dt><dd>%s (average %.1f commits per author)</dd>"
% (
data.getTotalAuthors(),
(1.0 * data.getTotalCommits()) / data.getTotalAuthors(),
)
)
f.write("<br>")
f.write("</dl>")

f.write("</body>\n</html>")
Expand Down

0 comments on commit 4269d26

Please sign in to comment.