I need to, in the process of editing the html-code in the html / php file, you can write the haml-code and when you press a certain key, the haml is converted to html. Emmet works in a similar way.
1 answer
You can not require this from the editor
You can use HAML directly and write markup on it, generating HTML automatically. Support for editors is not needed for this; you need only fresh enough Ruby (2.2+) with the bundler gem install bundler ( gem install bundler it if you have RubyGems) on the machine.
With Ruby, this can be done fairly easily using guard-haml .
Make a
Gemfilein the project folder:source 'https://rubygems.org' gem 'guard-haml'Make
bundle installso that it installs and generatesGemfile.lockMaking
guard initso that the Guardfile will beGuardfile, in which the rules for tracking files and their regeneration will be defined, initially it will detectguard-hamland make a rule for it (reference comment above is omitted):guard :haml do watch(/^.+(\.html\.haml)$/) # Это регулярка для путей к исходным файлам endYou can add the folder "source files" and "result" to the rule so that they are not in the same heap:
guard :haml, input: 'src', output: 'public' do watch(/^.+(\.html\.haml)$/) endCreate somewhere in the source folder (or current) any file of the form
*.html.haml, save, and voila, in the folder with the result (or current) appears the corresponding*.html.- If you need to exit Guard, you can press Ctrl + D or execute
exitin its console.