From a0eb274676a343f1b069853865caf4d92e5dba0c Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Thu, 12 Oct 2017 14:35:53 +0200 Subject: [PATCH] Add Pico code statistics --- _data/clocCore.yml | 10 ++++++++ _data/clocRelease.yml | 40 +++++++++++++++++++++++++++++++ _includes/cloc.html | 52 ++++++++++++++++++++++++++++++++++++++++ stats.md | 21 ++++++++++++++++ style.css | 52 +++++++++++++++++++++++++++++++++------- style/css/color/pico.css | 2 +- 6 files changed, 168 insertions(+), 9 deletions(-) create mode 100644 _data/clocCore.yml create mode 100644 _data/clocRelease.yml create mode 100644 _includes/cloc.html create mode 100644 stats.md diff --git a/_data/clocCore.yml b/_data/clocCore.yml new file mode 100644 index 00000000..957f1783 --- /dev/null +++ b/_data/clocCore.yml @@ -0,0 +1,10 @@ +PHP: + nFiles: 6 + blank: 226 + comment: 1122 + code: 1020 +SUM: + blank: 226 + code: 1020 + comment: 1122 + nFiles: 6 diff --git a/_data/clocRelease.yml b/_data/clocRelease.yml new file mode 100644 index 00000000..f4ae37a4 --- /dev/null +++ b/_data/clocRelease.yml @@ -0,0 +1,40 @@ +PHP: + nFiles: 10 + blank: 273 + comment: 1464 + code: 1247 +Markdown: + nFiles: 8 + blank: 194 + comment: 0 + code: 757 +CSS: + nFiles: 2 + blank: 49 + comment: 43 + code: 299 +Twig: + nFiles: 1 + blank: 7 + comment: 0 + code: 49 +JSON: + nFiles: 1 + blank: 0 + comment: 0 + code: 44 +Apache config: + nFiles: 1 + blank: 2 + comment: 3 + code: 12 +Javascript: + nFiles: 1 + blank: 0 + comment: 3 + code: 1 +SUM: + blank: 525 + code: 2409 + comment: 1513 + nFiles: 24 diff --git a/_includes/cloc.html b/_includes/cloc.html new file mode 100644 index 00000000..4da7bf9e --- /dev/null +++ b/_includes/cloc.html @@ -0,0 +1,52 @@ + + + + + + + + + + + + {% for item in cloc %} + {% if item[0] != "SUM" %} + + + + + + + + {% else %} + + + + + + + + {% endif %} + {% endfor %} + +
LanguageFilesBlank linesComment linesCode lines
{{ item[0] }}{{ item[1].nFiles }}{{ item[1].blank }}{{ item[1].comment }}{{ item[1].code }}
+ + # + {{ item[1].nFiles }} + + + + # + {{ item[1].blank }} + + + + # + {{ item[1].comment }} + + + + # + {{ item[1].code }} + +
diff --git a/stats.md b/stats.md new file mode 100644 index 00000000..62ffb2f5 --- /dev/null +++ b/stats.md @@ -0,0 +1,21 @@ +--- +layout: default +title: Code Statistics +headline: Code Statistics +description: Pico's code statistics are powered by [cloc](https://github.com/AlDanial/cloc). +nav-url: /docs/ +--- + +## Pico's core + +The following table shows code statistics for Pico's core in the version of the latest release, without all non-essential additions (like the `PicoDeprecated` plugin or Pico's default theme). + +{% assign cloc = site.data.clocCore %} +{% include cloc.html %} + +## Release package + +The following table shows code statistics of everything that is shipped in Pico's latest release package, including all recommended additions. + +{% assign cloc = site.data.clocRelease %} +{% include cloc.html %} diff --git a/style.css b/style.css index 60457ead..40fdf4b0 100644 --- a/style.css +++ b/style.css @@ -2677,22 +2677,26 @@ media_tag_5 {media_subcode:5} .amount { font-size: 40px; padding: 10px 0; + font-weight: 900; + color: #ff6760; +} +.amount span:before { + display: none; } .amount span { vertical-align: super; font-size: 20px; } +.amount.small { + font-size: 20px; +} +.amount.small span { + font-size: 12px; +} .pricing .plan h4 { padding: 0 0 10px; background: #f6f6f6; } -.pricing .plan h4 span { - font-weight: 900; - color: #ff6760; -} -.pricing .plan h4 span:before { - display: none -} /*-----------------------------------------------------------------------------------*/ /* TWITTER /*-----------------------------------------------------------------------------------*/ @@ -2989,10 +2993,42 @@ media_tag_5 {media_subcode:5} -moz-box-shadow: 0 0 3px 0 rgba(0,0,0,0.17); box-shadow: 0 0 3px 0 rgba(0,0,0,0.17); } - +/*-----------------------------------------------------------------------------------*/ +/* TABLE +/*-----------------------------------------------------------------------------------*/ +table { + border-spacing: 0; + width: 100%; +} +tr:nth-child(2n) { + background: #f6f6f6; +} +td, th { + padding: 0.4em 1em; + vertical-align: top; +} +th { + font-size: 16px; + font-weight: 900; + text-align: center; + text-transform: uppercase; + color: #616161; + background: #f6f6f6; + line-height: 45px; + white-space: nowrap; + margin: 0; +} +td, th { border: 1px solid #e9e9e9; } +tr:not(:last-child) td, tr:not(:last-child) th { border-bottom: 0 none; } +thead tr:last-child th { border-bottom: 0 none; } +td:not(:last-child), th:not(:last-child) { border-right: 0 none; } /*-----------------------------------------------------------------------------------*/ /* MISC /*-----------------------------------------------------------------------------------*/ +.align-left { text-align: left; } +.align-center { text-align: center; } +.align-right { text-align: right; } +.align-justify { text-align: justify; } .hosted-price { font-size: 20px; } .hosted-price span { font-size: 30px; diff --git a/style/css/color/pico.css b/style/css/color/pico.css index d6dba21b..a1ddb669 100644 --- a/style/css/color/pico.css +++ b/style/css/color/pico.css @@ -130,7 +130,7 @@ ul.contact-info li i { .meter > span { background-color: #2EAE9B; } -.pricing .plan h4 span { +.amount { color: #2EAE9B; } .portfolio-detail-view .closebutton:hover,