add mdbook example

This commit is contained in:
Trevor Bentley
2023-01-15 18:27:18 +01:00
parent 88e76d788c
commit a5e01d22f5
9 changed files with 106 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
This example demonstrates generating a CSV spreadsheet from a few git
repositories using Itsy-Gitsy.
Generate with:
$ itsy-gitsy -c csv.toml --clean --local
Then open "rendered/repos.csv" with a text editor or spreadsheet
application.
+11
View File
@@ -0,0 +1,11 @@
This example renders a few git repositories as an mdBook with Itsy-Gitsy.
You'll need to have Itsy-Gitsy and mdbook available. Update the
commands below to use absolute paths, if necessary.
Build the book with:
$ itsy-gitsy -c mdbook.toml --clean --local
$ mdbook serve rendered/
And navigate to http://localhost:3000/ to view. That's it!
+2
View File
@@ -0,0 +1,2 @@
[book]
title = "Itsy-Gitsy mdBook"
+42
View File
@@ -0,0 +1,42 @@
###############################################################################
##
## Minimal configuration to generate an "mdBook"
##
###############################################################################
render_markdown = false
syntax_highlight = false
asset_files = ["book.toml"]
[gitsy_templates]
path = "templates/"
repo_list = "sidebar.html"
repo_summary = "repo.html"
history = "history.html"
branches = "branches.html"
tags = "tags.html"
[gitsy_outputs]
path = "rendered/"
repo_list = "src/SUMMARY.md"
repo_summary = "src/%REPO%/about.md"
history = "src/%REPO%/history.md"
branches = "src/%REPO%/branches.md"
tags = "src/%REPO%/tags.md"
global_assets = ""
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"
+7
View File
@@ -0,0 +1,7 @@
# {{name}} -- Branches
| Branch | Hash | Summary |
| --- | --- | --- |
{% for entry in branches | sort(attribute="ts_utc") | reverse -%}
| {{entry.ref_name}} | {{entry.short_hash}} | ({{entry.summary}}) |
{% endfor -%}
+7
View File
@@ -0,0 +1,7 @@
# {{name}} -- Commits
| Hash | Summary |
| --- | --- |
{% for entry in history -%}
| {{entry.short_hash}} | ({{entry.summary}}) |
{% endfor -%}
+11
View File
@@ -0,0 +1,11 @@
# {{name}} -- Overview
{{metadata.description}}
## Recent commits (10 of {{history | length}})
{% for entry in history -%}
{% if loop.index0 < 10 -%}
- {{entry.short_hash}}: {{entry.summary}}
{% endif -%}
{% endfor -%}
+10
View File
@@ -0,0 +1,10 @@
# Summary
# Git Repositories
{% for repo in repos | sort(attribute="name") | reverse -%}
- [{{repo.name}}]({{repo.name}}/about.md)
- [history]({{repo.name}}/history.md)
- [branches]({{repo.name}}/branches.md)
- [tags]({{repo.name}}/tags.md)
{% endfor -%}
+7
View File
@@ -0,0 +1,7 @@
# {{name}} -- Tags
| Tag | Hash | Summary |
| --- | --- | --- |
{% for entry in tags | sort(attribute="ts_utc") | reverse -%}
| {{entry.ref_name}} | {{entry.short_hash}} | ({{entry.summary}}) |
{% endfor -%}