frontsau 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +30 -0
- data/Rakefile +2 -0
- data/bin/frontsau +15 -0
- data/bin/frontsau-phaml-compiler +35 -0
- data/example/.frontsau +12 -0
- data/example/assets/head.jpg +0 -0
- data/example/assets/script.js +4 -0
- data/example/assets/style.css +6 -0
- data/example/css/includes.sass +2 -0
- data/example/css/style.sass +6 -0
- data/example/image/head.jpg +0 -0
- data/example/index.html +0 -0
- data/example/js/script.coffee +1 -0
- data/frontsau.gemspec +41 -0
- data/lib/Phamlp/Phamlp.php +72 -0
- data/lib/Phamlp/PhamlpException.php +31 -0
- data/lib/Phamlp/haml/HamlException.php +29 -0
- data/lib/Phamlp/haml/HamlHelpers.php +199 -0
- data/lib/Phamlp/haml/HamlParser.php +1250 -0
- data/lib/Phamlp/haml/filters/HamlBaseFilter.php +30 -0
- data/lib/Phamlp/haml/filters/HamlCdataFilter.php +29 -0
- data/lib/Phamlp/haml/filters/HamlCssFilter.php +30 -0
- data/lib/Phamlp/haml/filters/HamlEscapedFilter.php +32 -0
- data/lib/Phamlp/haml/filters/HamlJavascriptFilter.php +31 -0
- data/lib/Phamlp/haml/filters/HamlPhpFilter.php +27 -0
- data/lib/Phamlp/haml/filters/HamlPlainFilter.php +28 -0
- data/lib/Phamlp/haml/filters/HamlPreserveFilter.php +29 -0
- data/lib/Phamlp/haml/filters/HamlSassFilter.php +37 -0
- data/lib/Phamlp/haml/filters/HamlScssFilter.php +37 -0
- data/lib/Phamlp/haml/filters/_HamlMarkdownFilter.php +50 -0
- data/lib/Phamlp/haml/filters/_HamlTextileFilter.php +50 -0
- data/lib/Phamlp/haml/messages/_i18n.php +32 -0
- data/lib/Phamlp/haml/messages/de.php +32 -0
- data/lib/Phamlp/haml/messages/fr.php +32 -0
- data/lib/Phamlp/haml/renderers/HamlCompactRenderer.php +32 -0
- data/lib/Phamlp/haml/renderers/HamlCompressedRenderer.php +48 -0
- data/lib/Phamlp/haml/renderers/HamlExpandedRenderer.php +58 -0
- data/lib/Phamlp/haml/renderers/HamlNestedRenderer.php +77 -0
- data/lib/Phamlp/haml/renderers/HamlRenderer.php +137 -0
- data/lib/Phamlp/haml/tree/HamlCodeBlockNode.php +58 -0
- data/lib/Phamlp/haml/tree/HamlCommentNode.php +41 -0
- data/lib/Phamlp/haml/tree/HamlDoctypeNode.php +27 -0
- data/lib/Phamlp/haml/tree/HamlElementNode.php +52 -0
- data/lib/Phamlp/haml/tree/HamlFilterNode.php +50 -0
- data/lib/Phamlp/haml/tree/HamlHelperNode.php +73 -0
- data/lib/Phamlp/haml/tree/HamlNode.php +253 -0
- data/lib/Phamlp/haml/tree/HamlNodeExceptions.php +19 -0
- data/lib/Phamlp/haml/tree/HamlRootNode.php +58 -0
- data/lib/Phamlp/sass/SassException.php +29 -0
- data/lib/Phamlp/sass/SassFile.php +164 -0
- data/lib/Phamlp/sass/SassParser.php +848 -0
- data/lib/Phamlp/sass/extensions/compass/config.php +65 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/_blueprint.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +101 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_colors.scss +32 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_debug.scss +11 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +86 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_form.scss +68 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_grid.scss +249 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_ie.scss +109 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_interaction.scss +57 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_link-icons.scss +37 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_liquid.scss +147 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_print.scss +93 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_reset.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_rtl.scss +133 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_scaffolding.scss +54 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_typography.scss +104 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +37 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss +58 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/grid.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/ie.sass +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/manifest.rb +30 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/partials/_base.sass +10 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/print.sass +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/screen.sass +12 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons.sass +49 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/manifest.rb +17 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons.sass +13 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/manifest.rb +23 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/grid.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/ie.sass +16 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/manifest.rb +30 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/partials/_base.sass +11 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/print.sass +8 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/screen.sass +45 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/grid.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/ie.sass +16 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/manifest.rb +33 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_base.sass +10 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_form.sass +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_page.sass +18 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_two_col.sass +38 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/print.sass +5 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/screen.sass +14 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/_compass.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_css3.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_layout.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_reset.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_utilities.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +43 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +42 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-size.scss +14 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +135 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +50 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +13 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box.scss +112 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_columns.scss +55 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_font-face.scss +33 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_gradient.scss +82 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +12 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_opacity.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_shared.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_transform.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_transition.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/layout/_sticky-footer.scss +23 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/reset/_utilities.scss +133 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_general.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_links.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_lists.scss +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_print.scss +17 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_sprites.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_tables.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_text.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss +31 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +35 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_min.scss +16 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_reset.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_tabs.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_tag-cloud.scss +18 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_hover-link.scss +5 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_link-colors.scss +28 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_unstyled-link.scss +7 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.scss +34 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +52 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss +29 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +56 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_alternating-rows-and-columns.scss +20 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_scaffolding.scss +9 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_nowrap.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss +34 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/ellipsis.sass +9 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/manifest.rb +27 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/xml/ellipsis.xml +14 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/manifest.rb +20 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/stylesheets/main.sass +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/templates/project/manifest.rb +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/templates/project/screen.sass +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/USAGE.markdown +32 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/ie.sass +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/manifest.rb +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/print.sass +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/screen.sass +7 -0
- data/lib/Phamlp/sass/extensions/compass/functions/colourStops.php +268 -0
- data/lib/Phamlp/sass/extensions/compass/functions/constants.php +44 -0
- data/lib/Phamlp/sass/extensions/compass/functions/fontFiles.php +30 -0
- data/lib/Phamlp/sass/extensions/compass/functions/imageSize.php +39 -0
- data/lib/Phamlp/sass/extensions/compass/functions/inlineData.php +84 -0
- data/lib/Phamlp/sass/extensions/compass/functions/lists.php +47 -0
- data/lib/Phamlp/sass/extensions/compass/functions/selectors.php +128 -0
- data/lib/Phamlp/sass/extensions/compass/functions/urls.php +143 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/_compass.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_css3.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_layout.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_reset.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_utilities.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-clip.scss +43 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-origin.scss +42 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-size.scss +14 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_border-radius.scss +135 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box-shadow.scss +50 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box-sizing.scss +13 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box.scss +112 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_columns.scss +55 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_font-face.scss +33 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_gradient.scss +96 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_inline-block.scss +12 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_opacity.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_shared.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_text-shadow.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_transform.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_transition.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/layout/_sticky-footer.scss +23 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/reset/_utilities.scss +133 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_general.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_links.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_lists.scss +4 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_print.scss +17 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_sprites.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_tables.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_text.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_clearfix.scss +31 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_float.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_hacks.scss +35 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_min.scss +16 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_reset.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_tabs.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_tag-cloud.scss +18 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_hover-link.scss +5 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_link-colors.scss +28 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_unstyled-link.scss +7 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_bullets.scss +34 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +52 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_inline-list.scss +29 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +56 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_alternating-rows-and-columns.scss +20 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_borders.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_scaffolding.scss +9 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_ellipsis.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_nowrap.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_replacement.scss +34 -0
- data/lib/Phamlp/sass/messages/_i18n.php +122 -0
- data/lib/Phamlp/sass/messages/de.php +70 -0
- data/lib/Phamlp/sass/messages/fr.php +70 -0
- data/lib/Phamlp/sass/renderers/SassCompactRenderer.php +130 -0
- data/lib/Phamlp/sass/renderers/SassCompressedRenderer.php +102 -0
- data/lib/Phamlp/sass/renderers/SassExpandedRenderer.php +62 -0
- data/lib/Phamlp/sass/renderers/SassNestedRenderer.php +61 -0
- data/lib/Phamlp/sass/renderers/SassRenderer.php +51 -0
- data/lib/Phamlp/sass/script/SassScriptFunction.php +169 -0
- data/lib/Phamlp/sass/script/SassScriptFunctions.php +751 -0
- data/lib/Phamlp/sass/script/SassScriptLexer.php +114 -0
- data/lib/Phamlp/sass/script/SassScriptOperation.php +151 -0
- data/lib/Phamlp/sass/script/SassScriptParser.php +192 -0
- data/lib/Phamlp/sass/script/SassScriptParserExceptions.php +40 -0
- data/lib/Phamlp/sass/script/SassScriptVariable.php +57 -0
- data/lib/Phamlp/sass/script/literals/SassBoolean.php +67 -0
- data/lib/Phamlp/sass/script/literals/SassColour.php +886 -0
- data/lib/Phamlp/sass/script/literals/SassLiteral.php +359 -0
- data/lib/Phamlp/sass/script/literals/SassLiteralExceptions.php +47 -0
- data/lib/Phamlp/sass/script/literals/SassNumber.php +503 -0
- data/lib/Phamlp/sass/script/literals/SassString.php +106 -0
- data/lib/Phamlp/sass/tree/SassCommentNode.php +64 -0
- data/lib/Phamlp/sass/tree/SassContext.php +120 -0
- data/lib/Phamlp/sass/tree/SassDebugNode.php +84 -0
- data/lib/Phamlp/sass/tree/SassDirectiveNode.php +76 -0
- data/lib/Phamlp/sass/tree/SassElseNode.php +28 -0
- data/lib/Phamlp/sass/tree/SassExtendNode.php +47 -0
- data/lib/Phamlp/sass/tree/SassForNode.php +99 -0
- data/lib/Phamlp/sass/tree/SassIfNode.php +95 -0
- data/lib/Phamlp/sass/tree/SassImportNode.php +69 -0
- data/lib/Phamlp/sass/tree/SassMixinDefinitionNode.php +88 -0
- data/lib/Phamlp/sass/tree/SassMixinNode.php +91 -0
- data/lib/Phamlp/sass/tree/SassNode.php +342 -0
- data/lib/Phamlp/sass/tree/SassNodeExceptions.php +117 -0
- data/lib/Phamlp/sass/tree/SassPropertyNode.php +239 -0
- data/lib/Phamlp/sass/tree/SassRootNode.php +100 -0
- data/lib/Phamlp/sass/tree/SassRuleNode.php +337 -0
- data/lib/Phamlp/sass/tree/SassVariableNode.php +90 -0
- data/lib/Phamlp/sass/tree/SassWhileNode.php +64 -0
- data/lib/frontsau/assets/rack.rb +12 -0
- data/lib/frontsau/assets/sprockets.rb +59 -0
- data/lib/frontsau/assets/static_assets_compiler.rb +50 -0
- data/lib/frontsau/assets/url_rewriter.rb +22 -0
- data/lib/frontsau/assets/watcher.rb +60 -0
- data/lib/frontsau/thor_app.rb +118 -0
- data/lib/frontsau/version.rb +3 -0
- data/lib/frontsau.rb +64 -0
- metadata +578 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 16be555ed6591347ba2ba8230a09c03ae2333496
|
4
|
+
data.tar.gz: 4edc1772dc8ec82d1436174497bc972a8fa83df4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9b1d630cc9d4a598b1591aaf843b4bcc71058c14d9add2e4671d8ae5526ec802f380766077c4dcc10adc5ff4ab9fc2decc72d3ff84cd46d80132a5325b8d08f6
|
7
|
+
data.tar.gz: b2d9c9e9d51eb22c11363199037f0bd9e7c2f0b57eb4a19ec0e1e2c41fb5d70228ef6f77286ca1714a8f5f4031e835def5da1f8c20676a5174259636e01b24d2
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) <year> <copyright holders>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Frontsau
|
2
|
+
|
3
|
+
A small web development tool to assist with coffeescript, sass, less, haml, image assets.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
# NOT IMPLEMENTED YET
|
8
|
+
$ gem install frontsau
|
9
|
+
|
10
|
+
And then go to your webapps project root:
|
11
|
+
|
12
|
+
$ frontsau init
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
Frontsau supports the follogin commands:
|
17
|
+
|
18
|
+
$ frontsau debug
|
19
|
+
$ frontsau server
|
20
|
+
$ frontsau compile
|
21
|
+
$ frontsau watch
|
22
|
+
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
|
26
|
+
1. Fork it ( https://github.com/[my-github-username]/frontsau/fork )
|
27
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
28
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
29
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
30
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/frontsau
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'thor'
|
4
|
+
require 'pry'
|
5
|
+
require 'yaml'
|
6
|
+
require 'active_support'
|
7
|
+
require 'active_support/all'
|
8
|
+
require 'frontsau'
|
9
|
+
require 'frontsau/thor_app'
|
10
|
+
|
11
|
+
|
12
|
+
Frontsau.init File.expand_path('.')
|
13
|
+
|
14
|
+
Frontsau::ThorApp.start
|
15
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env php
|
2
|
+
<?php
|
3
|
+
|
4
|
+
if(!isset($argv[1])){
|
5
|
+
echo "No input file specified!\n";
|
6
|
+
exit(1);
|
7
|
+
}
|
8
|
+
|
9
|
+
|
10
|
+
$input_file = $argv[1];
|
11
|
+
$output_file = preg_replace("/\\.haml/",'.php', $input_file);
|
12
|
+
|
13
|
+
if(!is_file($input_file)){
|
14
|
+
echo "Input file '$input_file' does not exist.";
|
15
|
+
exit(1);
|
16
|
+
}
|
17
|
+
|
18
|
+
define('PIMTOOL_ROOT', dirname(dirname(__FILE__)));
|
19
|
+
|
20
|
+
require PIMTOOL_ROOT.'/lib/Phamlp/Phamlp.php';
|
21
|
+
require PIMTOOL_ROOT.'/lib/Phamlp/haml/HamlParser.php';
|
22
|
+
|
23
|
+
$haml = new HamlParser(array(
|
24
|
+
'style' =>'expanded',
|
25
|
+
'ugly' =>false
|
26
|
+
));
|
27
|
+
|
28
|
+
$xhtml = $haml->parse($input_file);
|
29
|
+
|
30
|
+
echo $xhtml;
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
data/example/.frontsau
ADDED
Binary file
|
Binary file
|
data/example/index.html
ADDED
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
alert "Hehe"
|
data/frontsau.gemspec
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'frontsau/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "frontsau"
|
8
|
+
spec.version = Frontsau::VERSION
|
9
|
+
spec.authors = ["Benjamin Seibert"]
|
10
|
+
spec.email = ["benjamin.seibert@roomthirteen.de"]
|
11
|
+
spec.summary = %q{Frontsau, the new kid in frontend dev.}
|
12
|
+
spec.description = "Frontsau brings coffeescript, sass, less to any webapplication without big need of modifying it. No matter if your using wordpress, joomla, zend (only for the php ones)... and many more."
|
13
|
+
spec.homepage = "http://roomthirteen.de"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "filewatcher", "~> 0.3"
|
22
|
+
spec.add_dependency "rb-fsevent", "~> 0.9"
|
23
|
+
spec.add_dependency "coffee-script", "~> 2.3"
|
24
|
+
spec.add_dependency "sass", "~> 3.4"
|
25
|
+
spec.add_dependency "less", "~> 2.6"
|
26
|
+
spec.add_dependency "libv8", "~> 3.16"
|
27
|
+
spec.add_dependency "therubyracer", "~> 0.12"
|
28
|
+
spec.add_dependency "sprockets", "~> 2.12"
|
29
|
+
spec.add_dependency "sinatra", "~> 1.4"
|
30
|
+
spec.add_dependency "sinatra-contrib", "~> 1.4"
|
31
|
+
spec.add_dependency "thor", "~> 0.19.1"
|
32
|
+
spec.add_dependency "activesupport", "~> 4.2"
|
33
|
+
spec.add_dependency "rack", "~> 1.6"
|
34
|
+
spec.add_dependency "rack-cors", "~> 0.3"
|
35
|
+
spec.add_dependency "ruby-progressbar", "~> 1.7"
|
36
|
+
|
37
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
38
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
39
|
+
spec.add_development_dependency "pry", "~> 0.10.1"
|
40
|
+
|
41
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: HamlException.php 61 2010-04-16 10:19:59Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Phamlp.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
*/
|
10
|
+
/**
|
11
|
+
* Phamlp class.
|
12
|
+
* Static support classes.
|
13
|
+
* @package PHamlP
|
14
|
+
*/
|
15
|
+
class Phamlp {
|
16
|
+
/**
|
17
|
+
* @var string Language used to translate messages
|
18
|
+
*/
|
19
|
+
public static $language;
|
20
|
+
/**
|
21
|
+
* @var array Messages used for translation
|
22
|
+
*/
|
23
|
+
public static $messages;
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Translates a message to the specified language.
|
27
|
+
* @param string message category.
|
28
|
+
* @param string the original message
|
29
|
+
* @param array parameters to be applied to the message using <code>strtr</code>.
|
30
|
+
* @return string the translated message
|
31
|
+
*/
|
32
|
+
public static function t($category, $message, $params = array()) {
|
33
|
+
if (!empty(self::$language)) {
|
34
|
+
$message = self::translate($category, $message);
|
35
|
+
}
|
36
|
+
return $params!==array() ? strtr($message,$params) : $message;
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Translates a message to the specified language.
|
41
|
+
* If the language or the message in the specified language is not defined the
|
42
|
+
* original message is returned.
|
43
|
+
* @param string message category
|
44
|
+
* @param string the original message
|
45
|
+
* @return string the translated message
|
46
|
+
*/
|
47
|
+
private static function translate($category, $message) {
|
48
|
+
if (empty(self::$messages[$category])) self::loadMessages($category);
|
49
|
+
return (empty(self::$messages[$category][$message]) ? $message : self::$messages[$category][$message]);
|
50
|
+
}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Loads the specified language message file for translation.
|
54
|
+
* Message files are PHP files in the "category/messages" directory and named
|
55
|
+
* "language.php", where category is either haml or sass, and language is the
|
56
|
+
* specified language.
|
57
|
+
* The message file returns an array of (source, translation) pairs; for example:
|
58
|
+
* <pre>
|
59
|
+
* return array(
|
60
|
+
* 'original message 1' => 'translated message 1',
|
61
|
+
* 'original message 2' => 'translated message 2',
|
62
|
+
* );
|
63
|
+
* </pre>
|
64
|
+
* @param string message category
|
65
|
+
*/
|
66
|
+
private static function loadMessages($category) {
|
67
|
+
$messageFile = dirname(__FILE__).DIRECTORY_SEPARATOR.$category.DIRECTORY_SEPARATOR.'messages'.DIRECTORY_SEPARATOR.self::$language.'.php';
|
68
|
+
if (file_exists($messageFile)) {
|
69
|
+
self::$messages[$category] = require_once($messageFile);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: HamlException.php 61 2010-04-16 10:19:59Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Phamlp exception.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
*/
|
10
|
+
|
11
|
+
require_once('Phamlp.php');
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Phamlp exception class.
|
15
|
+
* Base class for PHamlP::Haml and PHamlP::Sass exceptions.
|
16
|
+
* Translates exception messages.
|
17
|
+
* @package PHamlP
|
18
|
+
*/
|
19
|
+
class PhamlpException extends Exception {
|
20
|
+
/**
|
21
|
+
* Phamlp Exception.
|
22
|
+
* @param string Category (haml|sass)
|
23
|
+
* @param string Exception message
|
24
|
+
* @param array parameters to be applied to the message using <code>strtr</code>.
|
25
|
+
*/
|
26
|
+
public function __construct($category, $message, $params, $object) {
|
27
|
+
parent::__construct(Phamlp::t($category, $message, $params) .
|
28
|
+
(is_object($object) ? ": {$object->filename}::{$object->line}\nSource: {$object->source}" : '')
|
29
|
+
);
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: HamlException.php 61 2010-04-16 10:19:59Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Haml exception.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
* @subpackage Haml
|
10
|
+
*/
|
11
|
+
|
12
|
+
require_once(dirname(__FILE__).'/../PhamlpException.php');
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Haml exception class.
|
16
|
+
* @package PHamlP
|
17
|
+
* @subpackage Haml
|
18
|
+
*/
|
19
|
+
class HamlException extends PhamlpException {
|
20
|
+
/**
|
21
|
+
* Haml Exception.
|
22
|
+
* @param string Exception message
|
23
|
+
* @param array parameters to be applied to the message using <code>strtr</code>.
|
24
|
+
* @param object object with source code and meta data
|
25
|
+
*/
|
26
|
+
public function __construct($message, $params = array(), $object = null) {
|
27
|
+
parent::__construct('haml', $message, $params, $object);
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,199 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: HamlHelpers.php 92 2010-05-20 17:42:59Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* HamlHelpers class file.
|
5
|
+
*
|
6
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
7
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
8
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
9
|
+
* @package PHamlP
|
10
|
+
* @subpackage Haml
|
11
|
+
*/
|
12
|
+
|
13
|
+
/**
|
14
|
+
* HamlHelpers class.
|
15
|
+
* Contains methods to make it easier to do various tasks.
|
16
|
+
*
|
17
|
+
* The class can be extended to provide user defined helper methods. The
|
18
|
+
* signature for user defined helper methods is ($block, $other, $arguments);
|
19
|
+
* $block is the string generated by the Haml block being operated on.
|
20
|
+
*
|
21
|
+
* Tthe path to the extended class is provided to HamlParser in the config
|
22
|
+
* array; class name == file name.
|
23
|
+
*
|
24
|
+
* HamlHelpers and any extended class are automatically included in the context
|
25
|
+
* that a Haml template is parsed in, so all the methods are at your disposal
|
26
|
+
* from within the template.
|
27
|
+
*
|
28
|
+
* @package PHamlP
|
29
|
+
* @subpackage Haml
|
30
|
+
*/
|
31
|
+
class HamlHelpers {
|
32
|
+
const XMLNS = 'http://www.w3.org/1999/xhtml';
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Returns the block with string appended.
|
36
|
+
* @see succeed
|
37
|
+
* @param string Haml block
|
38
|
+
* @param string string to append
|
39
|
+
* @return string the block with string appended.
|
40
|
+
*/
|
41
|
+
public static function append($block, $string) {
|
42
|
+
return $block.$string;
|
43
|
+
}
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Escapes HTML entities in text, but without escaping an ampersand that is
|
47
|
+
* already part of an escaped entity.
|
48
|
+
* @param string Haml block
|
49
|
+
* @return string the block with HTML entities escaped.
|
50
|
+
*/
|
51
|
+
public static function escape_once($block) {
|
52
|
+
return htmlentities(html_entity_decode($block));
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Returns an array containing default assignments for the xmlns, lang, and
|
57
|
+
* xml:lang attributes of the html element.
|
58
|
+
* This helper method is for use in the html element only.
|
59
|
+
*
|
60
|
+
* Examples:<br/>
|
61
|
+
* %html(html_attrs())<br/>
|
62
|
+
* produces<br/>
|
63
|
+
* <html lang="en-us" xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">
|
64
|
+
*
|
65
|
+
* %html(html_attrs('en-gb'))<br/>
|
66
|
+
* produces<br/>
|
67
|
+
* <html lang="en-gb" xml:lang="en-gb" xmlns="http://www.w3.org/1999/xhtml">
|
68
|
+
*
|
69
|
+
* %html(html_attrs('en-gb', false))<br/>
|
70
|
+
* produces<br/>
|
71
|
+
* <html xml:lang="en-gb" xmlns="http://www.w3.org/1999/xhtml">
|
72
|
+
*
|
73
|
+
* Although handled in HamlParser, the notes below are here for completeness.<br/>
|
74
|
+
* Other attributes are defined as normal. e.g.<br/>
|
75
|
+
* %html(xmlns:me="http://www.example.com/me" html_attrs('en-gb', false))<br/>
|
76
|
+
* produces<br/>
|
77
|
+
* <html xml:lang="en-gb" xmlns="http://www.w3.org/1999/xhtml" xmlns:me="http://www.example.com/me">
|
78
|
+
*
|
79
|
+
* PHamlP also allows for the language to be defined using PHP code that can
|
80
|
+
* be eval'd; the code must end with a semi-colon (;). e.g.<br/>
|
81
|
+
* %html(html_attrs("FW::app()->language);", false))<br/>
|
82
|
+
* produces (assuming FW::app()->language returns 'en-gb')<br/>
|
83
|
+
* <html xml:lang="en-gb" xmlns="http://www.w3.org/1999/xhtml">
|
84
|
+
*
|
85
|
+
* @param string document language. Default = en-us
|
86
|
+
* @param boolean whether the html element has the lang attribute. Default: true
|
87
|
+
* Should be set false for XHTML 1.1 or greater documents
|
88
|
+
* @return string the block with string appended.
|
89
|
+
*/
|
90
|
+
public static function html_attrs($language = 'en-us', $lang = true) {
|
91
|
+
return ($lang ?
|
92
|
+
array('xmlns'=>self::XMLNS, 'xml:lang'=>$language, 'lang'=>$language) :
|
93
|
+
array('xmlns'=>self::XMLNS, 'xml:lang'=>$language));
|
94
|
+
}
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Returns a copy of text with ampersands, angle brackets and quotes escaped
|
98
|
+
* into HTML entities.
|
99
|
+
* @param string Haml block
|
100
|
+
* @return string the block with HTML entities escaped.
|
101
|
+
*/
|
102
|
+
public static function html_escape($block) {
|
103
|
+
return htmlspecialchars($block);
|
104
|
+
}
|
105
|
+
|
106
|
+
/**
|
107
|
+
* Iterates an array and using the block to generate a <li> element for each
|
108
|
+
* array element.
|
109
|
+
* Examples:<br/>
|
110
|
+
* = list_of(array('red', 'orange', ...., 'violet'), 'colour')<br/>
|
111
|
+
* = colour<br/>
|
112
|
+
* Produces:<br/>
|
113
|
+
* <li>red</li><br/>
|
114
|
+
* <li>orange</li><br/>
|
115
|
+
* |<br/>
|
116
|
+
* |<br/>
|
117
|
+
* <li>violet></li><br/>
|
118
|
+
*
|
119
|
+
* = list_of(array('Fly Fishing' => 'JR Hartley', 'Lord of the Rings' => 'JRR Tolkien'), 'title', 'author')<br/>
|
120
|
+
* %h3= title<br/>
|
121
|
+
* %p= author<br/>
|
122
|
+
* Produces:<br/>
|
123
|
+
* <li><br/>
|
124
|
+
* <h3>Fly Fishing</h3><br/>
|
125
|
+
* <p>JR Hartley</p><br/>
|
126
|
+
* </li><br/>
|
127
|
+
* <li><br/>
|
128
|
+
* <h3>Lord of the Rings</h3><br/>
|
129
|
+
* <p>JRR Tolkien</p><br/>
|
130
|
+
* </li><br/>
|
131
|
+
*
|
132
|
+
* @param string Haml block
|
133
|
+
* @param array items
|
134
|
+
* @param string string in block to replace with item key or item value
|
135
|
+
* @param string string in block to replace with item value
|
136
|
+
* @return string list items.
|
137
|
+
*/
|
138
|
+
public static function list_of($block, $items, $key, $value = null) {
|
139
|
+
$output = '';
|
140
|
+
foreach ($items as $_key=>$_value) {
|
141
|
+
$output .= '<li>' . strtr($block, (empty($value) ? array($key=>$_value) :
|
142
|
+
array($key=>$_key, $value=>$_value))) . '</li>';
|
143
|
+
} // foreach
|
144
|
+
return $output;
|
145
|
+
}
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Alias for prepend.
|
149
|
+
* @see prepend
|
150
|
+
* @param string Haml block
|
151
|
+
* @param string string to prepend
|
152
|
+
* @return string the block with string prepended
|
153
|
+
*/
|
154
|
+
public static function preceed($block, $string) {
|
155
|
+
return self::prepend($block, $string);
|
156
|
+
}
|
157
|
+
|
158
|
+
/**
|
159
|
+
* Returns the block with string prepended.
|
160
|
+
* @param string Haml block
|
161
|
+
* @param string string to prepend
|
162
|
+
* @return string the block with string prepended
|
163
|
+
*/
|
164
|
+
public static function prepend($block, $string) {
|
165
|
+
return $string.$block;
|
166
|
+
}
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Converts newlines in the block to HTML entities.
|
170
|
+
* @param string Haml block
|
171
|
+
* @return string the block with newlines converted to HTML entities
|
172
|
+
*/
|
173
|
+
public static function preserve($block) {
|
174
|
+
return str_replace("\n", '
', $block);
|
175
|
+
}
|
176
|
+
|
177
|
+
/**
|
178
|
+
* Alias for append.
|
179
|
+
* @see append
|
180
|
+
* @param string Haml block
|
181
|
+
* @param string string to apppend
|
182
|
+
* @return string the block with string apppended
|
183
|
+
*/
|
184
|
+
public static function succeed($block, $string) {
|
185
|
+
return self::append($block, $string);
|
186
|
+
}
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Surrounds a block of Haml code with strings.
|
190
|
+
* If $back is not given it defaults to $front.
|
191
|
+
* @param string Haml block
|
192
|
+
* @param string string to prepend
|
193
|
+
* @param string string to apppend
|
194
|
+
* @return string the block surrounded by the strings
|
195
|
+
*/
|
196
|
+
public static function surround($block, $front, $back=null) {
|
197
|
+
return $front.$block.(is_null($back) ? $front : $back);
|
198
|
+
}
|
199
|
+
}
|