doc/shared/lib/git-macro.rb
Sergio Carlavilla Delgado fb36cfdfb2 Add gitref macro to reference a git hash
With this extension a git hash can be easily referenced.

The porters handbook versions chapter uses this extension
as an example in the FreeBSD 14.0 version table.

An example of use

gitref:hash[repository="src|doc|ports",length=hash-longitude]

The repository should be src, doc or ports.
And if no length it's specified the macro will use 12 characters
of the specified hash.

PR:             253050
Submitted by:   jhb@
2021-02-13 22:22:34 +01:00

5 lines
195 B
Ruby

RUBY_ENGINE == 'opal' ? (require 'GitReferencesMacro/extension') : (require_relative 'GitReferencesMacro/extension')
Asciidoctor::Extensions.register do
inline_macro GitReferencesMacro
end