git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob f7a5982f8b7e624a880c127aab97e6f9ed28a7f2 798 bytes (raw)
name: Documentation/asciidoctor-extensions.rb 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
require 'asciidoctor'
require 'asciidoctor/extensions'

module Git
  module Documentation
    class LinkGitProcessor < Asciidoctor::Extensions::InlineMacroProcessor
      use_dsl

      named :chrome

      def process(parent, target, attrs)
        if parent.document.basebackend? 'html'
          prefix = parent.document.attr('git-relative-html-prefix')
          %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>\n)
        elsif parent.document.basebackend? 'docbook'
          "<citerefentry>\n" \
            "<refentrytitle>#{target}</refentrytitle>" \
            "<manvolnum>#{attrs[1]}</manvolnum>\n" \
          "</citerefentry>"
        end
      end
    end
  end
end

Asciidoctor::Extensions.register do
  inline_macro Git::Documentation::LinkGitProcessor, :linkgit
end

debug log:

solving f7a5982f8b ...
found f7a5982f8b in https://public-inbox.org/git/41d9ea21c37a634b2310b5b2f68935bcd612665c.1551123979.git.martin.agren@gmail.com/ ||
	https://public-inbox.org/git/e1021ad4a97a78e7428fcdfbf2af7196a0c8d340.1551290936.git.martin.agren@gmail.com/
found ec83b4959e in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100644 ec83b4959eb4d8b278ca6e769cbbaca0cba7cb06	Documentation/asciidoctor-extensions.rb

applying [1/1] https://public-inbox.org/git/41d9ea21c37a634b2310b5b2f68935bcd612665c.1551123979.git.martin.agren@gmail.com/
diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb
index ec83b4959e..f7a5982f8b 100644

Checking patch Documentation/asciidoctor-extensions.rb...
Applied patch Documentation/asciidoctor-extensions.rb cleanly.

skipping https://public-inbox.org/git/e1021ad4a97a78e7428fcdfbf2af7196a0c8d340.1551290936.git.martin.agren@gmail.com/ for f7a5982f8b
index at:
100644 f7a5982f8b7e624a880c127aab97e6f9ed28a7f2	Documentation/asciidoctor-extensions.rb

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).