DustBuster is a package for Sublime Text used for syntax definitions in .dust files. It also includes custom shortcut completions for dustjs-helpers and dustjs logic syntax.
- syntax definition for .dust files (with html support)
- sublime completions for supported dustjs-helpers and dustjs logic
- cmd+shift+p, Install Package, search for DustBuster or Dust
- open any .dust file and then select View > Syntax > Dust
- Atom package :: language-dustjs
- VSCode extension :: vscode-dustjs
- to use these completions, just start typing the completion name and hit tab
- for example, type "ds", hit tab and
{#name}{/name}
will be rendered - you can then tab through the snippet and change values
- type "d", then control+spacebar to view all of the completions
{#section-name}
{/section-name}
{+block-name}
{/block-name}
{?name} {/name}
{^name} {/name}
{>"path/to/partial"/}
{<inline-partial-name}
{/inline-partial-name}
{>"path/to/partial" params /}
{>"path/to/partial{dynamic-param}" /}
{@eq value="bar"} {/eq}
{@eq key="10" value="price"}
Your price is 10
{:else}
Your price is not 10
{/eq}
{@ne key="foo" value="foo"} {/ne}
{@lt value=XX} {/lt}
{@lte value=XX} {/lte}
{@gt key="XX" value="20" type="number"} {/gt}
{@gte key="XX" value="XX" type="number"} {/gte}
{@math key="XX" method="XX" operand="XX" round="true|false"/}
{@math key="XX" method="add" operand="XX"/}
{@math key="XX" method="subtract" operand="XX"/}
{@math key="XX" method="multiply" operand="XX"/}
{@math key="XX" method="divide" operand="XX"/}
{@math key="XX.5" method="round"/}
{@math key="XX.5" method="floor"/}
{@math key="XX.5" method="ceil"/}
{@math key="XX.5" method="ceil"/}
{@math key="-XX" method="abs"}
{@eq value=XX}
{/eq}
{/math}
{@select key="foo" type="string"}
{/select}
{@select key="foo"}
{@eq value="bar"}bar{/eq}
{@eq value="baz"}baz{/eq}
{@eq value="biz"}biz{/eq}
{@default value="default"}default{/default}
{/select}
{#array}
{@select key=.}
{@eq value="foo"}foo{/eq}
{@eq value="bar"}bar{/eq}
{@default value="default"}default{/default}
{/select}
{/array}
{@size key=XX/}
{@contextDump key="current|full" to="output|console" /}
{@sep} {/sep}
{name|s}
{name|h}
{name|j}
{name|u}
{name|uc}
{name|js}
{name|jp}
DustBuster is a complete rewrite of a previous package by sntran and gpbl.
(The MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.