Project rename

This commit is contained in:
2019-03-24 08:28:57 +01:00
parent 1728e0e6e1
commit 7926230faf
7262 changed files with 0 additions and 0 deletions
@@ -0,0 +1,3 @@
- var avatar = '219b77f9d21de75e81851b6b886057c7'
div.avatar-div(style=`background-image: url(https://www.gravatar.com/avatar/${avatar})`)
+7
View File
@@ -0,0 +1,7 @@
- var user = { name: 'tobi' }
foo(data-user=user)
foo(data-items=[1,2,3])
foo(data-username='tobi')
foo(data-escaped={message: "Let's rock!"})
foo(data-ampersand={message: "a quote: " this & that"})
foo(data-epoc=new Date(0))
+17
View File
@@ -0,0 +1,17 @@
- var id = 5
- function answer() { return 42; }
a(href='/user/' + id, class='button')
a(href = '/user/' + id, class = 'button')
meta(key='answer', value=answer())
a(class = ['class1', 'class2'])
a.tag-class(class = ['class1', 'class2'])
a(href='/user/' + id class='button')
a(href = '/user/' + id class = 'button')
meta(key='answer' value=answer())
a(class = ['class1', 'class2'])
a.tag-class(class = ['class1', 'class2'])
div(id=id)&attributes({foo: 'bar'})
- var bar = null
div(foo=null bar=bar)&attributes({baz: 'baz'})
+43
View File
@@ -0,0 +1,43 @@
a(href='/contact') contact
a(href='/save').button save
a(foo, bar, baz)
a(foo='foo, bar, baz', bar=1)
a(foo='((foo))', bar= (1) ? 1 : 0 )
select
option(value='foo', selected) Foo
option(selected, value='bar') Bar
a(foo="class:")
input(pattern='\\S+')
a(href='/contact') contact
a(href='/save').button save
a(foo bar baz)
a(foo='foo, bar, baz' bar=1)
a(foo='((foo))' bar= (1) ? 1 : 0 )
select
option(value='foo' selected) Foo
option(selected value='bar') Bar
a(foo="class:")
input(pattern='\\S+')
foo(terse="true")
foo(date=new Date(0))
foo(abc
,def)
foo(abc,
def)
foo(abc,
def)
foo(abc
,def)
foo(abc
def)
foo(abc
def)
- var attrs = {foo: 'bar', bar: '<baz>'}
div&attributes(attrs)
a(foo='foo' "bar"="bar")
a(foo='foo' 'bar'='bar')
@@ -0,0 +1,3 @@
script(type='text/x-template')
div(id!='user-<%= user.id %>')
h1 <%= user.title %>
+3
View File
@@ -0,0 +1,3 @@
html
body
h1 Title
+8
View File
@@ -0,0 +1,8 @@
ul
li foo
li bar
li baz
+12
View File
@@ -0,0 +1,12 @@
-
list = ["uno", "dos", "tres",
"cuatro", "cinco", "seis"];
//- Without a block, the element is accepted and no code is generated
-
each item in list
-
string = item.charAt(0)
.toUpperCase() +
item.slice(1);
li= string
@@ -0,0 +1,5 @@
ul
li: a(href='#') foo
li: a(href='#') bar
p baz
@@ -0,0 +1,2 @@
ul
li.list-item: .foo: #bar baz
+4
View File
@@ -0,0 +1,4 @@
figure
blockquote
| Try to define yourself by what you do, and you&#8217;ll burnout every time. You are. That is enough. I rest in that.
figcaption from @thefray at 1:43pm on May 10
@@ -0,0 +1,4 @@
extends ./auxiliary/blocks-in-blocks-layout.pug
block body
h1 Page 2
+19
View File
@@ -0,0 +1,19 @@
//- see https://github.com/pugjs/pug/issues/1589
-var ajax = true
-if( ajax )
//- return only contents if ajax requests
block contents
p ajax contents
-else
//- return all html
doctype html
html
head
meta( charset='utf8' )
title sample
body
block contents
p all contetns
+10
View File
@@ -0,0 +1,10 @@
html
body
- var friends = 1
case friends
when 0
p you have no friends
when 1
p you have a friend
default
p you have #{friends} friends
+19
View File
@@ -0,0 +1,19 @@
html
body
- var friends = 1
case friends
when 0: p you have no friends
when 1: p you have a friend
default: p you have #{friends} friends
- var friends = 0
case friends
when 0
when 1
p you have very few friends
default
p you have #{friends} friends
- var friend = 'Tim:G'
case friend
when 'Tim:G': p Friend is a string
when {tim: 'g'}: p Friend is an object
@@ -0,0 +1,3 @@
a(class='')
a(class=null)
a(class=undefined)
+11
View File
@@ -0,0 +1,11 @@
a(class=['foo', 'bar', 'baz'])
a.foo(class='bar').baz
a.foo-bar_baz
a(class={foo: true, bar: false, baz: true})
@@ -0,0 +1,43 @@
- if (true)
p foo
- else
p bar
- if (true) {
p foo
- } else {
p bar
- }
if true
p foo
p bar
p baz
else
p bar
unless true
p foo
else
p bar
if 'nested'
if 'works'
p yay
//- allow empty blocks
if false
else
.bar
if true
.bar
else
.bing
if false
.bing
else if false
.bar
else
.foo
@@ -0,0 +1,2 @@
p= '<script>'
p!= '<script>'
@@ -0,0 +1,35 @@
- var items = [1,2,3]
ul
- items.forEach(function(item){
li= item
- })
- var items = [1,2,3]
ul
for item, i in items
li(class='item-' + i)= item
ul
each item, i in items
li= item
ul
each $item in items
li= $item
- var nums = [1, 2, 3]
- var letters = ['a', 'b', 'c']
ul
for l in letters
for n in nums
li #{n}: #{l}
- var count = 1
- var counter = function() { return [count++, count++, count++] }
ul
for n in counter()
li #{n}
+10
View File
@@ -0,0 +1,10 @@
p= null
p= undefined
p= ''
p= 0
p= false
p(foo=null)
p(foo=undefined)
p(foo='')
p(foo=0)
p(foo=false)
@@ -0,0 +1,10 @@
doctype html
html
body
- var s = 'this'
case s
//- Comment
when 'this'
p It's this!
when 'that'
p It's that!
+29
View File
@@ -0,0 +1,29 @@
// foo
ul
// bar
li one
// baz
li two
//
ul
li foo
// block
// inline follow
li three
// block
// inline followed by tags
ul
li four
//if IE lt 9
// inline
script(src='/lame.js')
// end-inline
p five
.foo // not a comment
@@ -0,0 +1,9 @@
//-
s/s.
//- test/cases/comments.source.pug
//-
test/cases/comments.source.pug
when
()
@@ -0,0 +1 @@
doctype custom stuff
@@ -0,0 +1,4 @@
doctype
html
body
h1 Title
@@ -0,0 +1 @@
doctype html
+43
View File
@@ -0,0 +1,43 @@
- var users = []
ul
for user in users
li= user.name
else
li no users!
- var users = [{ name: 'tobi', friends: ['loki'] }, { name: 'loki' }]
if users
ul
for user in users
li= user.name
else
li no users!
- var user = { name: 'tobi', age: 10 }
ul
each val, key in user
li #{key}: #{val}
else
li user has no details!
- var user = {}
ul
each prop, key in user
li #{key}: #{val}
else
li user has no details!
- var user = Object.create(null)
- user.name = 'tobi'
ul
each val, key in user
li #{key}: #{val}
else
li user has no details!
@@ -0,0 +1,2 @@
script.
var re = /\d+/;
@@ -0,0 +1,8 @@
doctype html
html
head
title escape-test
body
textarea
- var txt = '<param name="flashvars" value="a=&quot;value_a&quot;&b=&quot;value_b&quot;&c=3"/>'
| #{txt}
@@ -0,0 +1,6 @@
foo(attr="<%= bar %>")
foo(class="<%= bar %>")
foo(attr!="<%= bar %>")
foo(class!="<%= bar %>")
foo(class!="<%= bar %> lol rofl")
foo(class!="<%= bar %> lol rofl <%= lmao %>")
@@ -0,0 +1 @@
include ./auxiliary/filter-in-include.pug
@@ -0,0 +1,6 @@
- var users = [{ name: 'tobi', age: 2 }]
fb:users
for user in users
fb:user(age=user.age)
:cdata
@@ -0,0 +1,6 @@
script(type='text/javascript')
:coffee-script
regexp = /\n/
:coffee-script(minify=true)
math =
square: (value) -> value * value
@@ -0,0 +1,7 @@
html
body
:custom(opt='val' num=2)
Line 1
Line 2
Line 4
@@ -0,0 +1,4 @@
html
body
pre
include:custom(opt='val' num=2) filters.include.custom.pug
@@ -0,0 +1,7 @@
html
body
include:markdown-it some.md
script
include:coffee-script(minify=true) include-filter-coffee.coffee
script
include:coffee-script(minify=false) include-filter-coffee.coffee
@@ -0,0 +1 @@
p before #[:cdata inside] after
@@ -0,0 +1,8 @@
html
head
style(type="text/css")
:less
@pad: 15px;
body {
padding: @pad;
}
@@ -0,0 +1,5 @@
html
body
:markdown-it
This is _some_ awesome **markdown**
whoop.
@@ -0,0 +1,10 @@
script
:cdata:uglify-js
(function() {
console.log('test')
})()
script
:cdata:uglify-js:coffee-script
(->
console.log 'test'
)()
@@ -0,0 +1,7 @@
html
head
style(type="text/css")
:stylus
body
padding: 50px
body
@@ -0,0 +1,6 @@
html
div
:verbatim
filters are applied at compile time
with no #[b interpolation] at #{all}
+13
View File
@@ -0,0 +1,13 @@
- var version = 1449104952939
<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ul>
<!--build:js /js/app.min.js?v=#{version}-->
<!--endbuild-->
p You can <em>embed</em> html as well.
p: <strong>Even</strong> as the body of a block expansion.
+4
View File
@@ -0,0 +1,4 @@
doctype html
input(type='checkbox', checked)
input(type='checkbox', checked=true)
input(type='checkbox', checked=false)
@@ -0,0 +1 @@
include /auxiliary/extends-from-root.pug
@@ -0,0 +1,2 @@
include auxiliary/extends-empty-block-1.pug
include auxiliary/extends-empty-block-2.pug
@@ -0,0 +1 @@
include ../cases/auxiliary/extends-relative.pug
@@ -0,0 +1,3 @@
| The message is "
yield
| "
@@ -0,0 +1,5 @@
html
body
p
include include-only-text-body.pug
em hello world
@@ -0,0 +1,3 @@
head
script(type='text/javascript').
alert('hello world');
@@ -0,0 +1,4 @@
html
include include-with-text-head.pug
script(src='/caustic.js')
script(src='/app.js')
@@ -0,0 +1,2 @@
script#pet-template(type='text/x-template')
include auxiliary/pet.pug
@@ -0,0 +1,4 @@
include auxiliary/yield-nested.pug
p some content
p and some more
@@ -0,0 +1,3 @@
pre
code
include javascript-new-lines.js
+10
View File
@@ -0,0 +1,10 @@
include auxiliary/mixins.pug
+foo
body
include auxiliary/smile.html
include auxiliary/escapes.html
script(type="text/javascript")
include:verbatim auxiliary/includable.js
@@ -0,0 +1,6 @@
extends auxiliary/dialog.pug
block content
h1 Alert!
p I'm an alert!
@@ -0,0 +1,6 @@
html
head
block head
script(src='jquery.js')
script(src='keymaster.js')
script(src='caustic.js')
@@ -0,0 +1,13 @@
extend auxiliary/layout.include.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content
block window-content
h2 Awesome
p Now we can extend included blocks!
@@ -0,0 +1,4 @@
extend auxiliary/inheritance.extend.mixin.block.pug
block content
p Hello World!
@@ -0,0 +1,11 @@
extend auxiliary/layout.pug
mixin article(title)
if title
h1= title
block
block content
+article("The meaning of life")
p Foo bar baz!
@@ -0,0 +1,9 @@
extend auxiliary/layout.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content
@@ -0,0 +1,4 @@
extends /auxiliary/inheritance.extend.recursive-parent.pug
block parent
h4 child
@@ -0,0 +1,13 @@
extend auxiliary/layout.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content
@@ -0,0 +1,9 @@
extends auxiliary/layout.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content
@@ -0,0 +1,3 @@
block content // Main content goes here
append content // adding something to content
prepend content // adding something to other end of content
+19
View File
@@ -0,0 +1,19 @@
p bing #[strong foo] bong
p.
bing
#[strong foo]
#[strong= '[foo]']
#[- var foo = 'foo]']
bong
p
| bing
| #[strong foo]
| #[strong= '[foo]']
| #[- var foo = 'foo]']
| bong
p.
\#[strong escaped]
\#[#[strong escaped]
@@ -0,0 +1,3 @@
p #[a.rho(href='#', class='rho--modifier') with inline link]
p Some text #[a.rho(href='#', class='rho--modifier')]
p Some text #[a.rho(href='#', class='rho--modifier') with inline link]
@@ -0,0 +1,4 @@
mixin linkit(url)
a(href=url)= url
p This also works #[+linkit('http://www.bing.com')] so hurrah for Pug
@@ -0,0 +1,7 @@
- var id = 42;
foo
| some
| \#{text}
| here
| My ID #{"is {" + id + "}"}
@@ -0,0 +1 @@
var x = "\n here is some \n new lined text";
@@ -0,0 +1,6 @@
extends ../fixtures/append/app-layout.pug
block append head
script(src='foo.js')
script(src='bar.js')
@@ -0,0 +1,6 @@
extends ../fixtures/append-without-block/app-layout.pug
append head
script(src='foo.js')
script(src='bar.js')
@@ -0,0 +1,19 @@
extends ../fixtures/multi-append-prepend-block/redefine.pug
append content
p.first.append Something appended to content
prepend content
p.first.prepend Something prepended to content
append content
p.last.append Last append must be most last
prepend content
p.last.prepend Last prepend must appear at top
append head
script(src='jquery.js')
prepend head
script(src='foo.js')
@@ -0,0 +1,6 @@
extends ../fixtures/prepend/app-layout.pug
block prepend head
script(src='foo.js')
script(src='bar.js')
@@ -0,0 +1,6 @@
extends ../fixtures/prepend-without-block/app-layout.pug
prepend head
script(src='foo.js')
script(src='bar.js')
@@ -0,0 +1,4 @@
include ./auxiliary/mixin-at-end-of-file.pug
+slide()
p some awesome content
@@ -0,0 +1,6 @@
mixin m(id)
div
block
+m()
| This text should appear
@@ -0,0 +1,7 @@
mixin foo()
h1= title
html
body
+foo
@@ -0,0 +1,5 @@
//- regression test for https://github.com/pugjs/pug/issues/1435
include ../fixtures/mixin-include.pug
+bang
+59
View File
@@ -0,0 +1,59 @@
mixin centered(title)
div.centered(id=attributes.id)
- if (title)
h1(class=attributes.class)= title
block
- if (attributes.href)
.footer
a(href=attributes.href) Back
mixin main(title)
div.stretch
+centered(title).highlight&attributes(attributes)
block
mixin bottom
div.bottom&attributes(attributes)
block
body
+centered#First Hello World
+centered('Section 1')#Second
p Some important content.
+centered('Section 2')#Third.foo(href='menu.html', class='bar')
p Even more important content.
+main('Section 3')(href='#')
p Last content.
+bottom.foo(class='bar', name='end', id='Last', data-attr='baz')
p Some final words.
+bottom(class=['class1', 'class2'])
mixin foo
div.thing(attr1='foo', attr2='bar')&attributes(attributes)
- var val = '<biz>'
- var classes = ['foo', 'bar']
+foo(attr3='baz' data-foo=val data-bar!=val class=classes).thunk
//- Regression test for #1424
mixin work_filmstrip_item(work)
div&attributes(attributes)= work
+work_filmstrip_item('work')("data-profile"='profile', "data-creator-name"='name')
mixin my-mixin(arg1, arg2, arg3, arg4)
p= arg1
p= arg2
p= arg3
p= arg4
+foo(
attr3="qux"
class="baz"
)
+my-mixin(
'1',
'2',
'3',
'4'
)
@@ -0,0 +1,24 @@
mixin article(name)
section.article
h1= name
block
html
body
+article('Foo'): p I'm article foo
mixin article(name)
section.article
h1= name
p
block
html
body
+article('Something').
I'm a much longer
text-only article,
but you can still
inline html tags
in me if you want.
+44
View File
@@ -0,0 +1,44 @@
mixin form(method, action)
form(method=method, action=action)
- var csrf_token_from_somewhere = 'hey'
input(type='hidden', name='_csrf', value=csrf_token_from_somewhere)
block
html
body
+form('GET', '/search')
input(type='text', name='query', placeholder='Search')
input(type='submit', value='Search')
html
body
+form('POST', '/search')
input(type='text', name='query', placeholder='Search')
input(type='submit', value='Search')
html
body
+form('POST', '/search')
mixin bar()
#bar
block
mixin foo()
#foo
+bar
block
+foo
p one
p two
p three
mixin baz
#baz
block
+baz()= '123'
+15
View File
@@ -0,0 +1,15 @@
mixin foo
p.bar&attributes(attributes) One
p.baz.quux&attributes(attributes) Two
p&attributes(attributes) Three
p.bar&attributes(attributes)(class="baz") Four
body
+foo.hello
+foo#world
+foo.hello#world
+foo.hello.world
+foo(class="hello")
+foo.hello(class="world")
+foo
+foo&attributes({class: "hello"})
@@ -0,0 +1,3 @@
mixin never-called
.wtf This isn't something we ever want to output
body
+32
View File
@@ -0,0 +1,32 @@
mixin comment(title, str)
.comment
h2= title
p.body= str
mixin comment (title, str)
.comment
h2= title
p.body= str
#user
h1 Tobi
.comments
+comment('This',
(('is regular, javascript')))
mixin list
ul
li foo
li bar
li baz
body
+list()
+ list()
mixin foobar(str)
div#interpolation= str + 'interpolated'
- var suffix = "bar"
+#{'foo' + suffix}('This is ')
@@ -0,0 +1,6 @@
mixin list(tag, ...items)
#{tag}
each item in items
li= item
+list('ul', 1, 2, 3, 4)
+2
View File
@@ -0,0 +1,2 @@
fb:user:role Something
foo(fb:foo='bar')
+8
View File
@@ -0,0 +1,8 @@
ul
li a
li b
li
ul
li c
li d
li e
@@ -0,0 +1,4 @@
//
.foo
.bar
.hey
@@ -0,0 +1,4 @@
:markdown-it
code sample
# Heading
@@ -0,0 +1,3 @@
pre.
what
is #{'going'} #[| #{'on'}]
+10
View File
@@ -0,0 +1,10 @@
pre.
foo
bar
baz
pre
code.
foo
bar
baz
+2
View File
@@ -0,0 +1,2 @@
p "foo"
p 'foo'
@@ -0,0 +1,4 @@
extends ./auxiliary/1794-extends.pug
block content
include ./auxiliary/1794-include.pug
@@ -0,0 +1,2 @@
- var url = 'http://www.google.com'
.url #{url.replace('http://', '').replace(/^www\./, '')}
@@ -0,0 +1,6 @@
script.
if (foo) {
bar();
}
@@ -0,0 +1,9 @@
script#user-template(type='text/template')
#user
h1 <%= user.name %>
p <%= user.description %>
script#user-template(type='text/template').
if (foo) {
bar();
}
+8
View File
@@ -0,0 +1,8 @@
script.
if (foo) {
bar();
}
script!= 'foo()'
script foo()
script
div
@@ -0,0 +1,4 @@
doctype html
html
body
br/

Some files were not shown because too many files have changed in this diff Show More