Module: Card::Set::Self::Head::HtmlFormat

Extended by:
AbstractFormat
Defined in:
card/tmpsets/set/mod030-card-mod-layout/self/head.rb,
card/tmpsets/set/mod031-card-mod-layout/self/head.rb

Instance Method Summary collapse

Instance Method Details

#escape_in_mainObject



30
31
32
# File 'card/tmpsets/set/mod030-card-mod-layout/self/head.rb', line 30

def escape_in_main
  main? ? (h yield) : yield
end

#view: coreObject

when *head is rendered in the main body of a page, we escape the HTML otherwise (most typically in the head tag, of course), we render the HTML unescaped



16
17
18
19
20
21
22
23
24
# File 'card/tmpsets/set/mod030-card-mod-layout/self/head.rb', line 16

view :core, cache: :never do
  escape_in_main do
    nest root.card, view: :head
    # note that the head tag for each card is different
    # (different title, different style rules, etc)
    # so we don't cache the core of *head, but we _do_ cache some
    # views within each head (see all/head.rb)
  end
end

#view: inputObject



26
27
28
# File 'card/tmpsets/set/mod030-card-mod-layout/self/head.rb', line 26

view :input do
  "Content can't be edited."
end