Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.5k stars 453 forks source link

Add support for DustJS #392

Open aaqibhabib opened 9 years ago

aaqibhabib commented 9 years ago

Add support for DustJS templating for atom-beautify.

Glavin001 commented 9 years ago
{#friends}
  {name}, {age}{~n}
{/friends}
prettydiff commented 9 years ago

@aaqibhabib Would you be able to provide some examples in context? I need to know if the templating code is used in HTML or it is its own file. I would not be able to support this at all if it is embedded directly in JavaScript.

JBlackCat commented 9 years ago

@prettydiff LinkedIn's fork of Dust is the correct version, https://github.com/linkedin/dustjs . Here is their documentation https://github.com/linkedin/dustjs/wiki/Dust-Tutorial & http://www.dustjs.com/

http://akdubya.github.io/dustjs/ is no longer maintained, so is basically deprecated.

@Glavin001 comment about being like Handlebars is correct. I believe the syntax is basically the same, only the dust compiler can handle some additional basic logic provided by the Helpers.

Implementation is the same as well, can be in HTML and its own file for partials, just like Handlebars. On the JS side it should beautify like a regular js file(I believe).

prettydiff commented 9 years ago

@aaqibhabib @JBlackCat I have started work on this and some preliminary Dust.js support is ready to review. Please see the details at https://github.com/prettydiff/prettydiff/issues/108

prettydiff commented 9 years ago

I just published Dust.js support in v1.12.13. Support for Dust.js is hidden behind a new option dustjs http://prettydiff.com/documentation.xhtml#dustjs

The option is automatically set to true if the language is dustjs or if the language is auto and Dust.js can be automatically detected.

I also added a separate and unrelated option to preserve text in markup documents: textpreserve

radfahrer commented 8 years ago

any progress on adding dustjs support?

traviswimer commented 8 years ago

If DustJS is now supported by PrettyDiff, doesn't that mean a file just needs to be added to src/languages to add support to this package?