
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
assemble-midden
Advanced tools
Assemble Helper to create pretty/interactive data dumps using midden.
Formally know as handlebars-midden
Assemble Helper to create pretty/interactive data dumps using midden.
See the midden docs for a further explanation.
npm install assemble-midden --save
Require assemble-midden into your assemblefile.js
and register it as a helper.
var assemble = require('assemble');
var midden = require('assemble-midden');
var app = assemble();
// register midden as a helper
app.helper('midden', midden(true));
Midden has one config variable: isActive. This allows you to deactivate it when generating pages for a production environment. When inactive, it just returns an empty string. It might be used like so...
/* assuming var environment was set earlier */
app.helper('midden', midden(environment==='development'));
For midden to work, you also need to include it's styles and client-side code. You can find those in node_modules/midden/dist/[styles, js]
.
Here's how you might add them to your css
and script
tasks.
There are three stylesheets available: midden.scss
, midden.css
and midden.min.css
. Here's how you might add midden.scss
to a SASS task.
/* using sass and autoprefixer gulp plugins */
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
/* create an array of paths to outside stylesheets */
var styleIncludes = [
'node_modules/midden/dist/styles/'
];
app.task('css', function () {
return app.src('src/scss/app.scss')
.pipe(sass({includePaths: styleIncludes})
.pipe(autoprefixer())
.pipe(app.dest('build/css'));
});
Then in your app.scss
file...
/* Need to include extension so that SASS doesn't include the wrong file */
@import "midden.scss";
If you're using browserify to process your Javascript, just require it in your main JS file.
require('midden/dist/js/midden-client.js');
On page load, it will look for midden elements to attach event handlers to.
Wherever you need to inspect a context value just pass it to the helper.
{{midden "view.data"}}
Load that page from your destination directory and you should see something like this...
The dist/styles/midden.scss
file uses over-writable default values for colors, etc. See the file for a list of values.
Beta release
Fixed issue caused by newer Versions of Assemble.js storing some template properties as buffer.
Feel free to submit issues or pull requests for assemble-midden or midden. Questions on use can also be submitted to the issue queue.
There's a suite of unit tests. mocha test/*-spec.js
Midden also has a gulp file for generating client-side assets and integration testing. gulp default
will spin up a server on port 8000. There, you can demo midden.
© 2016 John O'Donnell (Critical Mash Inc.) Released under the MIT license.
FAQs
Assemble Helper to create pretty/interactive data dumps using midden.
The npm package assemble-midden receives a total of 15 weekly downloads. As such, assemble-midden popularity was classified as not popular.
We found that assemble-midden demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.