guard-mthaml 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +34 -0
- data/lib/guard/mthaml.rb +140 -0
- data/lib/guard/mthaml/compiler/MtHaml.php +255 -0
- data/lib/guard/mthaml/templates/Guardfile +12 -0
- data/lib/guard/mthaml/version.rb +5 -0
- data/vendor/autoload.php +7 -0
- data/vendor/coffeescript/coffeescript/LICENSE +22 -0
- data/vendor/coffeescript/coffeescript/README.md +96 -0
- data/vendor/coffeescript/coffeescript/composer.json +23 -0
- data/vendor/coffeescript/coffeescript/grammar.y +309 -0
- data/vendor/coffeescript/coffeescript/make.php +115 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Compiler.php +76 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Error.php +15 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Helpers.php +116 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Init.php +96 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Lexer.php +1356 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Nodes.php +105 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Parser.php +3326 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Rewriter.php +552 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Scope.php +196 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/SyntaxError.php +9 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/Value.php +20 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Access.php +31 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php +69 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Assign.php +353 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Base.php +288 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Block.php +294 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Call.php +283 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Class.php +282 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Closure.php +49 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Code.php +203 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Comment.php +39 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Existence.php +42 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Extends.php +26 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/For.php +250 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/If.php +161 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/In.php +99 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Index.php +27 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Literal.php +96 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Obj.php +126 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Op.php +292 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Param.php +119 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Parens.php +45 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Range.php +225 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Return.php +56 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Slice.php +47 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Splat.php +100 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Switch.php +121 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Throw.php +37 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Try.php +79 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Value.php +210 -0
- data/vendor/coffeescript/coffeescript/src/CoffeeScript/yy/While.php +112 -0
- data/vendor/coffeescript/coffeescript/tests/cases/arrays.coffee +77 -0
- data/vendor/coffeescript/coffeescript/tests/cases/assignment.coffee +352 -0
- data/vendor/coffeescript/coffeescript/tests/cases/booleans.coffee +21 -0
- data/vendor/coffeescript/coffeescript/tests/cases/classes.coffee +681 -0
- data/vendor/coffeescript/coffeescript/tests/cases/comments.coffee +207 -0
- data/vendor/coffeescript/coffeescript/tests/cases/compilation.coffee +72 -0
- data/vendor/coffeescript/coffeescript/tests/cases/comprehensions.coffee +501 -0
- data/vendor/coffeescript/coffeescript/tests/cases/control_flow.coffee +430 -0
- data/vendor/coffeescript/coffeescript/tests/cases/eval.coffee +29 -0
- data/vendor/coffeescript/coffeescript/tests/cases/exception_handling.coffee +102 -0
- data/vendor/coffeescript/coffeescript/tests/cases/formatting.coffee +146 -0
- data/vendor/coffeescript/coffeescript/tests/cases/function_invocation.coffee +552 -0
- data/vendor/coffeescript/coffeescript/tests/cases/functions.coffee +188 -0
- data/vendor/coffeescript/coffeescript/tests/cases/helpers.coffee +96 -0
- data/vendor/coffeescript/coffeescript/tests/cases/importing.coffee +18 -0
- data/vendor/coffeescript/coffeescript/tests/cases/interpolation.coffee +138 -0
- data/vendor/coffeescript/coffeescript/tests/cases/javascript_literals.coffee +10 -0
- data/vendor/coffeescript/coffeescript/tests/cases/numbers.coffee +76 -0
- data/vendor/coffeescript/coffeescript/tests/cases/objects.coffee +271 -0
- data/vendor/coffeescript/coffeescript/tests/cases/operators.coffee +277 -0
- data/vendor/coffeescript/coffeescript/tests/cases/option_parser.coffee +43 -0
- data/vendor/coffeescript/coffeescript/tests/cases/ranges.coffee +88 -0
- data/vendor/coffeescript/coffeescript/tests/cases/regexps.coffee +63 -0
- data/vendor/coffeescript/coffeescript/tests/cases/scope.coffee +43 -0
- data/vendor/coffeescript/coffeescript/tests/cases/slicing_and_splicing.coffee +143 -0
- data/vendor/coffeescript/coffeescript/tests/cases/soaks.coffee +134 -0
- data/vendor/coffeescript/coffeescript/tests/cases/strict.coffee +155 -0
- data/vendor/coffeescript/coffeescript/tests/cases/strings.coffee +107 -0
- data/vendor/coffeescript/coffeescript/tests/css/style.css +43 -0
- data/vendor/coffeescript/coffeescript/tests/index.php +119 -0
- data/vendor/coffeescript/coffeescript/tests/js/lib/coffeescript_1.1.1.js +8 -0
- data/vendor/coffeescript/coffeescript/tests/js/lib/coffeescript_1.2.0.js +8 -0
- data/vendor/coffeescript/coffeescript/tests/js/lib/coffeescript_1.3.0.js +8 -0
- data/vendor/coffeescript/coffeescript/tests/js/lib/coffeescript_1.3.1.js +8 -0
- data/vendor/coffeescript/coffeescript/tests/js/lib/diff.js +276 -0
- data/vendor/coffeescript/coffeescript/tests/js/main.js +123 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/LICENSE.txt +10 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/Lempar.php +948 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Action.php +257 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/ActionTable.php +299 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Config.php +574 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Data.php +1857 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Parser.php +851 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/PropagationLink.php +126 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Rule.php +144 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/State.php +283 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/Symbol.php +288 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/PHP/ParserGenerator/cli.php +5 -0
- data/vendor/coffeescript/coffeescript/vendor/ParserGenerator/ParserGenerator.php +811 -0
- data/vendor/composer/ClassLoader.php +383 -0
- data/vendor/composer/autoload_classmap.php +9 -0
- data/vendor/composer/autoload_namespaces.php +12 -0
- data/vendor/composer/autoload_psr4.php +10 -0
- data/vendor/composer/autoload_real.php +50 -0
- data/vendor/composer/installed.json +166 -0
- data/vendor/michelf/php-markdown/License.md +36 -0
- data/vendor/michelf/php-markdown/Michelf/Markdown.inc.php +10 -0
- data/vendor/michelf/php-markdown/Michelf/Markdown.php +3117 -0
- data/vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php +11 -0
- data/vendor/michelf/php-markdown/Michelf/MarkdownExtra.php +38 -0
- data/vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php +9 -0
- data/vendor/michelf/php-markdown/Michelf/MarkdownInterface.php +37 -0
- data/vendor/michelf/php-markdown/Readme.md +305 -0
- data/vendor/michelf/php-markdown/Readme.php +31 -0
- data/vendor/michelf/php-markdown/composer.json +31 -0
- data/vendor/mthaml/mthaml/CHANGELOG +48 -0
- data/vendor/mthaml/mthaml/LICENSE +44 -0
- data/vendor/mthaml/mthaml/README.markdown +262 -0
- data/vendor/mthaml/mthaml/composer.json +45 -0
- data/vendor/mthaml/mthaml/docs/Makefile +153 -0
- data/vendor/mthaml/mthaml/docs/_static/mthaml.css +30 -0
- data/vendor/mthaml/mthaml/docs/_theme/mthaml/theme.conf +4 -0
- data/vendor/mthaml/mthaml/docs/conf.py +242 -0
- data/vendor/mthaml/mthaml/docs/index.rst +18 -0
- data/vendor/mthaml/mthaml/docs/twig-syntax.rst +274 -0
- data/vendor/mthaml/mthaml/examples/README.md +5 -0
- data/vendor/mthaml/mthaml/examples/autoload.php +8 -0
- data/vendor/mthaml/mthaml/examples/example-php.haml +5 -0
- data/vendor/mthaml/mthaml/examples/example-php.php +37 -0
- data/vendor/mthaml/mthaml/examples/example-twig-noext.twig +11 -0
- data/vendor/mthaml/mthaml/examples/example-twig.haml +9 -0
- data/vendor/mthaml/mthaml/examples/example-twig.php +60 -0
- data/vendor/mthaml/mthaml/examples/example.twig.haml +8 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Autoloader.php +22 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Environment.php +178 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Escaping.php +33 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Exception.php +9 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Exception/SyntaxErrorException.php +9 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/AbstractFilter.php +43 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Cdata.php +16 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/CoffeeScript.php +33 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Css.php +26 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Escaped.php +22 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/FilterInterface.php +15 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Javascript.php +26 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php +27 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Less/LeafoLess.php +20 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Less/OyejorgeLess.php +23 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Markdown.php +58 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Markdown/CebeMarkdown.php +22 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Markdown/Ciconia.php +21 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Markdown/MichelfMarkdown.php +21 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Markdown/Parsedown.php +21 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Php.php +37 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Plain.php +24 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Preserve.php +19 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Scss.php +37 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Filter/Twig.php +47 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Indentation/Indentation.php +96 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Indentation/IndentationException.php +9 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Indentation/IndentationInterface.php +50 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php +41 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Comment.php +71 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Doctype.php +96 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/EscapableAbstract.php +19 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Filter.php +51 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Insert.php +42 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/InterpolatedString.php +73 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/NestAbstract.php +117 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/NestInterface.php +10 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/NodeAbstract.php +77 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/ObjectRefClass.php +42 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/ObjectRefId.php +42 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Root.php +35 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Run.php +71 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Statement.php +45 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Tag.php +90 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/TagAttribute.php +62 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/TagAttributeInterpolation.php +24 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/TagAttributeList.php +24 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Node/Text.php +37 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/Autoclose.php +25 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/Escaping.php +105 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/MergeAttrs.php +110 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/Midblock.php +37 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/NodeVisitorAbstract.php +226 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/NodeVisitorInterface.php +97 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/PhpRenderer.php +288 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/Printer.php +265 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/RendererAbstract.php +581 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/NodeVisitor/TwigRenderer.php +252 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Parser.php +862 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Parser/Buffer.php +147 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Runtime.php +218 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Runtime/AttributeInterpolation.php +16 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Runtime/AttributeList.php +16 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Support/Php/Executor.php +157 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Support/Twig/Extension.php +47 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Support/Twig/Lexer.php +48 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Support/Twig/Loader.php +81 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Target/Php.php +23 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Target/TargetAbstract.php +87 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Target/TargetInterface.php +12 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/Target/Twig.php +23 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/TreeBuilder.php +100 -0
- data/vendor/mthaml/mthaml/lib/MtHaml/TreeBuilderException.php +9 -0
- data/vendor/mthaml/mthaml/phpunit.xml +25 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/EnvironmentTest.php +59 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/HamlSpecTest.php +83 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/IndentationTest.php +140 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/Node/DoctypeTest.php +51 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/Node/NodeTest.php +110 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/NodeVisitor/PhpRendererTest.php +113 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/NodeVisitor/TwigRendererTest.php +68 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/NodeVisitorsTest.php +44 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/Parser/BufferTest.php +77 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/ParserTest.php +47 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/RuntimeTest.php +356 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/Support/Php/ExecutorTest.php +83 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/Support/Twig/LoaderTest.php +65 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/TestCase.php +49 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php +50 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/Support/Php/Executor.001.haml +1 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/attr_list_php.test +20 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/attr_list_twig.test +12 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/boolean_attr_php.test +16 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/boolean_attr_twig.test +16 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/bug28_php.test +15 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/bug28_twig.test +15 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/bug42.test +13 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/bug8_twig.test +10 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/coffeescript_filter.test +31 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/comments.test +26 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/cond_cmt.test +25 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype.test +18 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype_html4.test +20 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype_invalid.test +12 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype_invalid_xhtml.test +12 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype_php.test +18 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/doctype_xhtml.test +30 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/filters.test +51 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/insert_non_echo_php.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/insert_non_echo_twig.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/interpolation_in_html_attrs_php.test +31 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/interpolation_in_html_attrs_twig.test +31 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/less_filter_leafo.test +33 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/less_filter_oyejorge.test +49 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/markdown_filter_cebemarkdown.test +35 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/markdown_filter_ciconia.test +36 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/markdown_filter_michelf.test +34 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/markdown_filter_parsedown.test +31 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/markdown_optimization_filter_michelf.test +23 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/mergeattrs.test +18 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/nuke_inner_whitespace.test +77 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/nuke_outer_whitespace.test +122 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/object_ref_php.test +14 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/object_ref_twig.test +14 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php.test +109 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping.test +22 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_autoescaping_once.test +25 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_blocks.test +29 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/php_filters.test +42 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/scss_filter.test +32 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/strip_inline_comments_php.test +22 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/test.test +24 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/trailing_semicolon_php.test +14 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/try_catch_php.test +17 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/twig.test +112 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/twig_blocks.test +29 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/twig_filters.test +37 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/twig_whitespace.test +32 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/environment/whitespace.test +63 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/autoclose.test +30 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/escaping.test +52 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/escaping_attr_once.test +52 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/escaping_html_false.test +52 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/mergeattrs.test +26 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/midblock.test +54 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/nodevisitors/midblock_002.test +32 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/attr_list.test +14 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/attrs.test +42 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/attrs_002.test +35 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/attrs_003.test +30 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/attrs_html_linebreak.test +17 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/blocks.test +27 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/blocks_002.test +15 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/boolean_attr.test +19 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/bug28.test +15 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/bug8.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/cond_cmt.test +23 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/doctype.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/double_equal.test +7 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/empty_line_after_multiline.test +10 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_001.test +8 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_002.test +8 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_003.test +8 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_004.test +6 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_005.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_006.test +7 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_007.test +7 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_008.test +7 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_009.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_010.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_013.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_016.test +7 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_017.test +8 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_018.test +6 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_019.test +6 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/errors_020.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters.test +20 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters_002.test +19 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters_003.test +13 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters_004.test +21 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters_005.test +22 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/filters_006.test +23 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/insertflags.test +17 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/interpolation.test +36 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/interpolation_in_html_attrs.test +17 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/multiline.test +18 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/multiline_code.test +59 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/multiple_attr_kinds.test +47 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/non_rendered_comment.test +31 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ns.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/object_ref.test +22 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/object_ref_error1.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/object_ref_error2.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/quotes_in_haml.test +10 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ruby19_attrs.test +11 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ruby_attrs_comma.test +23 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ruby_attrs_comma_errors_001.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ruby_attrs_comma_errors_002.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/ruby_attrs_comma_errors_003.test +5 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/standard.test +114 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/parser/tagflags.test +39 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/runtime/php_filters.test +28 -0
- data/vendor/mthaml/mthaml/test/MtHaml/Tests/fixtures/runtime/twig_filters.test +31 -0
- data/vendor/mthaml/mthaml/test/bootstrap.php +3 -0
- metadata +398 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
@import "default.css";
|
3
|
+
|
4
|
+
.container.code-cols ul.simple em {
|
5
|
+
font-size: small;
|
6
|
+
}
|
7
|
+
|
8
|
+
.container.code-cols .highlight-html\+jinja, .container.code-cols .highlight-haml {
|
9
|
+
width: 46%;
|
10
|
+
margin: 0 2% 0 0;
|
11
|
+
display: inline-block;
|
12
|
+
vertical-align: top;
|
13
|
+
}
|
14
|
+
|
15
|
+
.container.code-cols .highlight-html\+jinja:before {
|
16
|
+
content: "Twig";
|
17
|
+
font-size: small;
|
18
|
+
font-style: italic;
|
19
|
+
}
|
20
|
+
|
21
|
+
.container.code-cols .highlight-haml:before {
|
22
|
+
content: "Haml";
|
23
|
+
font-size: small;
|
24
|
+
font-style: italic;
|
25
|
+
}
|
26
|
+
|
27
|
+
.container.code-cols pre {
|
28
|
+
margin-top: 0;
|
29
|
+
}
|
30
|
+
|
@@ -0,0 +1,242 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# MtHaml documentation build configuration file, created by
|
4
|
+
# sphinx-quickstart on Fri Sep 13 21:55:33 2013.
|
5
|
+
#
|
6
|
+
# This file is execfile()d with the current directory set to its containing dir.
|
7
|
+
#
|
8
|
+
# Note that not all possible configuration values are present in this
|
9
|
+
# autogenerated file.
|
10
|
+
#
|
11
|
+
# All configuration values have a default; values that are commented out
|
12
|
+
# serve to show the default.
|
13
|
+
|
14
|
+
import sys, os
|
15
|
+
|
16
|
+
# If extensions (or modules to document with autodoc) are in another directory,
|
17
|
+
# add these directories to sys.path here. If the directory is relative to the
|
18
|
+
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
19
|
+
sys.path.insert(0, os.path.abspath('_exts'))
|
20
|
+
|
21
|
+
# -- General configuration -----------------------------------------------------
|
22
|
+
|
23
|
+
# If your documentation needs a minimal Sphinx version, state it here.
|
24
|
+
#needs_sphinx = '1.0'
|
25
|
+
|
26
|
+
# Add any Sphinx extension module names here, as strings. They can be extensions
|
27
|
+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
28
|
+
extensions = []
|
29
|
+
|
30
|
+
# Add any paths that contain templates here, relative to this directory.
|
31
|
+
templates_path = ['_templates']
|
32
|
+
|
33
|
+
# The suffix of source filenames.
|
34
|
+
source_suffix = '.rst'
|
35
|
+
|
36
|
+
# The encoding of source files.
|
37
|
+
#source_encoding = 'utf-8-sig'
|
38
|
+
|
39
|
+
# The master toctree document.
|
40
|
+
master_doc = 'index'
|
41
|
+
|
42
|
+
# General information about the project.
|
43
|
+
project = u'MtHaml'
|
44
|
+
copyright = u'2013, MtHaml Authors'
|
45
|
+
|
46
|
+
# The version info for the project you're documenting, acts as replacement for
|
47
|
+
# |version| and |release|, also used in various other places throughout the
|
48
|
+
# built documents.
|
49
|
+
#
|
50
|
+
# The short X.Y version.
|
51
|
+
version = '1.0'
|
52
|
+
# The full version, including alpha/beta/rc tags.
|
53
|
+
release = '1.0'
|
54
|
+
|
55
|
+
# The language for content autogenerated by Sphinx. Refer to documentation
|
56
|
+
# for a list of supported languages.
|
57
|
+
#language = None
|
58
|
+
|
59
|
+
# There are two options for replacing |today|: either, you set today to some
|
60
|
+
# non-false value, then it is used:
|
61
|
+
#today = ''
|
62
|
+
# Else, today_fmt is used as the format for a strftime call.
|
63
|
+
#today_fmt = '%B %d, %Y'
|
64
|
+
|
65
|
+
# List of patterns, relative to source directory, that match files and
|
66
|
+
# directories to ignore when looking for source files.
|
67
|
+
exclude_patterns = ['_build']
|
68
|
+
|
69
|
+
# The reST default role (used for this markup: `text`) to use for all documents.
|
70
|
+
#default_role = None
|
71
|
+
|
72
|
+
# If true, '()' will be appended to :func: etc. cross-reference text.
|
73
|
+
#add_function_parentheses = True
|
74
|
+
|
75
|
+
# If true, the current module name will be prepended to all description
|
76
|
+
# unit titles (such as .. function::).
|
77
|
+
#add_module_names = True
|
78
|
+
|
79
|
+
# If true, sectionauthor and moduleauthor directives will be shown in the
|
80
|
+
# output. They are ignored by default.
|
81
|
+
#show_authors = False
|
82
|
+
|
83
|
+
# The name of the Pygments (syntax highlighting) style to use.
|
84
|
+
pygments_style = 'sphinx'
|
85
|
+
|
86
|
+
# A list of ignored prefixes for module index sorting.
|
87
|
+
#modindex_common_prefix = []
|
88
|
+
|
89
|
+
|
90
|
+
# -- Options for HTML output ---------------------------------------------------
|
91
|
+
|
92
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
93
|
+
# a list of builtin themes.
|
94
|
+
html_theme = 'mthaml'
|
95
|
+
|
96
|
+
# Theme options are theme-specific and customize the look and feel of a theme
|
97
|
+
# further. For a list of options available for each theme, see the
|
98
|
+
# documentation.
|
99
|
+
#html_theme_options = {}
|
100
|
+
|
101
|
+
# Add any paths that contain custom themes here, relative to this directory.
|
102
|
+
html_theme_path = ['_theme']
|
103
|
+
|
104
|
+
# The name for this set of Sphinx documents. If None, it defaults to
|
105
|
+
# "<project> v<release> documentation".
|
106
|
+
#html_title = None
|
107
|
+
|
108
|
+
# A shorter title for the navigation bar. Default is the same as html_title.
|
109
|
+
#html_short_title = None
|
110
|
+
|
111
|
+
# The name of an image file (relative to this directory) to place at the top
|
112
|
+
# of the sidebar.
|
113
|
+
#html_logo = None
|
114
|
+
|
115
|
+
# The name of an image file (within the static path) to use as favicon of the
|
116
|
+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
117
|
+
# pixels large.
|
118
|
+
#html_favicon = None
|
119
|
+
|
120
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
121
|
+
# relative to this directory. They are copied after the builtin static files,
|
122
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
123
|
+
html_static_path = ['_static']
|
124
|
+
|
125
|
+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
126
|
+
# using the given strftime format.
|
127
|
+
#html_last_updated_fmt = '%b %d, %Y'
|
128
|
+
|
129
|
+
# If true, SmartyPants will be used to convert quotes and dashes to
|
130
|
+
# typographically correct entities.
|
131
|
+
#html_use_smartypants = True
|
132
|
+
|
133
|
+
# Custom sidebar templates, maps document names to template names.
|
134
|
+
#html_sidebars = {}
|
135
|
+
|
136
|
+
# Additional templates that should be rendered to pages, maps page names to
|
137
|
+
# template names.
|
138
|
+
#html_additional_pages = {}
|
139
|
+
|
140
|
+
# If false, no module index is generated.
|
141
|
+
#html_domain_indices = True
|
142
|
+
|
143
|
+
# If false, no index is generated.
|
144
|
+
#html_use_index = True
|
145
|
+
|
146
|
+
# If true, the index is split into individual pages for each letter.
|
147
|
+
#html_split_index = False
|
148
|
+
|
149
|
+
# If true, links to the reST sources are added to the pages.
|
150
|
+
#html_show_sourcelink = True
|
151
|
+
|
152
|
+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
153
|
+
#html_show_sphinx = True
|
154
|
+
|
155
|
+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
156
|
+
#html_show_copyright = True
|
157
|
+
|
158
|
+
# If true, an OpenSearch description file will be output, and all pages will
|
159
|
+
# contain a <link> tag referring to it. The value of this option must be the
|
160
|
+
# base URL from which the finished HTML is served.
|
161
|
+
#html_use_opensearch = ''
|
162
|
+
|
163
|
+
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
164
|
+
#html_file_suffix = None
|
165
|
+
|
166
|
+
# Output file base name for HTML help builder.
|
167
|
+
htmlhelp_basename = 'MtHamldoc'
|
168
|
+
|
169
|
+
|
170
|
+
# -- Options for LaTeX output --------------------------------------------------
|
171
|
+
|
172
|
+
latex_elements = {
|
173
|
+
# The paper size ('letterpaper' or 'a4paper').
|
174
|
+
#'papersize': 'letterpaper',
|
175
|
+
|
176
|
+
# The font size ('10pt', '11pt' or '12pt').
|
177
|
+
#'pointsize': '10pt',
|
178
|
+
|
179
|
+
# Additional stuff for the LaTeX preamble.
|
180
|
+
#'preamble': '',
|
181
|
+
}
|
182
|
+
|
183
|
+
# Grouping the document tree into LaTeX files. List of tuples
|
184
|
+
# (source start file, target name, title, author, documentclass [howto/manual]).
|
185
|
+
latex_documents = [
|
186
|
+
('index', 'MtHaml.tex', u'MtHaml Documentation',
|
187
|
+
u'Arnaud Le Blanc', 'manual'),
|
188
|
+
]
|
189
|
+
|
190
|
+
# The name of an image file (relative to this directory) to place at the top of
|
191
|
+
# the title page.
|
192
|
+
#latex_logo = None
|
193
|
+
|
194
|
+
# For "manual" documents, if this is true, then toplevel headings are parts,
|
195
|
+
# not chapters.
|
196
|
+
#latex_use_parts = False
|
197
|
+
|
198
|
+
# If true, show page references after internal links.
|
199
|
+
#latex_show_pagerefs = False
|
200
|
+
|
201
|
+
# If true, show URL addresses after external links.
|
202
|
+
#latex_show_urls = False
|
203
|
+
|
204
|
+
# Documents to append as an appendix to all manuals.
|
205
|
+
#latex_appendices = []
|
206
|
+
|
207
|
+
# If false, no module index is generated.
|
208
|
+
#latex_domain_indices = True
|
209
|
+
|
210
|
+
|
211
|
+
# -- Options for manual page output --------------------------------------------
|
212
|
+
|
213
|
+
# One entry per manual page. List of tuples
|
214
|
+
# (source start file, name, description, authors, manual section).
|
215
|
+
man_pages = [
|
216
|
+
('index', 'mthaml', u'MtHaml Documentation',
|
217
|
+
[u'MtHaml Authors'], 1)
|
218
|
+
]
|
219
|
+
|
220
|
+
# If true, show URL addresses after external links.
|
221
|
+
#man_show_urls = False
|
222
|
+
|
223
|
+
|
224
|
+
# -- Options for Texinfo output ------------------------------------------------
|
225
|
+
|
226
|
+
# Grouping the document tree into Texinfo files. List of tuples
|
227
|
+
# (source start file, target name, title, author,
|
228
|
+
# dir menu entry, description, category)
|
229
|
+
texinfo_documents = [
|
230
|
+
('index', 'MtHaml', u'MtHaml Documentation',
|
231
|
+
u'MtHaml Authors', 'MtHaml', 'One line description of project.',
|
232
|
+
'Miscellaneous'),
|
233
|
+
]
|
234
|
+
|
235
|
+
# Documents to append as an appendix to all manuals.
|
236
|
+
#texinfo_appendices = []
|
237
|
+
|
238
|
+
# If false, no module index is generated.
|
239
|
+
#texinfo_domain_indices = True
|
240
|
+
|
241
|
+
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
242
|
+
#texinfo_show_urls = 'footnote'
|
@@ -0,0 +1,274 @@
|
|
1
|
+
|
2
|
+
MtHaml/Twig syntax
|
3
|
+
==================
|
4
|
+
|
5
|
+
Haml is a short syntax for Html, coupled with a template engine. In
|
6
|
+
MtHaml/Twig, the template engine is Twig.
|
7
|
+
|
8
|
+
Quick introduction to HAML
|
9
|
+
--------------------------
|
10
|
+
|
11
|
+
.. container:: code-cols
|
12
|
+
|
13
|
+
.. code-block:: html+jinja
|
14
|
+
|
15
|
+
<strong>{{ item.title }}</strong>
|
16
|
+
|
17
|
+
.. code-block:: haml
|
18
|
+
|
19
|
+
%strong= item.title
|
20
|
+
|
21
|
+
In Haml, we start a tag by using the percent character followed by the name
|
22
|
+
of the tag. This works for ``%div``, ``%html``, ``%li``, or any other tag.
|
23
|
+
|
24
|
+
The ``=`` after the tag name tells Haml that what follows is Twig code that
|
25
|
+
should be printed.
|
26
|
+
|
27
|
+
Adding attributes
|
28
|
+
~~~~~~~~~~~~~~~~~
|
29
|
+
|
30
|
+
.. container:: code-cols
|
31
|
+
|
32
|
+
.. code-block:: html+jinja
|
33
|
+
|
34
|
+
<strong class="code" id="message">Hello, World!</strong>
|
35
|
+
|
36
|
+
.. code-block:: haml
|
37
|
+
|
38
|
+
%strong(class="code" id="message") Hello, World!
|
39
|
+
|
40
|
+
The syntax for attributes is very much like HTML's.
|
41
|
+
|
42
|
+
Since ``class`` and ``id`` attributes are very common, there is a short
|
43
|
+
notation for them, using CSS syntax:
|
44
|
+
|
45
|
+
.. container:: code-cols
|
46
|
+
|
47
|
+
.. code-block:: html+jinja
|
48
|
+
|
49
|
+
<strong class="code" id="message">Hello, World!</strong>
|
50
|
+
|
51
|
+
.. code-block:: haml
|
52
|
+
|
53
|
+
%strong.code#message Hello, World!
|
54
|
+
|
55
|
+
Haml also allows to omit the tag name, in which case it defaults to ``%div``.
|
56
|
+
|
57
|
+
.. container:: code-cols
|
58
|
+
|
59
|
+
.. code-block:: html+jinja
|
60
|
+
|
61
|
+
<div class='content'>Hello, World!</div>
|
62
|
+
|
63
|
+
.. code-block:: haml
|
64
|
+
|
65
|
+
.message Hello, World!
|
66
|
+
|
67
|
+
Examples with nesting
|
68
|
+
~~~~~~~~~~~~~~~~~~~~~
|
69
|
+
|
70
|
+
.. container:: code-cols
|
71
|
+
|
72
|
+
.. code-block:: html+jinja
|
73
|
+
|
74
|
+
<div class='item' id='item<%= item.id %>'>
|
75
|
+
{{ item.body }}
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
.. code-block:: haml
|
80
|
+
|
81
|
+
.item(id="item#{item.id}")
|
82
|
+
= item.body
|
83
|
+
|
84
|
+
White spaces, or more specifically indentation, is significant in Haml. This allows Haml to close tags automatically:
|
85
|
+
|
86
|
+
- when there is inline content, the tag is closed just after the content,
|
87
|
+
on the same line
|
88
|
+
- otherwise the tag is closed as soon as the indentation level decreases
|
89
|
+
to the level of the opening tag
|
90
|
+
- there are also special rules for auto-closing tags like ``%img`` or
|
91
|
+
``%meta``.
|
92
|
+
|
93
|
+
.. container:: code-cols
|
94
|
+
|
95
|
+
.. code-block:: html+jinja
|
96
|
+
|
97
|
+
<div id='content'>
|
98
|
+
<div class='left column'>
|
99
|
+
<h2>Welcome to our site!</h2>
|
100
|
+
<p>{{ information }}</p>
|
101
|
+
</div>
|
102
|
+
<div class="right column">
|
103
|
+
{% include "sidebar.twig" %}
|
104
|
+
</div>
|
105
|
+
</div>
|
106
|
+
|
107
|
+
.. code-block:: haml
|
108
|
+
|
109
|
+
#content
|
110
|
+
.left.column
|
111
|
+
%h2 Welcome to our site!
|
112
|
+
%p= information
|
113
|
+
.right.column
|
114
|
+
- include "sidebar.twig"
|
115
|
+
|
116
|
+
.. note::
|
117
|
+
|
118
|
+
See the Haml reference at http://haml.info/docs/yardoc/file.REFERENCE.html#plain_text
|
119
|
+
|
120
|
+
Haml to Twig
|
121
|
+
~~~~~~~~~~~~
|
122
|
+
|
123
|
+
MtHaml works by converting Haml syntax to plain Twig templates, which Twig
|
124
|
+
then executes.
|
125
|
+
|
126
|
+
The easiest way to understand how to write Haml/Twig templates is to understand
|
127
|
+
how the templates are converted to Twig.
|
128
|
+
|
129
|
+
Printing
|
130
|
+
########
|
131
|
+
|
132
|
+
The most common way to print something in Haml is by starting a line with the ``=`` character (or immediately following a tag declaration). Everything after the ``=`` is expected to be a Twig expression, and will be converted to Twig's double curly syntax:
|
133
|
+
|
134
|
+
.. container:: code-cols
|
135
|
+
|
136
|
+
.. code-block:: haml
|
137
|
+
|
138
|
+
%p.para= some.twig()|expression
|
139
|
+
|
140
|
+
.. code-block:: html+jinja
|
141
|
+
|
142
|
+
<p class="para">{{ some.twig()|expression }}</p>
|
143
|
+
|
144
|
+
You can effectively use any valid Twig expression here; including but not limited to functions, filters, macros, array element access.
|
145
|
+
|
146
|
+
There a few other ways to print something in Haml, for instance by using string interpolations syntax:
|
147
|
+
|
148
|
+
.. container:: code-cols
|
149
|
+
|
150
|
+
.. code-block:: haml
|
151
|
+
|
152
|
+
%span Hello #{ name }
|
153
|
+
|
154
|
+
.. code-block:: html+jinja
|
155
|
+
|
156
|
+
<span>Hello {{ name }}</span>
|
157
|
+
|
158
|
+
And a few other places, like in attribute values:
|
159
|
+
|
160
|
+
.. container:: code-cols
|
161
|
+
|
162
|
+
.. code-block:: haml
|
163
|
+
|
164
|
+
%span(id=any_valid_twig|syntax)
|
165
|
+
|
166
|
+
.. code-block:: html+jinja
|
167
|
+
|
168
|
+
<span id={{ any_valid_twig|syntax }}></span>
|
169
|
+
|
170
|
+
MtHaml will accept anything in attribute values, as long as parentheses, curly braces, square brackets, quotes, and double quotes are balanced.
|
171
|
+
|
172
|
+
|
173
|
+
Control structures, or Twig tags
|
174
|
+
################################
|
175
|
+
|
176
|
+
Now what about code we don't want to print?
|
177
|
+
|
178
|
+
In Haml, executing code we don't want to print is done by starting a line with the ``-`` character (maybe preceeded by indentation).
|
179
|
+
|
180
|
+
Everything after the ``-`` is expected to be a Twig tag, and will be converted to Twig's curly percent syntax.
|
181
|
+
|
182
|
+
.. container:: code-cols
|
183
|
+
|
184
|
+
.. code-block:: haml
|
185
|
+
|
186
|
+
%p
|
187
|
+
- if some.condition|default(0) > 1 or foo in bar
|
188
|
+
This is a control structure
|
189
|
+
|
190
|
+
%ul#a-list
|
191
|
+
- for value in some.array
|
192
|
+
%li.list-item= value
|
193
|
+
|
194
|
+
.. code-block:: html+jinja
|
195
|
+
|
196
|
+
<p>
|
197
|
+
{% if some.condition|default(0) > 1 or foo in bar %}
|
198
|
+
This is a control structure
|
199
|
+
{% endif %}
|
200
|
+
</p>
|
201
|
+
|
202
|
+
<ul id="a-list">
|
203
|
+
{% for value in some.array %}
|
204
|
+
<li class="list-item">{{ value }}</li>
|
205
|
+
{% endfor %}
|
206
|
+
</ul>
|
207
|
+
|
208
|
+
Here too, you can use any valid Twig `tag <http://twig.sensiolabs.org/doc/tags/index.html>`_. For instance, in the `if <http://twig.sensiolabs.org/doc/tags/if.html>`_ tag, you can use any twig `expression <http://twig.sensiolabs.org/doc/templates.html#expressions>`_, including but not limited to `filters <http://twig.sensiolabs.org/doc/filters/index.html>`_, `tests <http://twig.sensiolabs.org/doc/tests/index.html>`_, `operators <http://twig.sensiolabs.org/doc/templates.html#comparisons>`_.
|
209
|
+
|
210
|
+
End tags are added automatically if the tag is followed by indented lines. Otherwise, no end tag is added. This simple rule allows MtHaml to support every possible Twig tag, without knowing the meaning of tags.
|
211
|
+
|
212
|
+
Example with blocks:
|
213
|
+
|
214
|
+
.. container:: code-cols
|
215
|
+
|
216
|
+
.. code-block:: haml
|
217
|
+
|
218
|
+
- extends "layout.twig"
|
219
|
+
|
220
|
+
- block title "this is an inline block"
|
221
|
+
|
222
|
+
- block body
|
223
|
+
.content
|
224
|
+
%h1 Title
|
225
|
+
This block has contents
|
226
|
+
|
227
|
+
.. code-block:: html+jinja
|
228
|
+
|
229
|
+
{% extends "layout.twig" %}
|
230
|
+
|
231
|
+
{% block title "this is an inline block" %}
|
232
|
+
|
233
|
+
{% block body %}
|
234
|
+
<div class="content">
|
235
|
+
<h1>Title</h1>
|
236
|
+
This block has contents
|
237
|
+
</div>
|
238
|
+
{% endblock %}
|
239
|
+
|
240
|
+
Example with macros:
|
241
|
+
|
242
|
+
.. container:: code-cols
|
243
|
+
|
244
|
+
.. code-block:: html+jinja
|
245
|
+
|
246
|
+
{% macro input_text(name, value) %}
|
247
|
+
<input type="text" name="{{ name }}" value="{{ value }} />
|
248
|
+
{% endmacro %}
|
249
|
+
|
250
|
+
{% import _self as forms %}
|
251
|
+
|
252
|
+
{{ forms.input_text("foo", "bar") }}
|
253
|
+
|
254
|
+
.. code-block:: haml
|
255
|
+
|
256
|
+
- macro input_text(name, value)
|
257
|
+
%input(type="text" name=name value=value)
|
258
|
+
|
259
|
+
|
260
|
+
- import _self as forms
|
261
|
+
|
262
|
+
= forms.input_text("foo", "bar")
|
263
|
+
|
264
|
+
And every tag you want, even custom tags.
|
265
|
+
|
266
|
+
.. note::
|
267
|
+
See the documentation of Twig tags: http://twig.sensiolabs.org/doc/tags/index.html
|
268
|
+
|
269
|
+
Advanced Haml syntax
|
270
|
+
~~~~~~~~~~~~~~~~~~~~
|
271
|
+
|
272
|
+
MtHaml support all of Haml's syntax, with one major difference: use Twig code instead of Ruby. See the reference: http://haml.info/docs/yardoc/file.REFERENCE.html#plain_text .
|
273
|
+
|
274
|
+
|