Skip to content

Resources for handling Diet templates

vreitech edited this page Apr 16, 2022 · 5 revisions

Online tools

  • Automatic HTML to Jade Converter

    This can come in very handy when converting an existing sites to diet templates. Note that although the output is a Jade template, it will be 99% compatible to a Diet template and should work with minimal or no changes.

Syntax highlighting

  • TextMate/Sublime Text language file for Jade

    Just insert <string>dt</string> around line 7 and it will nicely highlight Diet templates (*.dt). For Sublime Text on Windows, the Jade.tmLanguage file needs to be put into C:\Users\<username>\AppData\Roaming\Sublime Text 2\Packages\Jade.

  • For basic syntax highlighting in vim:

    Install vim-pathogen, if you have not already:

     mkdir -p ~/.vim/autoload ~/.vim/bundle
     cd ~/.vim
     [ -e vim-pathogen ] || git clone https://github.com/tpope/vim-pathogen
     cd autoload
     ln -sf ../vim-pathogen/autoload/pathogen.vim ./
     grep -q 'call pathogen#infect' ~/.vimrc || echo 'call pathogen#infect()' >> ~/.vimrc
    

    Then install vim-jade:

     cd ~/.vim/bundle
     [ -e vim-jade ] || git clone https://github.com/digitaltoad/vim-jade
     cd vim-jade/ftdetect
     grep -q '\*.dt' pug.vim || echo 'autocmd BufNewFile,BufReadPost *.dt set filetype=pug' >> pug.vim
    

    Enjoy colourful diet template files :-)