This causes cgit to serve error pages, which is undesirable. This reverts commit5229c9b232, reversing changes made tof2b211131f.
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			796 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			796 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
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>)
 | 
						|
        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
 |