milestoner 18.4.0 → 18.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +175 -54
- data/lib/milestoner/builders/feed.rb +0 -1
- data/lib/milestoner/builders/web.rb +4 -3
- data/lib/milestoner/cli/actions/cache/create.rb +12 -6
- data/lib/milestoner/cli/actions/cache/list.rb +9 -1
- data/lib/milestoner/commits/tagger.rb +20 -3
- data/lib/milestoner/renderers/asciidoc.rb +12 -3
- data/lib/milestoner/renderers/markdown.rb +14 -1
- data/lib/milestoner/sanitizer.rb +16 -7
- data/lib/milestoner/syndication/builder.rb +1 -1
- data/lib/milestoner/templates/milestones/_avatar.adoc.erb +1 -1
- data/lib/milestoner/templates/milestones/_avatar.html.erb +6 -5
- data/lib/milestoner/templates/milestones/_avatar.md.erb +1 -2
- data/lib/milestoner/templates/milestones/_avatar.xml.erb +1 -5
- data/lib/milestoner/templates/milestones/_commit.adoc.erb +6 -20
- data/lib/milestoner/templates/milestones/_commit.html.erb +32 -53
- data/lib/milestoner/templates/milestones/_commit.md.erb +1 -1
- data/lib/milestoner/templates/milestones/_commit.xml.erb +13 -41
- data/lib/milestoner/templates/milestones/_content.adoc.erb +1 -0
- data/lib/milestoner/templates/milestones/_content.html.erb +1 -0
- data/lib/milestoner/templates/milestones/_content.xml.erb +1 -0
- data/lib/milestoner/templates/milestones/_logo.adoc.erb +1 -0
- data/lib/milestoner/templates/milestones/_logo.html.erb +1 -0
- data/lib/milestoner/templates/milestones/_logo.md.erb +3 -0
- data/lib/milestoner/templates/milestones/_logo.xml.erb +3 -0
- data/lib/milestoner/templates/milestones/_none.adoc.erb +1 -0
- data/lib/milestoner/templates/milestones/_none.html.erb +1 -0
- data/lib/milestoner/templates/milestones/_none.xml.erb +1 -0
- data/lib/milestoner/templates/milestones/_profile.adoc.erb +1 -1
- data/lib/milestoner/templates/milestones/_profile.html.erb +1 -5
- data/lib/milestoner/templates/milestones/_profile.md.erb +1 -1
- data/lib/milestoner/templates/milestones/_profile.xml.erb +1 -5
- data/lib/milestoner/templates/milestones/_tag-insecure.html.erb +8 -0
- data/lib/milestoner/templates/milestones/_tag-secure.html.erb +13 -0
- data/lib/milestoner/templates/milestones/_tag.adoc.erb +3 -3
- data/lib/milestoner/templates/milestones/_tag.html.erb +3 -29
- data/lib/milestoner/templates/milestones/_tag.md.erb +2 -6
- data/lib/milestoner/templates/milestones/_tag.xml.erb +2 -7
- data/lib/milestoner/templates/milestones/_user.adoc.erb +1 -0
- data/lib/milestoner/templates/milestones/_user.html.erb +1 -0
- data/lib/milestoner/templates/milestones/_user.md.erb +1 -0
- data/lib/milestoner/templates/milestones/_user.xml.erb +1 -0
- data/lib/milestoner/templates/milestones/_users.adoc.erb +3 -0
- data/lib/milestoner/templates/milestones/_users.html.erb +7 -0
- data/lib/milestoner/templates/milestones/_users.md.erb +3 -0
- data/lib/milestoner/templates/milestones/_users.xml.erb +7 -0
- data/lib/milestoner/templates/public/page.css.erb +409 -19
- data/lib/milestoner/views/context.rb +1 -1
- data/lib/milestoner/views/milestones/show.rb +2 -0
- data/lib/milestoner/views/parts/commit.rb +27 -3
- data/lib/milestoner/views/parts/tag.rb +15 -4
- data/lib/milestoner/views/parts/user.rb +32 -0
- data/lib/milestoner/views/scope_builder.rb +40 -0
- data/lib/milestoner/views/scopes/content.rb +17 -0
- data/lib/milestoner/views/scopes/logo.rb +15 -0
- data/lib/milestoner/views/scopes/tag_signature.rb +27 -0
- data/lib/milestoner/views/scopes/users.rb +14 -0
- data/milestoner.gemspec +2 -1
- data.tar.gz.sig +0 -0
- metadata +43 -7
- metadata.gz.sig +0 -0
- data/lib/milestoner/templates/milestones/_icon.adoc.erb +0 -1
- data/lib/milestoner/templates/milestones/_icon.html.erb +0 -6
- data/lib/milestoner/templates/milestones/_icon.md.erb +0 -5
- data/lib/milestoner/templates/milestones/_icon.xml.erb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acc8c51f0fa0cacdf7e8bc0e871a697520ce09c2b7af09c1dba01c1632b06671
|
4
|
+
data.tar.gz: 164ef1e821b63b7b382cbcb4dda7a9450c7d0493dfb92436b2161fcc983599f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a999795a124cc155086e5826bd64880f9838d415e941b455cab6141bd66a05713e47009afbc11749809ff7692aced45bb13878f4a6fc0620ec520536f5741d0d
|
7
|
+
data.tar.gz: f2e01fb0744c54b2d1b6c87f7bd7932c71bde127a5509a101e05b37c87cc340371af596fd3bcf5edf72dfbcd25a99505a54925e323ed88a489af4672c7ebe3e2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
:figure-caption!:
|
4
4
|
|
5
5
|
:ascii_doc_link: link:https://asciidoctor.org/docs/what-is-asciidoc[ASCII Doc]
|
6
|
+
:ascii_doctor_link: link:https://asciidoctor.org[Asciidoctor]
|
6
7
|
:cff_link: link:https://github.com/citation-file-format/ruby-cff[CFF]
|
7
8
|
:etcher_link: link:https://alchemists.io/projects/etcher[Etcher]
|
8
9
|
:firefox_link: link:https://www.mozilla.org/en-US/firefox[Firefox]
|
@@ -11,8 +12,8 @@
|
|
11
12
|
:git_commit_anatomy_link: link:https://alchemists.io/articles/git_commit_anatomy[Git Commit Anatomy]
|
12
13
|
:git_link: link:https://git-scm.com[Git]
|
13
14
|
:git_lint_link: link:https://alchemists.io/projects/git-lint[Git Lint]
|
14
|
-
:git_trailers_link: link:https://alchemists.io/articles/git_trailers[Git Trailers]
|
15
15
|
:git_notes_link: link:https://alchemists.io/articles/git_notes[Git Notes]
|
16
|
+
:git_trailers_link: link:https://alchemists.io/articles/git_trailers[Git Trailers]
|
16
17
|
:hanami_link: link:https://hanamirb.org[Hanami]
|
17
18
|
:hanami_views_link: link:https://alchemists.io/articles/hanami_views[Hanami Views]
|
18
19
|
:hanamismith_link: link:https://alchemists.io/projects/hanamismith[Hanamismith]
|
@@ -21,12 +22,15 @@
|
|
21
22
|
:markdown_link: link:https://daringfireball.net/projects/markdown[Markdown]
|
22
23
|
:marked_link: link:https://marked2app.com[Marked 2]
|
23
24
|
:net_news_wire_link: link:https://netnewswire.com[NetNewsWire]
|
25
|
+
:redcarpet_link: link:https://github.com/vmg/redcarpet[Redcarpet]
|
26
|
+
:rouge_link: link:https://rouge.jneen.net[Rouge]
|
24
27
|
:ruby_link: link:https://www.ruby-lang.org[Ruby]
|
25
28
|
:rubygems_link: link:https://rubygems.org[RubyGems]
|
26
29
|
:rubysmith_link: link:https://alchemists.io/projects/rubysmith[Rubysmith]
|
27
30
|
:runcom_link: link:https://alchemists.io/projects/runcom[Runcom]
|
31
|
+
:sanitize_link: link:https://github.com/rgrove/sanitize[Sanitize]
|
28
32
|
:strict_semantic_versioning_link: link:https://alchemists.io/articles/strict_semantic_versioning[Strict Semantic Versioning]
|
29
|
-
:string_formats_link: link:https://ruby-
|
33
|
+
:string_formats_link: link:https://docs.ruby-lang.org/en/master/format_specifications_rdoc.html[String Formats]
|
30
34
|
:syndication_link: link:https://alchemists.io/articles/syndication[Syndication]
|
31
35
|
:versionaire_link: link:https://alchemists.io/projects/versionaire[Versionaire]
|
32
36
|
:xdg_link: link:https://alchemists.io/projects/xdg[XDG]
|
@@ -50,43 +54,43 @@ toc::[]
|
|
50
54
|
|
51
55
|
The following are screenshots of using this gem to render release notes for the {lode_link} gem. Even though {lode_link} is used for example purposes, keep in mind that Milestoner can be used for _any project and/or programming language_.
|
52
56
|
|
53
|
-
=== ASCII Doc
|
57
|
+
=== ASCII Doc
|
54
58
|
|
55
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc-collapsed.png[Release Notes,width=
|
59
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc-collapsed.png[Release Notes,width=1160,height=831,role=focal_point]
|
56
60
|
|
57
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc-expanded.png[Release Notes,width=
|
61
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc-expanded.png[Release Notes,width=1160,height=1335,role=focal_point]
|
58
62
|
|
59
63
|
* *Command*: `milestoner build --format ascii_doc`
|
60
64
|
* *Renderer*: {ascii_doc_link}
|
61
65
|
|
62
|
-
=== Feed
|
66
|
+
=== Feed
|
63
67
|
|
64
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/build-feed-collapsed.png[Release Notes,width=
|
68
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/build-feed-collapsed.png[Release Notes,width=1275,height=954,role=focal_point]
|
65
69
|
|
66
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/build-feed-expanded.png[Release Notes,width=
|
70
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/build-feed-expanded.png[Release Notes,width=1275,height=1613,role=focal_point]
|
67
71
|
|
68
72
|
* *Command*: `milestoner build --format feed`
|
69
73
|
* *Renderer*: {net_news_wire_link}
|
70
74
|
|
71
75
|
=== Markdown Format
|
72
76
|
|
73
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/build-markdown.png[Release Notes,width=
|
77
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/build-markdown.png[Release Notes,width=796,height=703,role=focal_point]
|
74
78
|
|
75
79
|
* *Command*: `milestoner build --format markdown`
|
76
80
|
* *Renderer*: {marked_link}
|
77
81
|
|
78
|
-
=== Stream
|
82
|
+
=== Stream
|
79
83
|
|
80
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/build-stream.png[Release Notes,width=
|
84
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/build-stream.png[Release Notes,width=566,height=320,role=focal_point]
|
81
85
|
|
82
86
|
* *Command*: `milestoner build --format stream`
|
83
87
|
* *Renderer*: {iterm_link}
|
84
88
|
|
85
|
-
=== Web
|
89
|
+
=== Web
|
86
90
|
|
87
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-collapsed.png[Release Notes,width=
|
91
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-collapsed.png[Release Notes,width=1296,height=647,role=focal_point]
|
88
92
|
|
89
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-expanded.png[Release Notes,width=
|
93
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-expanded.png[Release Notes,width=1296,height=1032,role=focal_point]
|
90
94
|
|
91
95
|
* *Command*: `milestoner build --format web`
|
92
96
|
* *Renderer*: {firefox_link}
|
@@ -107,12 +111,12 @@ image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-exp
|
|
107
111
|
* Provides automatic versioning based on last {git_link} tag and {git_trailers_link}. See {git_commit_anatomy_link} for details.
|
108
112
|
* Supports multiple build formats:
|
109
113
|
** {ascii_doc_link}
|
110
|
-
** {syndication_link}
|
114
|
+
** {syndication_link} (feed)
|
111
115
|
** {markdown_link}
|
112
116
|
** Stream (console)
|
113
|
-
** link:https://html.spec.whatwg.org/multipage[Web]
|
117
|
+
** link:https://html.spec.whatwg.org/multipage[Web] (HTML)
|
114
118
|
* Supports {git_notes_link}.
|
115
|
-
* Supports customization via your personal {xdg_link} and {hanami_views_link} configuration.
|
119
|
+
* Supports customization via your personal {xdg_link}, {runcom_link}, and/or {hanami_views_link} configuration.
|
116
120
|
|
117
121
|
== Requirements
|
118
122
|
|
@@ -273,7 +277,7 @@ The above can be customized as follows:
|
|
273
277
|
*** `mime`: Required. The mime type. Defaults to HTML and XML.
|
274
278
|
*** `relation`: Required. Identifies the relation of the link which can either be `self` (i.e. XML) or `alternate` (i.e. HTML).
|
275
279
|
*** `uri`: Required. The link URI to follow for more information. Defaults to dynamic string formatting based on existing configuration values.
|
276
|
-
* `tracker`: Required.
|
280
|
+
* `tracker`: Required. Manages issue tracker details.
|
277
281
|
** `uri`: Required. The URI format for linking to issues as formatted using {string_formats_link}. Default: GitHub. The `id` is dynamically calculated via the commit `Issue` trailer as linted by {git_lint_link}. When no ID can be found, this will default to _All_ issues.
|
278
282
|
|
279
283
|
As hinted at above, all URIs (including syndication), support {string_formats_link}. This means you can use the `%<key>s` format -- replacing `key` with the key of your choice -- to customize your configuration further.
|
@@ -292,39 +296,43 @@ image:https://alchemists.io/images/projects/milestoner/screenshots/usage-cache.p
|
|
292
296
|
|
293
297
|
Milestoner's cache allows you to enrich user information (i.e. authors, collaborators, etc) by storing information in a `PStore` database as managed by the {lode_link} gem. Cache location, as with the Config, is managed by the {runcom_link} gem.
|
294
298
|
|
295
|
-
User information should be sourced from whatever service
|
299
|
+
User information should be sourced from whatever service used for managing your source code. For example, when using GitHub, your workflow might look like this:
|
296
300
|
|
297
301
|
[source,bash]
|
298
302
|
----
|
299
303
|
milestoner cache --list
|
300
|
-
# 🟢 Listing users...
|
301
|
-
# 🟢 No users found.
|
304
|
+
# 🟢 [milestoner] Listing users...
|
305
|
+
# 🟢 [milestoner] No users found.
|
302
306
|
|
303
307
|
milestoner cache --create "111,jsmith,Jane Smith"
|
304
|
-
# 🟢 Created: "Jane Smith"
|
308
|
+
# 🟢 [milestoner] Created: "Jane Smith"
|
305
309
|
|
306
310
|
milestoner cache --create "222,jdoe,John Doe"
|
307
|
-
# 🟢 Created: "John Doe"
|
311
|
+
# 🟢 [milestoner] Created: "John Doe"
|
308
312
|
|
309
313
|
milestoner cache --create "333,jgrey,Jill Grey"
|
310
|
-
# 🟢 Created: "Jill Grey"
|
314
|
+
# 🟢 [milestoner] Created: "Jill Grey"
|
311
315
|
|
312
316
|
milestoner cache --list
|
313
|
-
# 🟢 Listing users...
|
314
|
-
#
|
315
|
-
#
|
316
|
-
#
|
317
|
+
# 🟢 [milestoner] Listing users...
|
318
|
+
# External ID, Handle, Name
|
319
|
+
# -------------------------
|
320
|
+
# "111", "jsmith", "Jane Smith"
|
321
|
+
# "222", "jdoe", "John Doe"
|
322
|
+
# "333", "jgrey", "Jill Grey"
|
317
323
|
|
318
324
|
milestoner cache --delete "Jill Grey"
|
319
|
-
🟢 Deleted: "Jill Grey".
|
325
|
+
# 🟢 [milestoner] Deleted: "Jill Grey".
|
320
326
|
|
321
327
|
milestoner cache --list
|
322
|
-
# 🟢 Listing users...
|
323
|
-
#
|
324
|
-
#
|
328
|
+
# 🟢 [milestoner] Listing users...
|
329
|
+
# External ID, Handle, Name
|
330
|
+
# -------------------------
|
331
|
+
# "111", "jsmith", "Jane Smith"
|
332
|
+
# "222", "jdoe", "John Doe"
|
325
333
|
|
326
334
|
milestoner cache --info
|
327
|
-
# 🟢 Path: /Users/
|
335
|
+
# 🟢 [milestoner] Path: /Users/bkuhlmann/.cache/milestoner/database.store.
|
328
336
|
----
|
329
337
|
|
330
338
|
💡 Use `+https://api.github.com/users/<handle>+` to acquire the external ID for any GitHub user.
|
@@ -333,7 +341,7 @@ Once team member information is stored in your cache, you'll be able to build re
|
|
333
341
|
|
334
342
|
If you don't use the cache, your release notes use a question mark (?) and _unknown_ for team members as highlighted below:
|
335
343
|
|
336
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/no_cache.png[Usage,width=
|
344
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/no_cache.png[Usage,width=916,height=397,role=focal_point]
|
337
345
|
|
338
346
|
=== Build
|
339
347
|
|
@@ -344,8 +352,9 @@ The build command allows you to quickly build release notes to check the current
|
|
344
352
|
[source,bash]
|
345
353
|
----
|
346
354
|
milestoner build --format web
|
347
|
-
# 🟢 Building
|
348
|
-
# 🟢
|
355
|
+
# 🟢 [milestoner] Building Milestoner (web)...
|
356
|
+
# 🟢 [milestoner] Built: /Users/bkuhlmann/Engineering/OSS/milestoner/tmp/milestones/page.css.
|
357
|
+
# 🟢 [milestoner] Built: /Users/bkuhlmann/Engineering/OSS/milestoner/tmp/milestones/index.html.
|
349
358
|
----
|
350
359
|
|
351
360
|
The above command is so useful that I use the following `msw` (i.e. Milestoner Web) Bash alias to build current release notes or release notes for several tags:
|
@@ -357,22 +366,115 @@ The above command is so useful that I use the following `msw` (i.e. Milestoner W
|
|
357
366
|
# Parameters: $1 (optional): Maximum tags to build. Default: 1.
|
358
367
|
msw() {
|
359
368
|
local max=${1:-1}
|
369
|
+
local root="tmp/milestones"
|
370
|
+
local path="$root/index.html"
|
360
371
|
|
361
372
|
rm -rf tmp/milestones
|
362
373
|
|
363
374
|
if [[ "$max" == 1 ]]; then
|
364
|
-
milestoner build --max "$max" --format web
|
375
|
+
milestoner build --max "$max" --format web
|
376
|
+
|
377
|
+
if [[ -f "$path" ]]; then
|
378
|
+
open "$path"
|
379
|
+
fi
|
365
380
|
else
|
366
381
|
milestoner build --max "$max" --stylesheet "../page" --format web
|
367
|
-
|
368
|
-
|
369
|
-
|
382
|
+
|
383
|
+
if [[ -d "$root" ]]; then
|
384
|
+
ruby -run -e httpd "tmp/milestones" --port 3030 &
|
385
|
+
open "http://localhost:3030"
|
386
|
+
fg
|
387
|
+
fi
|
370
388
|
fi
|
371
389
|
}
|
372
390
|
----
|
373
391
|
|
374
392
|
Check out the help documentation (i.e. `milestoner build --help`) for addition usage that explains what command line options you can use to overwrite the current configuration.
|
375
393
|
|
394
|
+
==== Commits
|
395
|
+
|
396
|
+
By default, all {git_link} commit messages support {ascii_doc_link} syntax but you can use {markdown_link} too.
|
397
|
+
|
398
|
+
{ascii_doc_link} is rendered using the {ascii_doctor_link} gem while {markdown_link} is rendered using the {redcarpet_link} gem. Regardless of what renderer you choose, each supports syntax highlighting via the {rouge_link} gem. This also means you can customize the {rouge_link} styles via the `page.css` template as documented in the xref:_templates[Templates] section below.
|
399
|
+
|
400
|
+
ℹ️ The {rouge_link} CSS classes are slightly cryptic in terms of readability but you can see how they are applied when inspecting the HTML DOM.
|
401
|
+
|
402
|
+
Here's a couple examples of commit messages using {ascii_doc_link} and {markdown_link} syntax:
|
403
|
+
|
404
|
+
*ASCII Doc*
|
405
|
+
|
406
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/syntax-ascii_doc.png[ASCII Doc,width=950,height=763,role=focal_point]
|
407
|
+
|
408
|
+
*Markdown*
|
409
|
+
|
410
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/syntax-markdown.png[Markdown,width=933,height=921,role=focal_point]
|
411
|
+
|
412
|
+
💡 To see an example of what this renders to HTML as, see the xref:_formats[Formats] section below.
|
413
|
+
|
414
|
+
==== Sanitization
|
415
|
+
|
416
|
+
Sanitization of commit messages is handled by the {sanitize_link} gem. This means you can only use a limited set of HTML elements (this includes {ascii_doc_link} and {markdown_link} rendering). Here's what's allowed:
|
417
|
+
|
418
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b[b]
|
419
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em[em]
|
420
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i[i]
|
421
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong[strong]
|
422
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/u[u]
|
423
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a[a]
|
424
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr[abbr]
|
425
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote[blockquote]
|
426
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br[br]
|
427
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/cite[cite]
|
428
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code[code]
|
429
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dd[dd]
|
430
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dfn[dfn]
|
431
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl[dl]
|
432
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt[dt]
|
433
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd[kbd]
|
434
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li[li]
|
435
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark[mark]
|
436
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol[ol]
|
437
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p[p]
|
438
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre[pre]
|
439
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/q[q]
|
440
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s[s]
|
441
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/samp[samp]
|
442
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/small[small]
|
443
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strike[strike]
|
444
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub[sub]
|
445
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup[sup]
|
446
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time[time]
|
447
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul[ul]
|
448
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/var[var]
|
449
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio[audio]
|
450
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details[details]
|
451
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img[img]
|
452
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source[source]
|
453
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span[span]
|
454
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary[summary]
|
455
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video[video]
|
456
|
+
|
457
|
+
The following global attributes are allowed for all elements:
|
458
|
+
|
459
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id[id]
|
460
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class[class]
|
461
|
+
|
462
|
+
The following attributes are limited to only a few elements like `a`, `abbr`, and `dfn` for the most part.
|
463
|
+
|
464
|
+
* link:https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title[title]
|
465
|
+
|
466
|
+
An additional set of attributes are allowed but are specific to each element and fairly limited. Ultimately, if you don't see an attribute being rendered then it's not allowed.
|
467
|
+
|
468
|
+
==== Trailers
|
469
|
+
|
470
|
+
Multiple {git_trailers_link} for your commits are supported which are detailed in the linked article. At a minimum, the `Milestone` trailer is highly recommended since this is how Milestoner handles xref:_automatic_versioning[Automatic Versioning] for you.
|
471
|
+
|
472
|
+
One of the more powerful features of using {git_trailers_link} in your commit messages is they give you the ability to fully resolve what is defined in your default global xref:_customization[configuration]. Here's a more detailed breakdown:
|
473
|
+
|
474
|
+
* *Format* (optional): Use `ascii_doc` or `markdown` for the value to control what syntax used to render your commit message. The default is `ascii_doc` but if your configuration uses a different default you can override that per commit message if desired.
|
475
|
+
* *Issue* (optional): When supplied, Milestoner will automatically associate your commit with the corresponding issue ID you provide as a value. This works in conjunction with your xref:_customization[configuration].
|
476
|
+
* *Milestone* (optional): This is detailed in the xref:_automatic_versioning[Automatic Versioning] section below.
|
477
|
+
|
376
478
|
==== Automatic Versioning
|
377
479
|
|
378
480
|
As mentioned earlier, the calculation of version information happens automatically based on your last {git_link} tag and any {git_link} commit trailer metadata used. If none of this information is present, then the default version of `0.0.0` is used instead. All of this information is available to you via the following command:
|
@@ -436,7 +538,7 @@ Given the above, the resulting version would be: 2.0.0. This is because the high
|
|
436
538
|
|
437
539
|
==== Templates
|
438
540
|
|
439
|
-
|
541
|
+
Template functionality is powered by {hanami_views_link} which means you can completely customize _all_ build formats, templates, partials, stylesheets, images, and much more.
|
440
542
|
The quickest way to start customization is to copy the `templates` folder structure -- included with this gem -- to your preferred {runcom_link} configuration (i.e. global or local). For example, this gem's template structure is:
|
441
543
|
|
442
544
|
....
|
@@ -457,19 +559,34 @@ lib/milestoner/templates
|
|
457
559
|
│ ├── _commit.md.erb
|
458
560
|
│ ├── _commit.stream.erb
|
459
561
|
│ ├── _commit.xml.erb
|
460
|
-
│ ├──
|
461
|
-
│ ├──
|
462
|
-
│ ├──
|
463
|
-
│ ├──
|
562
|
+
│ ├── _content.adoc.erb
|
563
|
+
│ ├── _content.html.erb
|
564
|
+
│ ├── _content.xml.erb
|
565
|
+
│ ├── _logo.adoc.erb
|
566
|
+
│ ├── _logo.html.erb
|
567
|
+
│ ├── _logo.md.erb
|
568
|
+
│ ├── _logo.xml.erb
|
569
|
+
│ ├── _none.adoc.erb
|
570
|
+
│ ├── _none.html.erb
|
571
|
+
│ ├── _none.xml.erb
|
464
572
|
│ ├── _profile.adoc.erb
|
465
573
|
│ ├── _profile.html.erb
|
466
574
|
│ ├── _profile.md.erb
|
467
575
|
│ ├── _profile.xml.erb
|
576
|
+
│ ├── _tag-insecure.html.erb
|
577
|
+
│ ├── _tag-secure.html.erb
|
468
578
|
│ ├── _tag.adoc.erb
|
469
579
|
│ ├── _tag.html.erb
|
470
580
|
│ ├── _tag.md.erb
|
471
581
|
│ ├── _tag.stream.erb
|
472
582
|
│ ├── _tag.xml.erb
|
583
|
+
│ ├── _user.adoc.erb
|
584
|
+
│ ├── _user.html.erb
|
585
|
+
│ ├── _user.md.erb
|
586
|
+
│ ├── _user.xml.erb
|
587
|
+
│ ├── _users.adoc.erb
|
588
|
+
│ ├── _users.html.erb
|
589
|
+
│ ├── _users.xml.erb
|
473
590
|
│ ├── show.adoc.erb
|
474
591
|
│ ├── show.html.erb
|
475
592
|
│ ├── show.md.erb
|
@@ -492,25 +609,29 @@ Milestoner searches your {runcom_link} configuration first and, if templates are
|
|
492
609
|
|
493
610
|
Of all build formats supported, the web format is the most powerful and feature rich. The following showcases _some_ of the information rendered in this format based on commit activity.
|
494
611
|
|
495
|
-
*
|
612
|
+
*Overview*
|
496
613
|
|
497
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-overview.png[
|
614
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-overview.png[ASCII Doc,width=1157,height=843,role=focal_point]
|
498
615
|
|
499
|
-
*With
|
616
|
+
*With Valid Commit Signature*
|
500
617
|
|
501
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-
|
618
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-commit_valid.png[ASCII Doc,width=1235,height=950,role=focal_point]
|
502
619
|
|
503
|
-
*With Invalid
|
620
|
+
*With Invalid Commit Signature*
|
504
621
|
|
505
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-
|
622
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-commit_invalid.png[ASCII Doc,width=1235,height=950,role=focal_point]
|
506
623
|
|
507
624
|
*With Valid Tag*
|
508
625
|
|
509
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-tag_valid.png[
|
626
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-tag_valid.png[ASCII Doc,width=1089,height=1084,role=focal_point]
|
627
|
+
|
628
|
+
*With Invalid Tag*
|
629
|
+
|
630
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-tag_invalid.png[ASCII Doc,width=978,height=571,role=focal_point]
|
510
631
|
|
511
|
-
*With
|
632
|
+
*With ASCII Doc/Markdown*
|
512
633
|
|
513
|
-
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-
|
634
|
+
image:https://alchemists.io/images/projects/milestoner/screenshots/web_format-ascii_doc.png[ASCII Doc,width=908,height=1938,role=focal_point]
|
514
635
|
|
515
636
|
💡 See {git_notes_link} to learn more.
|
516
637
|
|
@@ -17,9 +17,6 @@ module Milestoner
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def call
|
20
|
-
settings.build_root.make_path
|
21
|
-
copy_stylesheet
|
22
|
-
|
23
20
|
tagger.call
|
24
21
|
.fmap { |tags| build tags }
|
25
22
|
.alt_map { |message| failure message }
|
@@ -30,10 +27,14 @@ module Milestoner
|
|
30
27
|
attr_reader :tagger, :view
|
31
28
|
|
32
29
|
def build tags
|
30
|
+
make_root
|
31
|
+
copy_stylesheet
|
33
32
|
tags.each { |tag| write tag }
|
34
33
|
settings.build_root
|
35
34
|
end
|
36
35
|
|
36
|
+
def make_root = settings.build_root.make_path
|
37
|
+
|
37
38
|
def copy_stylesheet
|
38
39
|
return unless settings.build_stylesheet
|
39
40
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "core"
|
3
4
|
require "sod"
|
4
5
|
|
5
6
|
module Milestoner
|
@@ -17,17 +18,22 @@ module Milestoner
|
|
17
18
|
on %w[-c --create], argument: "external_id,handle,name"
|
18
19
|
|
19
20
|
def call values
|
20
|
-
|
21
|
+
case values.split ","
|
22
|
+
in String => external_id, String => handle, String => name
|
23
|
+
client.write(:users) { upsert({external_id:, handle:, name:}) }
|
24
|
+
.bind { |user| log_info "Created: #{user.name.inspect}" }
|
25
|
+
in String, String then log_error "Name must be supplied."
|
26
|
+
in [String] then log_error "Handle and Name must be supplied."
|
27
|
+
in Core::EMPTY_ARRAY then log_error "No values given."
|
28
|
+
else log_error "Too many values given."
|
29
|
+
end
|
21
30
|
end
|
22
31
|
|
23
32
|
private
|
24
33
|
|
25
|
-
def process values
|
26
|
-
external_id, handle, name = values.split ","
|
27
|
-
client.write(:users) { upsert({external_id:, handle:, name:}) }
|
28
|
-
end
|
29
|
-
|
30
34
|
def log_info(message) = logger.info { message }
|
35
|
+
|
36
|
+
def log_error(message) = logger.error { message }
|
31
37
|
end
|
32
38
|
end
|
33
39
|
end
|
@@ -24,7 +24,15 @@ module Milestoner
|
|
24
24
|
def print users
|
25
25
|
return logger.info { "No users found." } if users.empty?
|
26
26
|
|
27
|
-
|
27
|
+
header
|
28
|
+
users.each { |user| io.puts user.to_h.values.map(&:inspect).join ", " }
|
29
|
+
end
|
30
|
+
|
31
|
+
def header
|
32
|
+
header = "External ID, Handle, Name"
|
33
|
+
|
34
|
+
io.puts header
|
35
|
+
io.puts "-" * header.size
|
28
36
|
end
|
29
37
|
end
|
30
38
|
end
|
@@ -24,15 +24,17 @@ module Milestoner
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def call
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
collect.fmap { |tags| tail tags.last(settings.build_max).map(&:version) }
|
28
|
+
.fmap { |references| slice(references).reverse }
|
29
|
+
.bind { |tags| tags.empty? ? Failure("No tags or commits.") : Success(tags) }
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
33
33
|
|
34
34
|
attr_reader :enricher, :model
|
35
35
|
|
36
|
+
def collect = git.tagged? ? git.tags("--sort=taggerdate") : placeholder_with_commits
|
37
|
+
|
36
38
|
def tail references
|
37
39
|
references.append "HEAD" if settings.build_tail == "head"
|
38
40
|
references
|
@@ -68,6 +70,21 @@ module Milestoner
|
|
68
70
|
]
|
69
71
|
end
|
70
72
|
|
73
|
+
def placeholder_with_commits = enricher.call.fmap { |commits| placeholder_for commits }
|
74
|
+
|
75
|
+
def placeholder_for commits
|
76
|
+
return commits if commits.empty?
|
77
|
+
|
78
|
+
[
|
79
|
+
model[
|
80
|
+
author: commits.last.author,
|
81
|
+
commits:,
|
82
|
+
committed_at: Time.now,
|
83
|
+
version: settings.project_version
|
84
|
+
]
|
85
|
+
]
|
86
|
+
end
|
87
|
+
|
71
88
|
def author tag
|
72
89
|
author_enricher.call tag.with(author_name: tag.author_name || settings.project_author)
|
73
90
|
end
|
@@ -6,15 +6,24 @@ module Milestoner
|
|
6
6
|
module Renderers
|
7
7
|
# Renders ASCII Doc as HTML.
|
8
8
|
class Asciidoc
|
9
|
-
|
9
|
+
SETTINGS = {
|
10
|
+
safe: :safe,
|
11
|
+
attributes: {
|
12
|
+
"source-highlighter" => "rouge",
|
13
|
+
"rouge-linenums-mode" => "inline"
|
14
|
+
}
|
15
|
+
}.freeze
|
16
|
+
|
17
|
+
def initialize settings: SETTINGS, client: Asciidoctor
|
18
|
+
@settings = settings
|
10
19
|
@client = client
|
11
20
|
end
|
12
21
|
|
13
|
-
def call(content) = client.convert content
|
22
|
+
def call(content) = client.convert content, settings
|
14
23
|
|
15
24
|
private
|
16
25
|
|
17
|
-
attr_reader :client
|
26
|
+
attr_reader :settings, :client
|
18
27
|
end
|
19
28
|
end
|
20
29
|
end
|
@@ -1,12 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "redcarpet"
|
4
|
+
require "rouge"
|
5
|
+
require "rouge/plugins/redcarpet"
|
4
6
|
|
5
7
|
module Milestoner
|
6
8
|
module Renderers
|
7
9
|
# Renders Markdown as HTML.
|
8
10
|
class Markdown
|
9
|
-
|
11
|
+
CLIENT = Redcarpet::Markdown.new Class.new(Redcarpet::Render::HTML)
|
12
|
+
.include(Rouge::Plugins::Redcarpet)
|
13
|
+
.set_temporary_name("redcarpet_html_rouge")
|
14
|
+
.new,
|
15
|
+
disable_indented_code_blocks: true,
|
16
|
+
fenced_code_blocks: true,
|
17
|
+
footnotes: true,
|
18
|
+
highlight: true,
|
19
|
+
superscript: true,
|
20
|
+
tables: true
|
21
|
+
|
22
|
+
def initialize client: CLIENT
|
10
23
|
@client = client
|
11
24
|
end
|
12
25
|
|
data/lib/milestoner/sanitizer.rb
CHANGED
@@ -19,13 +19,22 @@ module Milestoner
|
|
19
19
|
|
20
20
|
attr_reader :defaults, :client
|
21
21
|
|
22
|
-
def configuration
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
def configuration = client::Config.merge(defaults, elements:, attributes:)
|
23
|
+
|
24
|
+
def elements
|
25
|
+
defaults[:elements].including "audio", "details", "img", "source", "span", "summary", "video"
|
26
|
+
end
|
27
|
+
|
28
|
+
def attributes
|
29
|
+
defaults[:attributes].merge(
|
30
|
+
all: %w[class id],
|
31
|
+
"a" => %w[href title],
|
32
|
+
"audio" => %w[autoplay controls controlslist crossorigin loop muted preload src],
|
33
|
+
"details" => %w[name open],
|
34
|
+
"img" => %w[alt height loading src width],
|
35
|
+
"source" => %w[type src srcset sizes media height width],
|
36
|
+
"video" => %w[controls height poster src width]
|
37
|
+
)
|
29
38
|
end
|
30
39
|
end
|
31
40
|
end
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
image:<%= user.avatar_url %>[<%= user.image_alt %>,24,24]
|