mirror of
https://github.com/foo-dogsquared/asciidoctor-foodogsquared-extensions.git
synced 2025-02-07 06:19:01 +00:00
Allow git-blob-include-processor to discover other repos
Massive oversight over here which I forgot to update when moving it in its own repo. Whoops.
This commit is contained in:
parent
5ec7195fc8
commit
5ebea76900
@ -23,6 +23,9 @@ If the resulting operation ends in an error (i.e., non-existing revision, file,
|
|||||||
|
|
||||||
== Attributes
|
== Attributes
|
||||||
|
|
||||||
|
- `gitrepo` is the path to the Git repo.
|
||||||
|
By default, it is the base directory of the document.
|
||||||
|
|
||||||
- `path` is the filepath to be retrieved from the revision.
|
- `path` is the filepath to be retrieved from the revision.
|
||||||
When used with `diff`, it changes into a semicolon-delimited (`;`) list of files to make diffs with multiple files.
|
When used with `diff`, it changes into a semicolon-delimited (`;`) list of files to make diffs with multiple files.
|
||||||
|
|
||||||
|
@ -8,7 +8,8 @@ class GitBlobIncludeProcessor < Asciidoctor::Extensions::IncludeProcessor
|
|||||||
end
|
end
|
||||||
|
|
||||||
def process(doc, reader, target, attrs)
|
def process(doc, reader, target, attrs)
|
||||||
repo = Rugged::Repository.discover(__dir__)
|
attrs['gitrepo'] ||= doc.base_dir
|
||||||
|
repo = Rugged::Repository.discover(attrs['gitrepo'])
|
||||||
|
|
||||||
git_object_ref = target.delete_prefix 'git:'
|
git_object_ref = target.delete_prefix 'git:'
|
||||||
git_object_ref = doc.attributes['doccontentref'] if git_object_ref.empty?
|
git_object_ref = doc.attributes['doccontentref'] if git_object_ref.empty?
|
||||||
|
Loading…
Reference in New Issue
Block a user