mike-goodwin / pug-bootstrap Goto Github PK
View Code? Open in Web Editor NEWA port of https://github.com/rajasegar/JADE-Bootstrap from jade to pug
License: MIT License
A port of https://github.com/rajasegar/JADE-Bootstrap from jade to pug
License: MIT License
Does this pug-bootstrap work well for bootstrap 4?
Port the tooltips mixin to the new interpolation syntaxand add unit tests
Hello guys
i found this great work but seems not ready to use yet. i am newbie in javascript template engine. can i go with this and i'll update when official release. i'll try my best contribution also.
Hi,
There is a problem on buttons.pug in components, when you specify the caption for submit-primary,
like this
+submit-primary("CREATE")
you have the value equal to #{caption} and the class equal to btn-#{type}.
I tried to replace the code (line 135) :
input.btn(class="btn-#{type}",type="submit",value="#{caption}")
by
input.btn(class="btn-" + type,type="submit",value=caption)
and now it works fine.
it the same thing on line 115 in the same file
cheers
Fabrice
Hi Mike,
i'm starting using your mixins library. I've noticed that the interpolation syntax is not compatible with Pug 2. For examples:
mixin nav(type,items,active)
ul.nav(class="#{type}")
in https://github.com/mike-goodwin/pug-bootstrap/blob/master/components/navs.pug.
Spec. Ref: https://pugjs.org/api/migration-v2.html
are you going to update your library?
Thank you for the support and the usefull porting.
Enrico.
Port the tabs mixin to the new interpolation syntaxand add unit tests
My attributes do not seem to pass through.
For example:
+accordion("sample")
+accordion-item-primary("Title1","sample","true")
| This is first accordion content
+accordion-item-default("Title2","sample")
| This is second accordion content
+accordion-item-default("Title3","sample")
| This is third accordion content
results in the following markup being generated:
<div class="panel-group" id="accordion#{id}" role="tablist" aria-multiselectable="true">
<div class="panel panel-#{type}">
<div class="panel-heading" role="tab" id="heading#{title}">
<h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion#{parent}" href="#collapse#{id}" aria-expanded="true" aria-controls="collapseOne">Title1</a></h4>
</div>
<div class="panel-collapse collapse in" id="collapse#{id}" role="tabpanel" aria-labelledby="heading#{title}">
<div class="panel-body"> This is first accordion content
</div>
</div>
</div>
<div class="panel panel-#{type}">
<div class="panel-heading" role="tab" id="heading#{title}">
<h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion#{parent}" href="#collapse#{id}" aria-expanded="true" aria-controls="collapseOne">Title2</a></h4>
</div>
<div class="panel-collapse collapse" id="collapse#{id}" role="tabpanel" aria-labelledby="heading#{title}">
<div class="panel-body"> This is second accordion content
</div>
</div>
</div>
<div class="panel panel-#{type}">
<div class="panel-heading" role="tab" id="heading#{title}">
<h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion#{parent}" href="#collapse#{id}" aria-expanded="true" aria-controls="collapseOne">Title3</a></h4>
</div>
<div class="panel-collapse collapse" id="collapse#{id}" role="tabpanel" aria-labelledby="heading#{title}">
<div class="panel-body"> This is third accordion content
</div>
</div>
</div>
</div>
And this error in the console:
jquery.min.js:2 Uncaught Error: Syntax error, unrecognized expression: #{id}
The code
button.btn.btn-primary(data-toggle="modal",data-target="#myModal") Launch demo modal
+modal("Modal title","myModal")
p This is modal content
doesn't work
Update tables mixin to the new interpolation syntax and add unit tests
I am a complete newbie to jade/pug... Trying to add bootstrap to pug
i copied pug-bootstrap folder inside my views folder
changed my index.pug as follows
extends ./pug-bootstrap/_bootstrap
block body
h1 Put your own body content here
I am getting this error when i load my index page
D:\Workspace\NodeJs\for_delete\views\pug-bootstrap\components\tabs.pug:11:13 9| if (index === active) 10| li.active > 11| a(href=`#tab${item}`,role="tab",data-toggle="tab")= item --------------------^ 12| else 13| li 14| a(href=`#tab${item}`,role="tab",data-toggle="tab")= item Syntax Error: Unexpected character '`'
Error: D:\Workspace\NodeJs\for_delete\views\pug-bootstrap\components\tabs.pug:11:13
9| if (index === active)
10| li.active
> 11| a(href=`#tab${item}`,role="tab",data-toggle="tab")= item
--------------------^
12| else
13| li
14| a(href=`#tab${item}`,role="tab",data-toggle="tab")= item
Syntax Error: Unexpected character '`'
at makeError (D:\Workspace\NodeJs\for_delete\node_modules\pug-error\index.js:32:13)
at Lexer.error (D:\Workspace\NodeJs\for_delete\node_modules\pug-lexer\index.js:58:15)
at Lexer.assertExpression (D:\Workspace\NodeJs\for_delete\node_modules\pug-lexer\index.js:86:12)
at Lexer.attrs (D:\Workspace\NodeJs\for_delete\node_modules\pug-lexer\index.js:1089:18)
at Lexer.callLexerFunction (D:\Workspace\NodeJs\for_delete\node_modules\pug-lexer\index.js:1319:23)
at Lexer.advance (D:\Workspace\NodeJs\for_delete\node_modules\pug-lexer\index.js:1356:15)
at Lexer.callLexerFunction (D:\Workspace\NodeJs\for_delete\node_modules\pug-lexer\index.js:1319:23)
at Lexer.getTokens (D:\Workspace\NodeJs\for_delete\node_modules\pug-lexer\index.js:1375:12)
at lex (D:\Workspace\NodeJs\for_delete\node_modules\pug-lexer\index.js:12:42)
at Object.lex (D:\Workspace\NodeJs\for_delete\node_modules\pug\lib\index.js:99:27)
is it because you are using "pug": "^2.0.0-beta3" and i am using "pug": "^2.0.0-rc.3",
Port the list groups mixin to the new interpolation syntaxand add unit tests
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.