npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

made-view

v0.7.3

Published

components html preprocessor use for made-build

Downloads

23

Readme

Made-View

Build Status

Getting Started

module's short-class will transform automatic, class will become sid + class. sid generate use made-id.

module's id will become sit + instance + id.

more case please read test/index.js

Language Reference

doctype

doctype html

tags

ul
  li Item A
  li Item B
  li Item C

attributes

a(href='http://google.com') Google
a(href='http://mail.com'
  title='Mail'
  ) Link to Mail

extend

extend(
    name={
      first: 'simon',
      last: 'hao'
    }
    mobile='my phone : #{mobile}'
    desc='this is #{desc}'
    keywords=['web', 'code']
  ) layout.jade
replace header
  header Header
prepend main
  main Main
append footer
  footer Footer

include

div.person
  div.name Made
  div.age 24
    include(like=tea, name='#{author}') desc.jade:top
  div.desc
    include(like=eat, name='#{name}') desc.jade:bottom

conditionals

if person.age === 1
  div Males
else if person.age === 2
  div Females
else
  div God

case

case count
  when 0
    div Zero
  when 1
    div One
  default
    div NaN

code

- for(var i = 0; i < 5; i++){
-   console.log(i)
- }

API

Install

npm install made-view

Options

var options = {
  basedir: 'module_base_dir', //模块相对的根目录,一般来说为工程的src目录
  filename: filename, //模块文件名
  entry: 'view.jade', //模块的入口文件
  ext: '.jade', //模块的默认扩展名
  instance: '' //模块的实例名
};

Transform

{ //转换属性
  src: function(val, sid, options){
    return 'http://' + server_name + server_path + val + md5;
  }
}

Compile

var made_view = require('made-view');
var fs = require('fs');

var filename = 'module_path';
var str = fs.readFileSync(filename, 'utf-8');

var options = {
  basedir: 'module_base_dir',
  filename: filename,
  entry: 'view.jade',
  ext: '.jade',
  instance: 'top'
};

var transform = {
  src: function(val, sid, options){
    return 'http://' + server_name + server_path + val + md5;
  }
};
//预编译

var render = made_view.compile(str, options, transform);

var render = made_view.compile_file(filename, options, transform);

var html = render({
  name: 'qq'
});

//编译为客户端版本

var js = made_view.compile_client(str, options, transform);
var js = made_view.compile_client_file(filename, options, transform);

//js为一个函数,第一个参数即为需要传递的参数