squib 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/CHANGELOG.md +16 -1
- data/appveyor.yml +2 -3
- data/lib/squib/args/sheet.rb +66 -34
- data/lib/squib/graphics/save_pdf.rb +1 -1
- data/lib/squib/import/data_frame.rb +7 -7
- data/lib/squib/version.rb +1 -1
- data/samples/autoscale_font/_autoscale_font.rb +1 -1
- data/samples/build_groups/build_groups.rb +3 -3
- data/samples/colors/_colors.rb +1 -0
- data/samples/{config_text_markup.rb → config/config_text_markup.rb} +0 -0
- data/samples/{custom_config.rb → config/custom_config.rb} +0 -0
- data/samples/{cairo_access.rb → images/_cairo_access.rb} +0 -0
- data/samples/images/_images.rb +1 -1
- data/samples/{unicode.rb → images/_unicode.rb} +0 -0
- data/samples/intro/01_hello.rb +1 -2
- data/samples/intro/02_options.rb +1 -2
- data/samples/intro/03_layout.rb +1 -2
- data/samples/intro/04_arrays.rb +1 -2
- data/samples/intro/05_excel.rb +3 -4
- data/samples/{tgc_proofs.rb → proofs/_tgc_proofs.rb} +1 -4
- data/samples/saves/_save_pdf.rb +7 -0
- data/samples/{embed_text.rb → text/_embed_text.rb} +1 -0
- data/samples/text/_text.rb +1 -1
- data/samples/{text_options.rb → text/_text_options.rb} +1 -1
- data/samples/{bug134.rb → text/bug134.rb} +0 -0
- data/squib.gemspec +17 -16
- metadata +90 -596
- data/benchmarks/antialias_best.rb +0 -13
- data/benchmarks/antialias_best.yml +0 -1
- data/benchmarks/antialias_fast.rb +0 -13
- data/benchmarks/antialias_fast.yml +0 -1
- data/benchmarks/backend-svg.yml +0 -4
- data/benchmarks/backend_memory.rb +0 -14
- data/benchmarks/backend_svg.rb +0 -14
- data/benchmarks/shiny-purse.png +0 -0
- data/benchmarks/spanner.svg +0 -91
- data/benchmarks/tons_of_png.rb +0 -6
- data/benchmarks/tons_of_svg.rb +0 -7
- data/benchmarks/tons_of_text.rb +0 -8
- data/docs/Makefile +0 -216
- data/docs/_static/css/squibdocs.css +0 -23
- data/docs/args/draw.rst +0 -36
- data/docs/args/expansion.rst +0 -3
- data/docs/args/layout.rst +0 -6
- data/docs/args/output_dir.rst +0 -6
- data/docs/args/range.rst +0 -6
- data/docs/args/transform.rst +0 -51
- data/docs/args/trim.rst +0 -11
- data/docs/args/wh.rst +0 -12
- data/docs/args/xy.rst +0 -12
- data/docs/arrays.rst +0 -80
- data/docs/backends.rst +0 -20
- data/docs/bleed.rst +0 -13
- data/docs/build_groups.rst +0 -45
- data/docs/colors.rst +0 -90
- data/docs/conf.py +0 -287
- data/docs/config.rst +0 -135
- data/docs/data.rst +0 -26
- data/docs/dsl/background.rst +0 -20
- data/docs/dsl/build.rst +0 -32
- data/docs/dsl/build_groups.rst +0 -23
- data/docs/dsl/circle.rst +0 -27
- data/docs/dsl/cm.rst +0 -19
- data/docs/dsl/configure.rst +0 -18
- data/docs/dsl/csv.rst +0 -81
- data/docs/dsl/curve.rst +0 -63
- data/docs/dsl/data_frame.rst +0 -85
- data/docs/dsl/deck.rst +0 -45
- data/docs/dsl/disable_build.rst +0 -25
- data/docs/dsl/disable_build_globally.rst +0 -46
- data/docs/dsl/ellipse.rst +0 -23
- data/docs/dsl/enable_build.rst +0 -25
- data/docs/dsl/enable_build_globally.rst +0 -44
- data/docs/dsl/grid.rst +0 -31
- data/docs/dsl/hand.rst +0 -40
- data/docs/dsl/hint.rst +0 -15
- data/docs/dsl/inches.rst +0 -19
- data/docs/dsl/index.rst +0 -9
- data/docs/dsl/line.rst +0 -52
- data/docs/dsl/mm.rst +0 -19
- data/docs/dsl/png.rst +0 -49
- data/docs/dsl/polygon.rst +0 -28
- data/docs/dsl/rect.rst +0 -22
- data/docs/dsl/save.rst +0 -23
- data/docs/dsl/save_pdf.rst +0 -89
- data/docs/dsl/save_png.rst +0 -46
- data/docs/dsl/save_sheet.rst +0 -55
- data/docs/dsl/showcase.rst +0 -76
- data/docs/dsl/star.rst +0 -35
- data/docs/dsl/svg.rst +0 -119
- data/docs/dsl/text.rst +0 -292
- data/docs/dsl/triangle.rst +0 -50
- data/docs/dsl/use_layout.rst +0 -16
- data/docs/dsl/xlsx.rst +0 -56
- data/docs/guides/game_icons.rst +0 -126
- data/docs/guides/getting-started/index.rst +0 -5
- data/docs/guides/getting-started/part_0_learning_ruby.rst +0 -145
- data/docs/guides/getting-started/part_1_zero_to_game.rst +0 -217
- data/docs/guides/getting-started/part_2_iconography.rst +0 -228
- data/docs/guides/getting-started/part_3_workflows.rst +0 -46
- data/docs/guides/getting-started/part_4_ruby_power.rst +0 -18
- data/docs/guides/git.rst +0 -14
- data/docs/guides/guard.rst +0 -84
- data/docs/guides/hello_world.rst +0 -65
- data/docs/guides/projects.rst +0 -35
- data/docs/help.rst +0 -157
- data/docs/index.rst +0 -35
- data/docs/install.rst +0 -68
- data/docs/layouts.rst +0 -290
- data/docs/learning.rst +0 -12
- data/docs/make.bat +0 -263
- data/docs/parameters.rst +0 -34
- data/docs/server.bat +0 -1
- data/docs/text_feature.rst +0 -115
- data/docs/units.rst +0 -14
- data/samples/autoscale_font/.gitignore +0 -2
- data/samples/autoscale_font/card_00_expected.png +0 -0
- data/samples/backend/.gitignore +0 -1
- data/samples/backend/_backend-config.yml +0 -5
- data/samples/backend/backend_00_expected.png +0 -0
- data/samples/backend/backend_01_expected.png +0 -0
- data/samples/backend/backend_vectorized_expected.pdf +0 -0
- data/samples/backend/backend_vectors_00_expected.svg +0 -84
- data/samples/backend/backend_vectors_01_expected.svg +0 -84
- data/samples/backend/shiny-purse.png +0 -0
- data/samples/backend/showcase_expected.png +0 -0
- data/samples/backend/spanner.svg +0 -91
- data/samples/ball.png +0 -0
- data/samples/build_groups/.gitignore +0 -1
- data/samples/build_groups/Rakefile +0 -25
- data/samples/colors/.gitignore +0 -1
- data/samples/colors/color_constants_00_expected.png +0 -0
- data/samples/colors/colors_00_expected.png +0 -0
- data/samples/colors/gradient_00_expected.png +0 -0
- data/samples/config_disable_quotes.yml +0 -3
- data/samples/config_text_markup.yml +0 -9
- data/samples/custom-config.yml +0 -5
- data/samples/customconfig-imgdir/shiny-purse2.png +0 -0
- data/samples/customconfig-imgdir/spanner2.svg +0 -91
- data/samples/data/.gitignore +0 -1
- data/samples/data/explode_quantities.xlsx +0 -0
- data/samples/data/quantity_explosion.csv +0 -3
- data/samples/data/sample.csv +0 -3
- data/samples/data/sample.xlsx +0 -0
- data/samples/data/sample_csv_00_expected.png +0 -0
- data/samples/data/sample_csv_01_expected.png +0 -0
- data/samples/data/sample_csv_qty_00_expected.png +0 -0
- data/samples/data/sample_excel_00_expected.png +0 -0
- data/samples/data/sample_excel_01_expected.png +0 -0
- data/samples/data/sample_excel_02_expected.png +0 -0
- data/samples/data/sample_excel_resources_00_expected.png +0 -0
- data/samples/data/sample_excel_resources_01_expected.png +0 -0
- data/samples/data/sample_xlsx_qty_00_expected.png +0 -0
- data/samples/glass-heart.svg +0 -52
- data/samples/grit.png +0 -0
- data/samples/images/.gitignore +0 -8
- data/samples/images/_images_00_expected.png +0 -0
- data/samples/images/angler-fish.png +0 -0
- data/samples/images/ball.png +0 -0
- data/samples/images/glass-heart.svg +0 -52
- data/samples/images/grit.png +0 -0
- data/samples/images/offset.svg +0 -85
- data/samples/images/robot-golem.svg +0 -1
- data/samples/images/shiny-purse.png +0 -0
- data/samples/images/spanner.svg +0 -91
- data/samples/images/sprites.png +0 -0
- data/samples/images/with-alpha.png +0 -0
- data/samples/intro/.gitignore +0 -2
- data/samples/intro/auto-repair.svg +0 -1
- data/samples/intro/crawling.svg +0 -1
- data/samples/intro/data.xlsx +0 -0
- data/samples/intro/humans.svg +0 -1
- data/samples/intro/ninja-mask.svg +0 -1
- data/samples/intro/part1_00_expected.png +0 -0
- data/samples/intro/part2_00_expected.png +0 -0
- data/samples/intro/part3_00_expected.png +0 -0
- data/samples/intro/part3_layout.yml +0 -34
- data/samples/intro/part4_00_expected.png +0 -0
- data/samples/intro/part4_01_expected.png +0 -0
- data/samples/intro/part5_00_expected.png +0 -0
- data/samples/intro/part5_01_expected.png +0 -0
- data/samples/intro/part5_02_expected.png +0 -0
- data/samples/intro/part5_03_expected.png +0 -0
- data/samples/intro/part5_hand_expected.png +0 -0
- data/samples/intro/part5_showcase_expected.png +0 -0
- data/samples/intro/pirate-skull.svg +0 -1
- data/samples/intro/robot-golem.svg +0 -1
- data/samples/layouts/custom-layout.yml +0 -60
- data/samples/layouts/custom-layout2.yml +0 -15
- data/samples/layouts/expected_layouts_builtin_economy_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_fantasy_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_hand_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_playing_card_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_tuck_box_00.png +0 -0
- data/samples/layouts/shiny-purse.png +0 -0
- data/samples/layouts/spanner.svg +0 -91
- data/samples/load_images_config.yml +0 -1
- data/samples/offset.svg +0 -71
- data/samples/pokercard.png +0 -0
- data/samples/project/Gemfile +0 -6
- data/samples/project/Guardfile +0 -18
- data/samples/project/Rakefile +0 -25
- data/samples/project/bw/robot-golem.svg +0 -53
- data/samples/project/color/robot-golem.svg +0 -1
- data/samples/project/config.yml +0 -2
- data/samples/project/layouts/characters.yml +0 -3
- data/samples/project/layouts/skills.yml +0 -3
- data/samples/ranges/glass-heart.svg +0 -52
- data/samples/ranges/ranges_00_expected.png +0 -0
- data/samples/saves/.gitignore +0 -1
- data/samples/saves/hand_expected.png +0 -0
- data/samples/saves/hand_pretty_expected.png +0 -0
- data/samples/saves/save-pdf-small_expected.pdf +0 -0
- data/samples/saves/save-pdf_expected.pdf +0 -0
- data/samples/saves/save_png_00_expected.png +0 -0
- data/samples/saves/save_png_trimmed_00_expected.png +0 -0
- data/samples/saves/save_sheet_00_expected.png +0 -0
- data/samples/saves/save_sheet_01_expected.png +0 -0
- data/samples/saves/save_sheet_range_00_expected.png +0 -0
- data/samples/saves/save_sheet_range_01_expected.png +0 -0
- data/samples/saves/save_single_sheet_00_expected.png +0 -0
- data/samples/saves/saves_notrim_01_expected.png +0 -0
- data/samples/saves/showcase2_expected.png +0 -0
- data/samples/saves/showcase_expected.png +0 -0
- data/samples/saves/showcase_individual_00_expected.png +0 -0
- data/samples/saves/showcase_individual_01_expected.png +0 -0
- data/samples/saves/showcase_individual_02_expected.png +0 -0
- data/samples/saves/showcase_individual_03_expected.png +0 -0
- data/samples/saves/spanner.svg +0 -91
- data/samples/shapes/.gitignore +0 -1
- data/samples/shapes/shape_00_expected.png +0 -0
- data/samples/shiny-purse.png +0 -0
- data/samples/spanner.svg +0 -91
- data/samples/sprites.png +0 -0
- data/samples/text/.gitignore +0 -2
- data/samples/text/README.md +0 -1
- data/samples/text/_text_00_expected.png +0 -0
- data/samples/text/config.yml +0 -2
- data/samples/units/units_00_expected.png +0 -0
- data/samples/units/using_units.yml +0 -10
- data/spec/api/api_data_spec.rb +0 -172
- data/spec/api/api_groups_spec.rb +0 -49
- data/spec/api/api_settings_spec.rb +0 -38
- data/spec/api/api_units_spec.rb +0 -37
- data/spec/args/box_spec.rb +0 -127
- data/spec/args/draw_spec.rb +0 -101
- data/spec/args/embed_key_spec.rb +0 -13
- data/spec/args/input_file_spec.rb +0 -21
- data/spec/args/paint_spec.rb +0 -22
- data/spec/args/paragraph_spec.rb +0 -153
- data/spec/args/range_spec.rb +0 -41
- data/spec/args/save_batch_spec.rb +0 -51
- data/spec/args/scale_box_spec.rb +0 -71
- data/spec/args/sheet_spec.rb +0 -80
- data/spec/args/showcase_special_spec.rb +0 -15
- data/spec/args/transform_spec.rb +0 -25
- data/spec/args/typographer_spec.rb +0 -71
- data/spec/args/unit_conversion_spec.rb +0 -29
- data/spec/card_spec.rb +0 -11
- data/spec/commands/new_spec.rb +0 -48
- data/spec/conf_spec.rb +0 -47
- data/spec/data/conf/basic.yml +0 -1
- data/spec/data/conf/empty.yml +0 -1
- data/spec/data/conf/unrecognized.yml +0 -4
- data/spec/data/csv/basic.csv +0 -3
- data/spec/data/csv/custom_opts.csv +0 -2
- data/spec/data/csv/dup_cols.csv +0 -3
- data/spec/data/csv/newline.csv +0 -3
- data/spec/data/csv/qty.csv +0 -3
- data/spec/data/csv/qty_named.csv +0 -3
- data/spec/data/csv/with_spaces.csv +0 -3
- data/spec/data/csv/yield.csv +0 -3
- data/spec/data/layouts/easy-circular-extends.yml +0 -6
- data/spec/data/layouts/empty-rule.yml +0 -1
- data/spec/data/layouts/empty.yml +0 -1
- data/spec/data/layouts/extends-nonexists.yml +0 -3
- data/spec/data/layouts/extends-units-mixed.yml +0 -8
- data/spec/data/layouts/extends-units.yml +0 -8
- data/spec/data/layouts/hard-circular-extends.yml +0 -9
- data/spec/data/layouts/multi-extends-single-entry.yml +0 -14
- data/spec/data/layouts/multi-level-extends.yml +0 -10
- data/spec/data/layouts/multifile-a.yml +0 -4
- data/spec/data/layouts/multifile-b.yml +0 -4
- data/spec/data/layouts/multifile-extends-a.yml +0 -8
- data/spec/data/layouts/multifile-extends-b.yml +0 -9
- data/spec/data/layouts/no-extends.yml +0 -5
- data/spec/data/layouts/pre-extends.yml +0 -7
- data/spec/data/layouts/self-circular-extends.yml +0 -3
- data/spec/data/layouts/single-extends.yml +0 -7
- data/spec/data/layouts/single-level-multi-extends.yml +0 -12
- data/spec/data/samples/autoscale_font/_autoscale_font.rb.txt +0 -133
- data/spec/data/samples/basic.rb.txt +0 -248
- data/spec/data/samples/cairo_access.rb.txt +0 -59
- data/spec/data/samples/colors/_gradients.rb.txt +0 -84
- data/spec/data/samples/config_text_markup.rb.txt +0 -74
- data/spec/data/samples/custom_config.rb.txt +0 -59
- data/spec/data/samples/data/_csv.rb.txt +0 -231
- data/spec/data/samples/data/_excel.rb.txt +0 -704
- data/spec/data/samples/embed_text.rb.txt +0 -431
- data/spec/data/samples/hello_world.rb.txt +0 -38
- data/spec/data/samples/images/_more_load_images.rb.txt +0 -335
- data/spec/data/samples/layouts.rb.txt +0 -489
- data/spec/data/samples/ranges/_ranges.rb.txt +0 -484
- data/spec/data/samples/saves/_hand.rb.txt +0 -594
- data/spec/data/samples/saves/_portrait_landscape.rb.txt +0 -57
- data/spec/data/samples/saves/_save_pdf.rb.txt +0 -1601
- data/spec/data/samples/saves/_saves.rb.txt +0 -873
- data/spec/data/samples/saves/_showcase.rb.txt +0 -5942
- data/spec/data/samples/shapes/_draw_shapes.rb.txt +0 -757
- data/spec/data/samples/text_options.rb.txt +0 -1158
- data/spec/data/samples/tgc_proofs.rb.txt +0 -102
- data/spec/data/samples/units/_units.rb.txt +0 -53
- data/spec/data/xlsx/basic.xlsx +0 -0
- data/spec/data/xlsx/explode_quantities.xlsx +0 -0
- data/spec/data/xlsx/formulas.xlsx +0 -0
- data/spec/data/xlsx/whitespace.xlsx +0 -0
- data/spec/data/xlsx/with_macros.xlsm +0 -0
- data/spec/deck_spec.rb +0 -73
- data/spec/graphics/cairo_context_wrapper_spec.rb +0 -104
- data/spec/graphics/embedding_utils_spec.rb +0 -73
- data/spec/graphics/graphics_save_doc_spec.rb +0 -74
- data/spec/import/data_frame_spec.rb +0 -251
- data/spec/layout_parser_spec.rb +0 -226
- data/spec/logger_spec.rb +0 -12
- data/spec/samples/_diffs/gitkeep.txt +0 -0
- data/spec/samples/diff-with-css.example.html +0 -39
- data/spec/samples/expected/autoscale_00.png +0 -0
- data/spec/samples/expected/autoscale_01.png +0 -0
- data/spec/samples/expected/autoscale_02.png +0 -0
- data/spec/samples/expected/backend_00.png +0 -0
- data/spec/samples/expected/backend_00.svg +0 -78
- data/spec/samples/expected/backend_01.png +0 -0
- data/spec/samples/expected/backend_01.svg +0 -78
- data/spec/samples/expected/basic_00.png +0 -0
- data/spec/samples/expected/basic_01.png +0 -0
- data/spec/samples/expected/basic_02.png +0 -0
- data/spec/samples/expected/cairo_access_00.png +0 -0
- data/spec/samples/expected/cairo_access_01.png +0 -0
- data/spec/samples/expected/card_00.png +0 -0
- data/spec/samples/expected/card_01.png +0 -0
- data/spec/samples/expected/colors_00.png +0 -0
- data/spec/samples/expected/config_disable_text_00.png +0 -0
- data/spec/samples/expected/config_text_00.png +0 -0
- data/spec/samples/expected/custom-config_00.png +0 -0
- data/spec/samples/expected/embed_00.png +0 -0
- data/spec/samples/expected/embed_multisheet_00.png +0 -0
- data/spec/samples/expected/gitkeep.txt +0 -0
- data/spec/samples/expected/gradient_00.png +0 -0
- data/spec/samples/expected/hand.png +0 -0
- data/spec/samples/expected/hand_pretty.png +0 -0
- data/spec/samples/expected/landscape_00.png +0 -0
- data/spec/samples/expected/layout2_00.png +0 -0
- data/spec/samples/expected/layout_00.png +0 -0
- data/spec/samples/expected/layout_builtin_hand_00.png +0 -0
- data/spec/samples/expected/layout_builtin_playing_card_00.png +0 -0
- data/spec/samples/expected/load_images_00.png +0 -0
- data/spec/samples/expected/portrait_00.png +0 -0
- data/spec/samples/expected/ranges_00.png +0 -0
- data/spec/samples/expected/sample_csv_00.png +0 -0
- data/spec/samples/expected/sample_csv_01.png +0 -0
- data/spec/samples/expected/sample_excel_00.png +0 -0
- data/spec/samples/expected/sample_excel_01.png +0 -0
- data/spec/samples/expected/sample_excel_02.png +0 -0
- data/spec/samples/expected/save_sheet_00.png +0 -0
- data/spec/samples/expected/save_sheet_01.png +0 -0
- data/spec/samples/expected/save_sheet_range_00.png +0 -0
- data/spec/samples/expected/save_sheet_range_01.png +0 -0
- data/spec/samples/expected/save_single_sheet_00.png +0 -0
- data/spec/samples/expected/saves_notrim_01.png +0 -0
- data/spec/samples/expected/shape_00.png +0 -0
- data/spec/samples/expected/showcase.png +0 -0
- data/spec/samples/expected/showcase2.png +0 -0
- data/spec/samples/expected/showcase_individual_00.png +0 -0
- data/spec/samples/expected/showcase_individual_01.png +0 -0
- data/spec/samples/expected/showcase_individual_02.png +0 -0
- data/spec/samples/expected/showcase_individual_03.png +0 -0
- data/spec/samples/expected/text_00.png +0 -0
- data/spec/samples/expected/text_01.png +0 -0
- data/spec/samples/expected/text_02.png +0 -0
- data/spec/samples/expected/tgc_sample_00.png +0 -0
- data/spec/samples/expected/units_00.png +0 -0
- data/spec/samples/run_samples_spec.rb +0 -17
- data/spec/samples/samples_regression_spec.rb +0 -71
- data/spec/samples/sanity.html.erb +0 -28
- data/spec/samples/sanity.rb +0 -70
- data/spec/sanity/.gitignore +0 -1
- data/spec/sanity/sanity.html.erb +0 -42
- data/spec/sanity/sanity_test.rb +0 -42
- data/spec/sanity/tests.yml +0 -12
- data/spec/spec_helper.rb +0 -159
data/docs/config.rst
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
Configuration Options
|
|
2
|
-
=====================
|
|
3
|
-
|
|
4
|
-
Squib supports various configuration properties that can be specified in an external file. By default, Squib looks for a file called ``config.yml`` in the current directory. Or, you can set the ``config:`` option in ``Deck.new`` to specify the name of the configuration file.
|
|
5
|
-
|
|
6
|
-
These properties are intended to be immutable for the life of the Deck, and intended to configure how Squib behaves.
|
|
7
|
-
|
|
8
|
-
The options include:
|
|
9
|
-
|
|
10
|
-
progress_bars
|
|
11
|
-
default: ``false``
|
|
12
|
-
|
|
13
|
-
When set to ``true``, long-running operations will show a progress bar in the console
|
|
14
|
-
|
|
15
|
-
hint
|
|
16
|
-
default: ``:off``
|
|
17
|
-
|
|
18
|
-
Text hints are used to show the boundaries of text boxes. Can be enabled/disabled for individual commands, or set globally with the `hint` method. This setting is overridden by `hint` (and subsequently individual :doc:`/dsl/text`).
|
|
19
|
-
|
|
20
|
-
custom_colors
|
|
21
|
-
default: ``{}``
|
|
22
|
-
|
|
23
|
-
Defines globally-available named colors available to the deck. Must be specified as a hash in yaml. For example::
|
|
24
|
-
|
|
25
|
-
# config.yml
|
|
26
|
-
custom_colors:
|
|
27
|
-
fg: '#abc'
|
|
28
|
-
bg: '#def'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
antialias
|
|
32
|
-
default: ``'best'``
|
|
33
|
-
|
|
34
|
-
Set the algorithm that Cairo will use for anti-aliasing throughout its rendering. Available options are ``fast``, ``good``, ``best``, ``none``, ``gray``, ``subpixel``.
|
|
35
|
-
|
|
36
|
-
Not every option is available on every platform. Using our benchmarks on large decks, `best` is only ~10% slower anyway. For more info see the `Cairo docs <http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t>`_.
|
|
37
|
-
|
|
38
|
-
backend
|
|
39
|
-
default: ``'memory'``
|
|
40
|
-
|
|
41
|
-
Defines how Cairo will store the operations. Can be ``svg`` or ``memory``. See :doc:`/backends`.
|
|
42
|
-
|
|
43
|
-
prefix
|
|
44
|
-
default: ``'card_'``
|
|
45
|
-
|
|
46
|
-
When using an SVG backend, cards are auto-saved with this prefix and ``'%02d'`` numbering format.
|
|
47
|
-
|
|
48
|
-
img_dir
|
|
49
|
-
default: ``'.'``
|
|
50
|
-
|
|
51
|
-
For reading image file command (e.g. png and svg), read from this directory instead
|
|
52
|
-
|
|
53
|
-
warn_ellipsize
|
|
54
|
-
default: true
|
|
55
|
-
|
|
56
|
-
Show a warning on the console when text is ellipsized. Warning is issued per card.
|
|
57
|
-
|
|
58
|
-
warn_png_scale
|
|
59
|
-
default: true
|
|
60
|
-
|
|
61
|
-
Show a warning on the console when a PNG file is upscaled. Warning is issued per card.
|
|
62
|
-
|
|
63
|
-
lsquote
|
|
64
|
-
default: ``"\u2018"``
|
|
65
|
-
|
|
66
|
-
Smart quoting: change the left single quote when ``markup: true``
|
|
67
|
-
|
|
68
|
-
rsquote
|
|
69
|
-
default: ``"\u2019"``
|
|
70
|
-
|
|
71
|
-
Smart quoting: change the right single quote when ``markup: true``
|
|
72
|
-
|
|
73
|
-
ldquote
|
|
74
|
-
default: ``"\u201C"``
|
|
75
|
-
|
|
76
|
-
Smart quoting: change the left double quote when ``markup: true``
|
|
77
|
-
|
|
78
|
-
rdquote
|
|
79
|
-
default: ``"\u201D"``
|
|
80
|
-
|
|
81
|
-
Smart quoting: change the right double quote when ``markup: true``
|
|
82
|
-
|
|
83
|
-
em_dash
|
|
84
|
-
default: ``"\u2014"``
|
|
85
|
-
|
|
86
|
-
Convert the ``--`` to this character when ``markup: true``
|
|
87
|
-
|
|
88
|
-
en_dash
|
|
89
|
-
default: ``"\u2013"``
|
|
90
|
-
|
|
91
|
-
Convert the ``---`` to this character when ``markup: true``
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
ellipsis
|
|
95
|
-
default: ``"\u2026"``
|
|
96
|
-
|
|
97
|
-
Convert ``...`` to this character when ``markup: true``
|
|
98
|
-
|
|
99
|
-
smart_quotes
|
|
100
|
-
default: true
|
|
101
|
-
|
|
102
|
-
When ``markup: true``, the ``text`` method will convert quotes. With ``smart_quotes: false``, explicit replacements like em-dashes and en-dashes will be replaced but not smart quotes.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Options are available as methods
|
|
106
|
-
--------------------------------
|
|
107
|
-
|
|
108
|
-
For debugging/sanity purposes, if you want to make sure your configuration options are parsed correctly, the above options are also available as methods within ``Squib::Deck``, for example::
|
|
109
|
-
|
|
110
|
-
Squib::Deck.new do
|
|
111
|
-
puts backend # prints 'memory' by default
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
These are read-only - you will not be able to change these.
|
|
115
|
-
|
|
116
|
-
Squib.configure sets options programmatically
|
|
117
|
-
---------------------------------------------
|
|
118
|
-
|
|
119
|
-
You can also use :doc:`/dsl/configure` to override anything in the config file. Use it like this:
|
|
120
|
-
|
|
121
|
-
.. literalinclude:: ../samples/project/Rakefile
|
|
122
|
-
:language: ruby
|
|
123
|
-
:linenos:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
See :doc:`/guides/getting-started/part_3_workflows` for how we put this to good use.
|
|
127
|
-
|
|
128
|
-
Making Squib Verbose
|
|
129
|
-
--------------------
|
|
130
|
-
|
|
131
|
-
By default, Squib's logger is set to ``WARN``, but more fine-grained logging is embedded in the code. To set the logger, just put this at the top of your script::
|
|
132
|
-
|
|
133
|
-
Squib::logger.level = Logger::INFO
|
|
134
|
-
|
|
135
|
-
If you REALLY want to see tons of output, you can also set DEBUG, but that's not intended for general consumption.
|
data/docs/data.rst
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Be Data-Driven with XLSX and CSV
|
|
2
|
-
================================
|
|
3
|
-
|
|
4
|
-
Squib supports importing data from ExcelX (.xlsx) files and Comma-Separated Values (.csv) files. Because :doc:`/arrays`, these methods are column-based, which means that they assume you have a header row in your table, and that header row will define the name of the column.
|
|
5
|
-
|
|
6
|
-
Squib::DataFrame, or a Hash of Arrays
|
|
7
|
-
-------------------------------------
|
|
8
|
-
|
|
9
|
-
In both DSL methods, Squib will return a "data frame" (literally of type ``Squib::DataFrame``). The best way to think of this is a ``Hash`` of ``Arrays``, where each column is a key in the hash, and every element of each Array represents a data point on a card.
|
|
10
|
-
|
|
11
|
-
The data import methods expect you to structure your Excel sheet or CSV like this:
|
|
12
|
-
|
|
13
|
-
* First row should be a header - preferably with concise naming since you'll reference it in Ruby code
|
|
14
|
-
* Rows should represent cards in the deck
|
|
15
|
-
* Columns represent data about cards (e.g. "Type", "Cost", or "Name")
|
|
16
|
-
|
|
17
|
-
Of course, you can always import your game data other ways using just Ruby (e.g. from a REST API, a JSON file, or your own custom format). There's nothing special about Squib's methods in how they relate to ``Squib::Deck`` other than their convenience.
|
|
18
|
-
|
|
19
|
-
See :doc:`/dsl/xlsx` and :doc:`/dsl/csv` for more details and examples on how the data can be imported.
|
|
20
|
-
|
|
21
|
-
The ``Squib::DataFrame`` class provides much more than what a ``Hash`` provides, however. The :doc:`/dsl/data_frame`
|
|
22
|
-
|
|
23
|
-
Quantity Explosion
|
|
24
|
-
------------------
|
|
25
|
-
|
|
26
|
-
If you want more than one copy of a card, then have a column in your data file called ``Qty`` and fill it with counts for each card. Squib's :doc:`/dsl/xlsx` and :doc:`/dsl/xlsx` methods will automatically expand those rows according to those counts. You can also customize that "Qty" to anything you like by setting the `explode` option (e.g. ``explode: 'Quantity'``). Again, see the specific methods for examples.
|
data/docs/dsl/background.rst
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
background
|
|
2
|
-
----------
|
|
3
|
-
|
|
4
|
-
Fills the background with the given color
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Options
|
|
8
|
-
^^^^^^^
|
|
9
|
-
.. include:: /args/expansion.rst
|
|
10
|
-
|
|
11
|
-
.. include:: /args/range.rst
|
|
12
|
-
|
|
13
|
-
color
|
|
14
|
-
default: ``:black``
|
|
15
|
-
|
|
16
|
-
the color or gradient to fill the background with. See :doc:`/colors`.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Examples
|
|
20
|
-
^^^^^^^^
|
data/docs/dsl/build.rst
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
build
|
|
2
|
-
=====
|
|
3
|
-
|
|
4
|
-
Establish a set of commands that can be enabled/disabled together to allow for customized builds. See :doc:`/build_groups` for ways to use this effectively.
|
|
5
|
-
|
|
6
|
-
Required Arguments
|
|
7
|
-
------------------
|
|
8
|
-
|
|
9
|
-
.. note::
|
|
10
|
-
|
|
11
|
-
This is an argument, not an option like most DSL methods. See example below.
|
|
12
|
-
|
|
13
|
-
group
|
|
14
|
-
default: ``:all``
|
|
15
|
-
|
|
16
|
-
The name of the build group. Convention is to use a Ruby symbol.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
&block
|
|
20
|
-
When this group is enabled (and only ``:all`` is enabled by default), then this block is executed. Otherwise, the block is ignored.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Examples
|
|
24
|
-
--------
|
|
25
|
-
|
|
26
|
-
Use group to organize your Squib code into build groups::
|
|
27
|
-
|
|
28
|
-
Squib::Deck.new do
|
|
29
|
-
build :pnp do
|
|
30
|
-
save_pdf
|
|
31
|
-
end
|
|
32
|
-
end
|
data/docs/dsl/build_groups.rst
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
build_groups
|
|
2
|
-
============
|
|
3
|
-
|
|
4
|
-
Returns the set of group names that have been enabled. See :doc:`/build_groups` for ways to use this effectively.
|
|
5
|
-
|
|
6
|
-
Arguments
|
|
7
|
-
---------
|
|
8
|
-
|
|
9
|
-
(none)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Examples
|
|
13
|
-
--------
|
|
14
|
-
|
|
15
|
-
Use group to organize your Squib code into build groups::
|
|
16
|
-
|
|
17
|
-
Squib::Deck.new do
|
|
18
|
-
enable_build :pnp
|
|
19
|
-
build :pnp do
|
|
20
|
-
save_pdf
|
|
21
|
-
end
|
|
22
|
-
puts build_groups # outputs :all and :pnp
|
|
23
|
-
end
|
data/docs/dsl/circle.rst
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
circle
|
|
2
|
-
------
|
|
3
|
-
|
|
4
|
-
Draw a circle centered at the given coordinates
|
|
5
|
-
|
|
6
|
-
Options
|
|
7
|
-
^^^^^^^
|
|
8
|
-
.. include:: /args/expansion.rst
|
|
9
|
-
|
|
10
|
-
.. include:: /args/xy.rst
|
|
11
|
-
|
|
12
|
-
radius
|
|
13
|
-
default: ``100``
|
|
14
|
-
|
|
15
|
-
radius of the circle. Supports :doc:`/units`.
|
|
16
|
-
|
|
17
|
-
.. include:: /args/draw.rst
|
|
18
|
-
.. include:: /args/range.rst
|
|
19
|
-
.. include:: /args/layout.rst
|
|
20
|
-
|
|
21
|
-
Examples
|
|
22
|
-
^^^^^^^^
|
|
23
|
-
|
|
24
|
-
.. literalinclude:: /../samples/shapes/_draw_shapes.rb
|
|
25
|
-
:language: ruby
|
|
26
|
-
:linenos:
|
|
27
|
-
:caption: This snippet and others like it live `here <https://github.com/andymeneely/squib/blob/master/samples/>`_
|
data/docs/dsl/cm.rst
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
cm
|
|
2
|
-
--
|
|
3
|
-
|
|
4
|
-
Given centimeters, returns the number of pixels according to the deck's DPI.
|
|
5
|
-
|
|
6
|
-
Parameters
|
|
7
|
-
^^^^^^^^^^
|
|
8
|
-
|
|
9
|
-
n
|
|
10
|
-
the number of centimeters
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Examples
|
|
14
|
-
^^^^^^^^
|
|
15
|
-
|
|
16
|
-
.. code-block:: ruby
|
|
17
|
-
|
|
18
|
-
cm(1) # 118.11px (for default Deck::dpi of 300)
|
|
19
|
-
cm(2) + cm(1) # 354.33ox (for default Deck::dpi of 300)
|
data/docs/dsl/configure.rst
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Squib.configure
|
|
2
|
-
---------------
|
|
3
|
-
|
|
4
|
-
Prior to the construction of a Squib::Deck, set a global default that overrides what is specified `config.yml`.
|
|
5
|
-
|
|
6
|
-
This is intended to be done prior to Squib::Deck.new, and is intended to be used inside of a Rakefile
|
|
7
|
-
|
|
8
|
-
Options
|
|
9
|
-
^^^^^^^
|
|
10
|
-
|
|
11
|
-
All options that are specified in :doc:`/config`
|
|
12
|
-
|
|
13
|
-
Exmaples
|
|
14
|
-
^^^^^^^^
|
|
15
|
-
|
|
16
|
-
.. literalinclude:: ../../samples/project/Rakefile
|
|
17
|
-
:language: ruby
|
|
18
|
-
:linenos:
|
data/docs/dsl/csv.rst
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
csv
|
|
2
|
-
===
|
|
3
|
-
|
|
4
|
-
Pulls CSV data from .csv files into a hash of arrays keyed by the headers. First row is assumed to be the header row.
|
|
5
|
-
|
|
6
|
-
Parsing uses Ruby's CSV, with options ``{headers: true, converters: :numeric}``
|
|
7
|
-
http://www.ruby-doc.org/stdlib-2.0/libdoc/csv/rdoc/CSV.html
|
|
8
|
-
|
|
9
|
-
The ``csv`` method is a member of ``Squib::Deck``, but it is also available outside of the Deck DSL with ``Squib.csv()``. This allows a construction like::
|
|
10
|
-
|
|
11
|
-
data = Squib.csv file: 'data.csv'
|
|
12
|
-
Squib::Deck.new(cards: data['name'].size) do
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Options
|
|
17
|
-
-------
|
|
18
|
-
|
|
19
|
-
file
|
|
20
|
-
default: ``'deck.csv'``
|
|
21
|
-
|
|
22
|
-
the CSV-formatted file to open. Opens relative to the current directory. If ``data`` is set, this option is overridden.
|
|
23
|
-
|
|
24
|
-
data
|
|
25
|
-
default: ``nil``
|
|
26
|
-
|
|
27
|
-
when set, CSV will parse this data instead of reading the file.
|
|
28
|
-
|
|
29
|
-
strip
|
|
30
|
-
default: ``true``
|
|
31
|
-
|
|
32
|
-
When ``true``, strips leading and trailing whitespace on values and headers
|
|
33
|
-
|
|
34
|
-
explode
|
|
35
|
-
default: ``'qty'``
|
|
36
|
-
|
|
37
|
-
Quantity explosion will be applied to the column this name. For example, rows in the csv with a ``'qty'`` of 3 will be duplicated 3 times.
|
|
38
|
-
|
|
39
|
-
col_sep
|
|
40
|
-
default: ``','``
|
|
41
|
-
|
|
42
|
-
Column separator. One of the CSV custom options in Ruby. See next option below.
|
|
43
|
-
|
|
44
|
-
CSV custom options in Ruby standard lib.
|
|
45
|
-
All of the options in Ruby's std lib version of CSV are supported **except** ``headers`` is always ``true`` and ``converters`` is always set to ``:numeric``. See the `Ruby Docs <http://ruby-doc.org/stdlib-2.2.0/libdoc/csv/rdoc/CSV.html#method-c-new>`_ for information on the options.
|
|
46
|
-
|
|
47
|
-
Individual Pre-processing
|
|
48
|
-
-------------------------
|
|
49
|
-
|
|
50
|
-
The ``xlsx`` method also takes in a block that will be executed for each cell in your data. This is useful for processing individual cells, like putting a dollar sign in front of dollars, or converting from a float to an integer. The value of the block will be what is assigned to that cell. For example::
|
|
51
|
-
|
|
52
|
-
resource_data = Squib.csv(file: 'sample.xlsx') do |header, value|
|
|
53
|
-
case header
|
|
54
|
-
when 'Cost'
|
|
55
|
-
"$#{value}k" # e.g. "3" becomes "$3k"
|
|
56
|
-
else
|
|
57
|
-
value # always return the original value if you didn't do anything to it
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
Examples
|
|
62
|
-
--------
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
To get the sample Excel files, go to `its source <https://github.com/andymeneely/squib/tree/dev/samples/data>`_
|
|
66
|
-
|
|
67
|
-
.. literalinclude:: ../../samples/data/_csv.rb
|
|
68
|
-
:language: ruby
|
|
69
|
-
:linenos:
|
|
70
|
-
|
|
71
|
-
Here's the sample.csv
|
|
72
|
-
|
|
73
|
-
.. literalinclude:: ../../samples/data/sample.csv
|
|
74
|
-
:language: text
|
|
75
|
-
:linenos:
|
|
76
|
-
|
|
77
|
-
Here's the quantity_explosion.csv
|
|
78
|
-
|
|
79
|
-
.. literalinclude:: ../../samples/data/quantity_explosion.csv
|
|
80
|
-
:language: text
|
|
81
|
-
:linenos:
|
data/docs/dsl/curve.rst
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
curve
|
|
2
|
-
-----
|
|
3
|
-
|
|
4
|
-
Draw a bezier curve using the given coordinates, from x1,y1 to x2,y2. The curvature is set by the control points cx1,cy2 and cx2,cy2.
|
|
5
|
-
|
|
6
|
-
Options
|
|
7
|
-
^^^^^^^
|
|
8
|
-
.. include:: /args/expansion.rst
|
|
9
|
-
|
|
10
|
-
x1
|
|
11
|
-
default: ``0``
|
|
12
|
-
|
|
13
|
-
the x-coordinate of the first endpoint. Supports :doc:`/units`.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
y1
|
|
17
|
-
default: ``0``
|
|
18
|
-
|
|
19
|
-
the y-coordinate of the first endpoint. Supports :doc:`/units`.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
x2
|
|
23
|
-
default: ``5``
|
|
24
|
-
|
|
25
|
-
the x-coordinate of the second endpoint. Supports :doc:`/units`.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
y2
|
|
29
|
-
default: ``5``
|
|
30
|
-
|
|
31
|
-
the y-coordinate of the second endpoint. Supports :doc:`/units`.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
cx1
|
|
35
|
-
default: ``0``
|
|
36
|
-
|
|
37
|
-
the x-coordinate of the first control point. Supports :doc:`/units`.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
cy1
|
|
41
|
-
default: ``0``
|
|
42
|
-
|
|
43
|
-
the y-coordinate of the first control point. Supports :doc:`/units`.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
cx2
|
|
47
|
-
default: ``5``
|
|
48
|
-
|
|
49
|
-
the x-coordinate of the second control point. Supports :doc:`/units`.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
cy2
|
|
53
|
-
default: ``5``
|
|
54
|
-
|
|
55
|
-
the y-coordinate of the second control point. Supports :doc:`/units`.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
.. include:: /args/draw.rst
|
|
59
|
-
.. include:: /args/range.rst
|
|
60
|
-
.. include:: /args/layout.rst
|
|
61
|
-
|
|
62
|
-
Examples
|
|
63
|
-
^^^^^^^^
|