Skip to content

Commit

Permalink
Update execution result style in example code (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 authored May 19, 2024
1 parent 52a7579 commit d907f37
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 64 deletions.
26 changes: 13 additions & 13 deletions draw.html
Original file line number Diff line number Diff line change
Expand Up @@ -816,14 +816,14 @@ <h4>Description</h4>
<h4>Example</h4>

<pre class="language-ruby">
draw.inspect &raquo;
"stroke red
fill transparent
rectangle 20,20 380,180
line 200,20 200,180
line 20,100 380,100
stroke transparent
fill black"
draw.inspect
#=&gt; "stroke red
# fill transparent
# rectangle 20,20 380,180
# line 200,20 200,180
# line 20,100 380,100
# stroke transparent
# fill black"
</pre
>
</div>
Expand Down Expand Up @@ -2700,12 +2700,12 @@ <h4>Returns</h4>

<h4>Quoting examples</h4>

<p>The text to the right of &raquo; is the text that will be drawn.</p>
<p>The text to the right of #=&gt; is the text that will be drawn.</p>
<pre class="language-ruby">
gc.text(10,10, '"Hello there!"') &raquo; Hello there!
gc.text(10,10, "'What\'s up?'") &raquo; What's up?
gc.text(10,10, %q/"What's up?"/) &raquo; What's up?
gc.text(10,10, %q/{"What's up?"}/) &raquo; "What's up?"
gc.text(10,10, '"Hello there!"') #=&gt; Hello there!
gc.text(10,10, "'What\'s up?'") #=&gt; What's up?
gc.text(10,10, %q/"What's up?"/) #=&gt; What's up?
gc.text(10,10, %q/{"What's up?"}/) #=&gt; "What's up?"
</pre
>

Expand Down
28 changes: 15 additions & 13 deletions ilist.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ <h4>Example</h4>

<pre class="language-ruby">
i = Magick::ImageList.new("images/Button_A.gif", "images/Button_B.gif")
i.length &raquo; 2
i.length #=&gt; 2
</pre
>
</div>
Expand All @@ -271,7 +271,7 @@ <h4>Example</h4>

<pre class="language-ruby">
ilist.scene = 10
ilist.scene &raquo; 10
ilist.scene #=&gt; 10
</pre
>
</div>
Expand Down Expand Up @@ -1015,9 +1015,9 @@ <h4>Example</h4>

<pre class="language-ruby">
i = Magick::ImageList.new("images/Button_A.gif", "images/Button_B.gif")
&raquo; [images/Button_A.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 18136b
images/Button_B.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 5157b]
scene=1
#=&gt; [images/Button_A.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 18136b
# images/Button_B.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 5157b]
# scene=1
</pre
>

Expand Down Expand Up @@ -1533,8 +1533,8 @@ <h4>Example</h4>
<pre class="language-ruby">
ilist = Magick::ImageList.new
ilist.ping "Button_A.gif"
puts "The image has #{i.columns} columns and #{i.rows} rows." &raquo;
The image has 127 columns and 120 rows.
puts "The image has #{i.columns} columns and #{i.rows} rows."
#=&gt; The image has 127 columns and 120 rows.
</pre
>

Expand Down Expand Up @@ -1789,7 +1789,7 @@ <h4>Example</h4>

<pre class="language-ruby">
i = Magick::ImageList.new "birthday.png"
s = i.to_blob &raquo; a string representing the image.
s = i.to_blob #=&gt; a string representing the image.
</pre
>

Expand Down Expand Up @@ -1873,13 +1873,15 @@ <h4>Example</h4>
# The PNG format does not support multi-frame files,
# so each image is written to a separate file.
i = Magick::ImageList.new "animated.gif"
p i.length &raquo; 3 # contains 3 images
i.write "test.png" &raquo; test.png.0
&raquo; test.png.1
&raquo; test.png.2
p i.length #=&gt; 3 # contains 3 images
i.write "test.png"
#=&gt; test.png.0
# test.png.1
# test.png.2

# ImageMagick's MIFF format does support multi-frame
# files, so all 3 images are written to one file.
i.write "animated.miff" &raquo; animated.miff
i.write "animated.miff" #=&gt; animated.miff
</pre
>

Expand Down
21 changes: 11 additions & 10 deletions image1.html
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,9 @@ <h4>Returns</h4>
<h4>Example</h4>

<pre class="language-ruby">
cheetah = Magick::Image.ping("Cheetah.jpg") &raquo; [Cheetah.jpg JPEG 1024x768 DirectClass 8-bit 101684b]
p cheetah[0].rows &raquo; 768
p cheetah[0].columns &raquo; 1024
cheetah = Magick::Image.ping("Cheetah.jpg") #=&gt; [Cheetah.jpg JPEG 1024x768 DirectClass 8-bit 101684b]
p cheetah[0].rows #=&gt; 768
p cheetah[0].columns #=&gt; 1024
</pre
>

Expand Down Expand Up @@ -641,9 +641,10 @@ <h4>Returns</h4>
<h4>Example</h4>

<pre class="language-ruby">
animated = Magick::Image.read("animated.gif") &raquo; [animated.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b
&raquo; animated.gif[1] GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b,
&raquo; animated.gif[2] GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b]
animated = Magick::Image.read("animated.gif")
#=&gt; [animated.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b
# animated.gif[1] GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b,
# animated.gif[2] GIF 127x120+0+0 PseudoClass 256c 8-bit 54395b]
</pre
>

Expand Down Expand Up @@ -3379,10 +3380,10 @@ <h4>Returns</h4>
<h4>Example</h4>

<pre class="language-ruby">
f = Magick::Image.read('cbezier1.gif').first &raquo; cbezier1.gif GIF 500x350+0+0 PseudoClass 128c 8-bit 177503b
f.colors &raquo; 128
f.compress_colormap! &raquo; cbezier1.gif GIF 500x350+0+0 PseudoClass 108c 8-bit 177503b
f.colors &raquo; 108
f = Magick::Image.read('cbezier1.gif').first #=&gt; cbezier1.gif GIF 500x350+0+0 PseudoClass 128c 8-bit 177503b
f.colors #=&gt; 128
f.compress_colormap! #=&gt; cbezier1.gif GIF 500x350+0+0 PseudoClass 108c 8-bit 177503b
f.colors #=&gt; 108
</pre
>

Expand Down
14 changes: 7 additions & 7 deletions image2.html
Original file line number Diff line number Diff line change
Expand Up @@ -1352,9 +1352,9 @@ <h4>Returns</h4>
<h4>Example</h4>

<pre class="language-ruby">
image.get_exif_by_entry('Make') &raquo; [["Make", "Canon"]]
image.get_exif_by_entry("ShutterSpeedValue") &raquo; [["ShutterSpeedValue", "189/32"]]
image.get_exif_by_entry() &raquo; [["Make", "Canon"], ["ShutterSpeedValue", "189/32"] ...]
image.get_exif_by_entry('Make') #=&gt; [["Make", "Canon"]]
image.get_exif_by_entry("ShutterSpeedValue") #=&gt; [["ShutterSpeedValue", "189/32"]]
image.get_exif_by_entry() #=&gt; [["Make", "Canon"], ["ShutterSpeedValue", "189/32"] ...]
</pre
>

Expand Down Expand Up @@ -1391,9 +1391,9 @@ <h4>Returns</h4>
<h4>Example</h4>

<pre class="language-ruby">
image.get_exif_by_number(271) &raquo; {271=&gt;"Canon"}
image.get_exif_by_number(37377) &raquo; {37377=&gt;"189/32"}
image.get_exif_by_number() &raquo; {271=&gt;"Canon", 37377=&gt;"189/32" ...}
image.get_exif_by_number(271) #=&gt; {271=&gt;"Canon"}
image.get_exif_by_number(37377) #=&gt; {37377=&gt;"189/32"}
image.get_exif_by_number() #=&gt; {271=&gt;"Canon", 37377=&gt;"189/32" ...}
</pre
>

Expand Down Expand Up @@ -2296,7 +2296,7 @@ <h4>Description</h4>

<h4>Example</h4>

<pre class="language-ruby">f.inspect &raquo; "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"</pre>
<pre class="language-ruby">f.inspect #=&gt; "images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9kb"</pre>
</div>

<div class="sig">
Expand Down
17 changes: 9 additions & 8 deletions image3.html
Original file line number Diff line number Diff line change
Expand Up @@ -2514,11 +2514,12 @@ <h4>Returns</h4>

<h4>Example</h4>
<pre class="language-ruby">
img = Magick::Image.read('ex/images/Flower_Hat.jpg').first &raquo; ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
img.properties &raquo; {"comment"=&gt;"File written by Adobe Photoshop\250 4.0"}
img.signature &raquo; "485e01ecba1a1f47924d67b887cb07b474f695841733796dfa3c2876965c7e8b"
img.properties &raquo; {"signature"=&gt;"485e01ecba1a1f47924d67b887cb07b474f695841733796dfa3c2876965c7e8b",
&raquo; "comment"=&gt;"File written by Adobe Photoshop\250 4.0"}
img = Magick::Image.read('ex/images/Flower_Hat.jpg').first #=&gt; ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
img.properties #=&gt; {"comment"=&gt;"File written by Adobe Photoshop\250 4.0"}
img.signature #=&gt; "485e01ecba1a1f47924d67b887cb07b474f695841733796dfa3c2876965c7e8b"
img.properties
#=&gt; {"signature"=&gt;"485e01ecba1a1f47924d67b887cb07b474f695841733796dfa3c2876965c7e8b",
# "comment"=&gt;"File written by Adobe Photoshop\250 4.0"}
</pre
>

Expand Down Expand Up @@ -3381,9 +3382,9 @@ <h4>Returns</h4>

<h4>Example</h4>
<pre class="language-ruby">
img = Magick::Image.read('ex/images/Flower_Hat.jpg').first &raquo; ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
pixel = img.pixel_color(img.columns/2, img.rows/2) &raquo; #&lt;struct Pixel red=216, green=147, blue=106, opacity=0&gt;
img.to_color(pixel) &raquo; "#D8936A"
img = Magick::Image.read('ex/images/Flower_Hat.jpg').first #=&gt; ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
pixel = img.pixel_color(img.columns/2, img.rows/2) #=&gt; #&lt;struct Pixel red=216, green=147, blue=106, opacity=0&gt;
img.to_color(pixel) #=&gt; "#D8936A"
</pre
>

Expand Down
9 changes: 5 additions & 4 deletions info.html
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ <h4 id="user_option">The "user" option</h4>
<pre class="language-ruby">
img = Magick::Image.new(10,10) do |options|
options['user'] = __FILE__ + ':' + __LINE__.to_s
end &raquo; 10x10 DirectClass 16-bit user:test.rb:3
end
#=&gt; 10x10 DirectClass 16-bit user:test.rb:3
</pre
>

Expand Down Expand Up @@ -313,7 +314,7 @@ <h4>Returns</h4>

<h4>Example</h4>

<pre class="language-ruby">options["tiff", "bits-per-sample"] &raquo; 2</pre>
<pre class="language-ruby">options["tiff", "bits-per-sample"] #=&gt; 2</pre>

<h4>Magick API</h4>

Expand Down Expand Up @@ -520,8 +521,8 @@ <h4>Description</h4>
options.caption = "a new caption"
options.size = "20x20"
end
p img.first.properties &raquo; {"caption"=&gt;"a new caption"}
p img.first['caption'] &raquo; "a new caption"
p img.first.properties #=&gt; {"caption"=&gt;"a new caption"}
p img.first['caption'] #=&gt; "a new caption"
</pre
>

Expand Down
18 changes: 9 additions & 9 deletions magick.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,15 @@ <h4>Returns</h4>
<h4>Example</h4>

<pre class="language-ruby">
p Magick.formats &raquo;
{"TIF"=&gt;"*rw+",
"H"=&gt;"*rw-",
"MNG"=&gt;"*rw+",
"NULL"=&gt;"*rw-",
...
"G"=&gt;"*rw+",
"GIF"=&gt;"*rw+",
"PDB"=&gt;"*rw+"}
p Magick.formats
#=&gt; {"TIF"=&gt;"*rw+",
# "H"=&gt;"*rw-",
# "MNG"=&gt;"*rw+",
# "NULL"=&gt;"*rw-",
# ...
# "G"=&gt;"*rw+",
# "GIF"=&gt;"*rw+",
# "PDB"=&gt;"*rw+"}
</pre
>

Expand Down

0 comments on commit d907f37

Please sign in to comment.