diff --git a/docs/index.rst b/docs/index.rst index 587a05b..2892397 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,7 +7,8 @@ Contents: .. toctree:: :maxdepth: 1 :glob: - + + units dsl/* Indices and tables diff --git a/docs/units.rst b/docs/units.rst new file mode 100644 index 0000000..4266408 --- /dev/null +++ b/docs/units.rst @@ -0,0 +1,4 @@ +Unit Conversion +=============== + +By default, Squib thinks in pixels. This decision was made so that we can have pixel-perfect layouts without automatically scaling everything, even though working in units is sometimes easier. We provide some conversion methods, including looking for strings that end in "in" and "cm" and computing based on the current DPI. The dpi is set on `Squib::Deck.new` (not `config.yml`). Example is in `samples/units.rb` found [here](https://github.com/andymeneely/squib/tree/master/samples/units.rb)