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

shtml2html-fix

v1.0.9

Published

shtml2html is a HTML parser tool that will make include shtml files inline and save as html files.

Downloads

18

Readme

shtml2html-fix

基于“shtml2html”的改进,增加以下几个功能

  1. 增加目录递归查找.shtml文件
  2. 在处理include文件时,将include文件里的路径替换成相对路径

如:include文件里的引用是

<link id="seed_style" rel="stylesheet" type="text/css" href="/static/v1.0/src/css/lib/gm.css">

执行shtml2html-fix后,在html页面中的引用变成为:

<link id="seed_style" rel="stylesheet" type="text/css" href="../../src/css/lib/gm.css">

git:https://github.com/zwlijun/shtml2html

shtml2html

NPM version

shtml2html is a HTML parser tool that will make include shtml files inline and save as html files.

That is to say, the code snipe list below will be replaced by the content of file file.shtml:

<!--#include file="inc/file.shtml" -->
<!--#include virtual="/test/inc/file.shtml" -->

Both Single File and The Entire Folder are supported ! Sub folders are not supported.

Install

Install module with npm:

npm install shtml2html -g

Usage -- command line

shtml2html [options]

shtml2html can run without any option.

In this condition, the program will scan the current folder and process the files, then output them to a temp folder in the current folder with name start with _shtml2html_.

The available options are:

-h, --help                 output usage information
-V, --version              output the version
-s, --source [value]       optional, default is current folder
-d, --destination [value]  optional, default is a temp folder in the source folder
-w, --wwwroot [value]      optional, only required when include files are quoted with absolute path

####Examples

  1. process files in current folder and output to the dest/ sibling folder:
shtml2html -d ../dest
  1. process files in the html/ sub folder and output to the dest/ sub folder:
shtml2html -s html -d dest/
  1. process files in current folder and output to the dest/ sibling folder, include files are quote with absolute path and the web root path is D:\wwwroot\blog\:
shtml2html -d ../dest -w "D:\\wwwroot\\blog\\"
  1. process file a.shtml in current folder and output to the dest/ sibling folder, save as its original name:
shtml2html -s a.shtml -d ../dest
  1. process file a.shtml in current folder and output to the current folder, save as b.html:
shtml2html -s a.shtml -d b.html

The list wording of path are equal in command line, be carefule of the \ and /, especially at the end of a string:

../dest/
..\\dest\\

and, if the folder or file name contains spaces, double quote it:

shtml2html -d "release version/"

You should be clear that the destination is either a file name or a folder name, or file(s) will appear in the wrong place. Of course, you can track the folder from the console information.

Usage -- nodejs file

The best example is the cli.js source file in the src folder. Also, here is a quick start:

var shtml2html = require('shtml2html');
shtml2html(pathFrom, pathTo, pathWwwroot, callback);

The callback is a function that process the result infomations with an array with data structure

[
    {"msg" : "infomation text", "type": "infomation type"}
]

Infomation type can be one of the array ["success", "fail", "warn"].

Release Log

  • ####1.0.5 2013.11.19
    Fix RegExp. bug. Compatible with non-standard wording.

  • ####1.0.4 2013.11.13
    Extend nodejs file usage.

  • ####1.0.3 2013.11.12
    Add package.json dependencies.

  • ####1.0.2 2013.11.12
    Support both single file and the entire folder.

  • ####1.0.1 2013.11.07
    Fix RegExp. bug.
    Add examples in readme file.

  • ####1.0.0 2013.11.06
    First release version

Links

http://www.w3.org/Jigsaw/Doc/User/SSI.html