Ruby 模板引擎 Slim Lang

码农软件 · 软件分类 · 模板引擎 · 2019-08-23 15:57:22

软件介绍

Slim是一个Ruby编写的模板语言,其目标是快速、轻量级、语法简洁。它有着类似HAML的语法,使用缩进来表示嵌套关系,支持内嵌代码和在Rails上使用(slim-rails)。下面是一个haml模板的例子:

doctype html
html
  head
    title Slim Examples
    meta name="keywords" content="template language"
    meta name="author" content=author
    link rel="icon" type="image/png" href=file_path("favicon.png")
    javascript:
      alert('Slim supports embedded javascript!')

  body
    h1 Markup examples

    #content
      p This example shows you how a basic Slim file looks like.

    == yield

    - if items.any?
      table#items
        - for item in items
          tr
            td.name = item.name
            td.price = item.price
    - else
      p No items found Please add some inventory.
        Thank you!

    div id="footer"
      == render 'footer'
      | Copyright © #{@year} #{@author}

本文地址:https://codercto.com/soft/d/13004.html

Coming of Age in Second Life

Coming of Age in Second Life

Tom Boellstorff / Princeton University Press / 2008-04-21 / USD 29.95

The gap between the virtual and the physical, and its effect on the ideas of personhood and relationships, is the most interesting aspect of Boellstorff's analysis... Boellstorff's portrayal of a virt......一起来看看 《Coming of Age in Second Life》 这本书的介绍吧!

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具