summaryrefslogtreecommitdiffhomepage
path: root/examples/wrap_text.rb
diff options
context:
space:
mode:
authorZsolt Kozaroczy <[email protected]>2020-09-11 00:36:29 +0200
committerGitHub <[email protected]>2020-09-11 00:36:29 +0200
commit282eec44ef01746ee25931fa6cd287ad083fd40b (patch)
tree14504bf429ca264812679ca971c1592853d3f762 /examples/wrap_text.rb
parent317e8244e4d17c394c1e181f86df3974623fb865 (diff)
downloadcaxlsx-282eec44ef01746ee25931fa6cd287ad083fd40b.tar.gz
caxlsx-282eec44ef01746ee25931fa6cd287ad083fd40b.zip
Restructure examples folder (#47)
Split examples into separate markdown files, each containing a description, sample code, and a screenshot of the resulting xlsx document. The script `generate.rb` is provided to actually generate the example documents by executing the sample code contained in the markdown files.
Diffstat (limited to 'examples/wrap_text.rb')
-rw-r--r--examples/wrap_text.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/examples/wrap_text.rb b/examples/wrap_text.rb
deleted file mode 100644
index c2e1aeb5..00000000
--- a/examples/wrap_text.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
-require 'axlsx'
-p = Axlsx::Package.new
-p.workbook do |wb|
- wb.styles do |s|
- wrap_text = s.add_style :fg_color=> "FFFFFF",
- :b => true,
- :bg_color => "004586",
- :sz => 12,
- :border => { :style => :thin, :color => "00" },
- :alignment => { :horizontal => :center,
- :vertical => :center ,
- :wrap_text => true}
- wb.add_worksheet(:name => 'wrap text') do |sheet|
- sheet.add_row ['Torp, White and Cronin'], :style => wrap_text
- # Forcing the column to be a bit narrow so we can see if the text wrap.
- sheet.column_info.first.width = 5
- end
- end
-end
-p.serialize 'wrap_text.xlsx'