-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asciidoctor: Copy callout icons #570
Conversation
Adds support for copying callout icons into the directory containing the built documents. Without this callout icons all 404 which is sad because they are pretty.
I've made an effort not to conflict with #565 but a little conflict is impossible to avoid I think. |
This one'll need master merged into it and a few paths fixed up before merging. |
@@ -92,7 +95,8 @@ sub build_chunked { | |||
# missing attributes! | |||
# '-a' => 'attribute-missing=warn', | |||
'-a' => 'asciidoc-dir=' . $asciidoc_dir, | |||
$resources ? ( '-a' => 'resources=' . join(',', @$resources)) : (), | |||
'-a' => 'resources=' . join(',', @$resources), | |||
'-a' => 'copy-callout-images=png', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean they'll always and forever have to be png? That may be totally fine, I just am asking to be sure that it is known and definitely totally fine :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are current png
s. We could change it here to whatever we have images for though.
@@ -107,7 +111,7 @@ sub build_chunked { | |||
file('resources/website_chunked.xsl')->absolute, | |||
"$dest/index.xml" | |||
); | |||
unlink "$dest/index.xml"; | |||
# unlink "$dest/index.xml"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out code left behind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
copy_image block, uri | ||
else | ||
extension = block.attr 'copy-callout-images' | ||
if block.parent && block.parent.context == :colist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be an elsif
on line 24 right? There's no other in-scope usage of extension
anyway here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! This is what that empty test block was about! It looks like I never finished it. sorry!
@@ -201,4 +201,130 @@ def copy_attributes copied | |||
expect(copied).to eq([]) | |||
} | |||
end | |||
|
|||
it "copies a images for callouts when requested (png)" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "copies a images"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
]) | ||
end | ||
|
||
it "copies a images for callouts when requested (gif)" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "copies a images"
]) | ||
end | ||
|
||
it "has a nice error message when a callout image is missing" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ ❤️ ❤️
]) | ||
end | ||
|
||
it "doesn't copy callout images if the extension isn't set" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty test body
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this! I never finished it. I'll get it soon!
@ddillinger I pushed a few patches to finish this off. Thanks again for catching it! |
Thanks @ddillinger! |
Adds support for copying callout icons into the directory containing the built documents. Without this callout icons all 404 which is sad because they are pretty.
Adds support for copying callout icons into the directory containing the
built documents. Without this callout icons all 404 which is sad because
they are pretty.