cambridge-healthcare / grunt-stencil Goto Github PK
View Code? Open in Web Editor NEWHTML templating for grunt with doT and Markdown
License: MIT License
HTML templating for grunt with doT and Markdown
License: MIT License
Hi!
After adding grunt-stencil to my package.json file and installing, I got several errors about some packages not being installed. Specifically: underscore, marked and dot. I fixed it by adding them to my package.json file. I'm not sure if those were meant to be runtime dependencies or not (I only see them under devDependencies in stencil's package.json). Just wanted to give you a heads up.
at the moment all files for the dot.js parser has to end with .dot.html. plsease make this configurable so we can set dot.js templates to file ending .123 for example
hi, first thanks for stencil i like it :)
is there any way to get well formatted html out of stencil? with default settings it just generates a single line html file :(
Stencil has made my day. One thing though...Is there a way to preserve the HTML indentation structure? When it generates the output file it collapses/minifies the HTML, but I need the markup to be formatted.
Thanks much.
I'm trying to get Stencil to work with a structure resembling that of Jekyll (which is a nice way of structuring a static site's source in my opinion). It involves prefixing all folders that are used for processing the templates with an underscore.
Everything seems to work, but the only part that's giving me trouble is the pages themselves. In my config I'm ignoring all folders prefixed with a dot or an underscore, which works. I'm trying to process all .dot.html
files from the root onwards, but when I do this I get the following error message:
Warning: The file ./_includes/with_header.* cannot be found. Use --force to continue.
Which is strange since that include does not exist, and isn't even referenced anywhere in my code... When I set the cwd
to _pages
and include my .dot.html
files there everything works just fine.
Any idea why this is? I've included my configuration below (I'm using load-grunt-config
btw.):
module.exports = {
main: {
options: {
env: {
title: "Stencil"
},
templates: "./_templates",
partials: "./_includes"
},
files: [{
expand: true,
cwd: "./_pages/",
src: ["**/*.dot.html", "!_**/*", "!.**/*"],
dest: "./_dist",
ext: ".html",
flatten: false
}]
}
};
This is because the check to see whether the file has meta data is a simple src[0] === '{'
. This should exclude files that begin with {{
.
Since I couldn't find it in the examples: does grunt-stencil allow for addition of an "active" class to a nav item that is currently active?
I had a template: default-page.dot.html
<body>
{{= it.document }}
</body>
A page: index.dot.html
{
"template": "default-page"
}
<div>
<h1>Title</h1>
</div>
And output this:
<body>
<div>
<h1>Title</h1>
</div>
</body>
I've tried different places for the {{= it.document }}
but still breaks.
@brainshave I want to enable GFM and Tables in marked. I can't create an issue on the Zetzer fork - can you transfer ownership/enable issues on brainshave/zetzer ? If you don't have this on your immediate roadmap I would be happy to fork and PR :)
i need to include one single file from my .tmp folder so not my default defined partials folder in config. is there any way to do that? working with ../../ in it.include does not work
Either fix version of marked or investigate further.
Originally reported in #8 :
[…] worth noting that your fixture test fails with [email protected] as they added header IDs […]
So I have my template which pulls in my page, then in my page I have:
{{ it.include("personal_step_one") }}
But that partial isn't getting pulled in, any ideas??
Okay, I'm doing something wrong when I'm trying to access the meta-data of the "main.dot.html" from the partial "product.dot.html"
main.dot.html
{
"pTitle": "iddqd"
}
<div class="products">
{{= it.include('partials/product.dot.html') }}
</div>
product.dot.html
<h1>{{= it.pTitle }}</h1>
Output
<div class="products">
<h1>undefined</h1>
</div>
I spent a couple hours trying to get this to work (on Windows) and was about to give up until I saw the meta_data_separator and was able to add in "\r\n\r\n" to get it to work in Windows.
I wonder somehow this option can be discarded since it'll cause a lot of cross-platform issues. I'd like to use grunt-stencil for some of our work but I'd like it work on both Windows and Mac/Linux.
Could an array work for that parameters so I could use:
meta_data_separator: ["\r\n\r\n", "\n\n"] so it's cross-platform compatible?
Hello,
I try to acces some meta data fields from a page into the layout (using it.document.var_name) but grunt keep throw an error:
* "Cannot read property 'page_title' of undefined Use".*
Any ideas ?
index.dot.html
{
"template": "main",
"page_title": "home"
}
<div class="page">
<!-- Some Content -->
</div>
main.dot.html
<div class="{{= it.document.page_title }}">
{{= it.document }}
</div>
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.