LoginSignup
0
0

More than 5 years have passed since last update.

railsとか関係なく素のrubyのコード内でslimをhtmlに変換した結果がほしかったんだけど、なかなかやりかたが見つからなかった。

Posted at

ちょっとやっつけたいだけなんやわしは

ralisでアプリ書くわけじゃなくて、ちょっとした検証につかいたかっただけなんだけど、検索するとガチなやりかたやslimrbを使った変換しか見つけられなかった。

あってるかどうかわからん

俺ただのWebデザイナーやし。得意種目はCOBOLとPerlやし。

検証コード

slimtest.rb
require 'slim'

slim =<<EOL
doctype html
html
  head
  body
EOL

puts Slim::Template.new() { slim }.render

結果

<!DOCTYPE html><html><head></head><body></body></html>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0