From 84c9f70f221bed630ba7362277c39e0a5b85ee03 Mon Sep 17 00:00:00 2001 From: Trevor Bentley Date: Sun, 15 Jan 2023 02:31:49 +0100 Subject: [PATCH] add CSV generation example --- examples/csv/csv.toml | 32 +++++++++++++++++++++++++++++++ examples/csv/templates/repos.html | 6 ++++++ 2 files changed, 38 insertions(+) create mode 100644 examples/csv/csv.toml create mode 100644 examples/csv/templates/repos.html diff --git a/examples/csv/csv.toml b/examples/csv/csv.toml new file mode 100644 index 0000000..8afdfe5 --- /dev/null +++ b/examples/csv/csv.toml @@ -0,0 +1,32 @@ +############################################################################### +## +## Minimal configuration to generate a single CSV file +## +############################################################################### + +render_markdown = false +syntax_highlight = false + +[gitsy_templates] +path = "templates/" +repo_list = "repos.html" + +[gitsy_outputs] +path = "rendered/" +repo_list = "repos.csv" +cloned_repos = "cloned_repos/" + +[connectr] +path = "https://github.com/mrmekon/connectr" +website = "https://github.com/mrmekon/connectr" +description = "A super lightweight Spotify controller" + +[tempest-cljs] +path = "https://github.com/mrmekon/tempest-cljs" +website = "https://github.com/mrmekon/tempest-cljs" +description = "Tempest arcade game, in ClojureScript, hosted on Noir" + +[picdb] +path = "https://github.com/mrmekon/picdb" +website = "https://github.com/mrmekon/picdb" +description = "Command-line debugger for Microchip PIC processors" diff --git a/examples/csv/templates/repos.html b/examples/csv/templates/repos.html new file mode 100644 index 0000000..bbbd72d --- /dev/null +++ b/examples/csv/templates/repos.html @@ -0,0 +1,6 @@ +"Repository", "Date", "Hash", "Summary", "Author", "Additions", "Deletions" +{% for repo in repos | sort(attribute="last_ts_utc") | reverse -%} +{% for entry in repo.history -%} +"{{repo.name}}", "{{ts_to_date(ts=entry.ts_utc, tz=entry.ts_offset)}}", "{{entry.short_hash}}", "{{entry.summary | truncate(length=79)}}", "{{entry.author.name}}", {{entry.stats.additions}}, {{entry.stats.deletions}} +{% endfor -%} +{% endfor -%}