The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| 1) Tag Content in InDesign files | |
| 2) Export from InDesign as raw XML (no XSLT) | |
| 3) Validate XML against XSD | |
| - Enforce attributes on select tags | |
| - Escape special problem characters | |
| - Should be simple enough to be one-size-fits-all | |
| 4) PHP translation script | |
| - Escape select HTML tags before JSON translation (to reduce data depth) | |
| - Transform XML into JSON via Saxon\C-PHP software | |
| - Unescape html tags |
| @function vunit($input, $width, $height){ | |
| @if unit($width) != px or unit($height) != px { | |
| @error "function vunit() dimensions should contain a px unit. +[" + $width + ", " + $height +"]"; | |
| } | |
| // Store $input unit | |
| $unit: unit($input); | |
| // Remove unit from $input and convert to ratio | |
| $ratio: $input / ($input * 0 + 1) / 100; | |
| // Calc and store return values |