This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<style> | |
.variable-placeholder { | |
background: #ffeb3b; | |
color: #333; | |
padding: 0 5px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "scrivener" | |
require "hypertext" | |
require "hypertext/dsl" | |
class RegistrationForm < Scrivener | |
attr_accessor :name | |
attr_accessor :email | |
attr_accessor :message | |
def validate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "hypertext" | |
require "hypertext/dsl" | |
class Hypertext | |
def append(fragment) | |
@dom << fragment | |
end | |
class DSL | |
def append(fragment) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HTMLDocument | |
ENTITIES = { | |
"'" => ''', | |
'&' => '&', | |
'"' => '"', | |
'<' => '<', | |
'>' => '>', | |
} | |
def initialize(indent = " ", level = 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HTMLDocument | |
VOID_ELEMENTS = %i[ | |
area base br col embed hr img input | |
link meta param source track wbr | |
] | |
def initialize | |
@doc = "" | |
yield self if block_given? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HTMLDocument | |
def initialize | |
@doc = "" | |
yield self if block_given? | |
end | |
def el(type, attrs={}) | |
case type | |
when :text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HTMLDoc | |
def initialize | |
@node_id = 0 | |
@parent_id = 0 | |
@doc = [] | |
yield self if block_given? | |
end | |
def el(type, attributes = {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// We need to import the CSS so that webpack will load it. | |
// The MiniCssExtractPlugin is used to separate it out into | |
// its own CSS file. | |
import "../css/app.scss" | |
// webpack automatically bundles all modules in your | |
// entry points. Those entry points can be configured | |
// in "webpack.config.js". | |
// | |
// Import deps with the dep name or local files with a relative path, for example: |
NewerOlder