File: plain-text.jade

package info (click to toggle)
node-jade 1.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 1,984 kB
  • ctags: 315
  • sloc: makefile: 4
file content (60 lines) | stat: -rw-r--r-- 1,666 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
extends ../reference.jade

block documentation
  h1 Plain Text

  p Jade provides three common ways of getting plain text.  They are useful in different situations

  h2 Piped Text

  p The simplest way of adding plain text to templates is to prefix the line with a <code>|</code> character (pronounced "pipe").

  .row(data-control='interactive')
    .col-lg-6
      +jade
        :jadesrc
          | Plain text can include <strong>html</strong>
          p
            | It must always be on its own line
    .col-lg-6
      +html
        :htmlsrc
          Plain text can include <strong>html</strong>
          <p>It must always be on its own line</p>

  h2 Inline in a Tag

  p Since it's a common use case, you can put text in a tag just by adding it inline after a space.

  .row(data-control='interactive')
    .col-lg-6
      +jade
        :jadesrc
          p Plain text can include <strong>html</strong>
    .col-lg-6
      +html
        :htmlsrc
          <p>Plain text can include <strong>html</strong></p>

  h2 Block in a Tag

  p Often you might want large blocks of text within a tag.  A good example is with inline scripts or styles.  To do this, just add a <code>.</code> after the tag (with no preceding space):

  .row(data-control='interactive')
    .col-lg-6
      +jade
        :jadesrc
          script.
            if (usingJade)
              console.log('you are awesome')
            else
              console.log('use jade')
    .col-lg-6
      +html
        :htmlsrc
          <script>
            if (usingJade)
              console.log('you are awesome')
            else
              console.log('use jade')
          </script>