Can hal be converted into html in the same file (as in the case of Emmet)?



  • I need a haml code for editing the html code in html/php and a haml code to be converted into html. Emmet also works.



  • You don't have to ask the editor himself.

    We can use it. HAML and write a marking on it, producing HTML automatically. Editorial support is not necessary, only a fairly fresh Ruby (2.2+) with hem. bundler (sighs)gem install bundler It will be installed with RubyGems in the car.

    On Ruby, it's easy enough with help. https://github.com/guard/guard-haml ♪

    • We're doing this in the folder. Gemfile:

      source 'https://rubygems.org'
      gem 'guard-haml'
      
    • Doing. bundle installso that it can be installed and generosized Gemfile.lock

    • Doing. guard initto be generosized Guardfilewhich will define the rules for tracking the files and regenerating them, it will initially detect guard-haml and make a rule for it (the background comment on the top is deleted):

      guard :haml do
        watch(/^.+(\.html\.haml)$/) # Это регулярка для путей к исходным файлам
      end
      

      You can add to the rule a folder of "base files" and "result" so they won't be in the same pile:

      guard :haml, input: 'src', output: 'public' do
        watch(/^.+(\.html\.haml)$/)
      end
      
    • We' somewhere in a folder with originals (or current) of any kind file. *.html.hamland voila, in the results folder (or current) *.html

    • If you need to get out of Guard, you can push. Ctrl+D or in his console exit

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2