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

hotlang

v1.4.0

Published

It's hot. Not scalding, like HTML.

Downloads

1

Readme

hotlang

npm GitHub issues Travis

It's hot. Not scalding, like HTML.

Installing and Usage:

npm install hotlang
hot exampleFile.hot

Command line API:

hot <filePath>

Compiles a hot file, the file does not need to have the hot extension

hot <folderPath>

If a hotconfig.json file is present, uses this file to determine which files to compile. Otherwise, compiles all .hot files in the folder.

hot <...paths>

Takes any number of paths (separated by spaces). Each path is compiled, if it is a file, or its contents are compiled, if it is a folder.

hotconfig.json

interface CompileConfig {
	files?: Glob;
	file?: string;
	out?: string;
	outDir?: string;
	compileAll?: true;
	srcRoot?: string;
};
type HotConfigJson = CompileConfig | CompileConfig[];

The hotconfig.json should contain an array of CompileConfigs or a single CompileConfig, specifying what to compile, and how to do it.

CompileConfig.files

Takes a Glob, points to the files which should be compiled.

CompileConfig.file

Points to the file which should be compiled.

CompileConfig.out

If set, the resulting HTML will be in this file.

CompileConfig.outDir

If set, the resulting HTML files will be placed into this directory, with names based on their .hot file names. Ex: file.hot -> file.html

CompileConfig.compileAll

If set to true, all Hot files imported are compiled into this directory. (Not just the one(s) requested with CompileConfig.files or CompileConfig.file)

The Language

The point of Hot is to make HTML simpler and easier to maintain. As a result this can reduce the temptation to do too much document generation in JavaScript, and therefore keep your document/scripts/styles separate.

The syntax of Hot is inspired by CSS selectors. Here's a simple example:

button#title.giant: "Amazing App Name"

This compiles to this html:

<button id="title" class="giant">
	Amazing App Name
</button>

Attributes are slightly different than with CSS selectors:

button[title: "Home", aria-label: "Home"]: "Home"
<button title="Home" aria-label="Home">
	Home
</button>

To do an attribute without a value, format like this:

div[no-val; also-no-val]
<div no-val also-no-val></div>

To create an element with no whitespace between its children:

div:= "I'm all alone!"
<div>I'm all alone!</div>
div:= 
	"I'm sandwiched here!"
	span: "muahhahaha"
<div>I'm sandwiched here!<span>
	muahhahaha
</span></div>

Single-line and block comments:

# comment
###
	Block comment!
	Allows multiple lines.
### Block comments can also start on the same line.
div: "And be only one line long."

You can also end a block comment prematurely/explicitly by using the triple hash, either on the same line or the following.

###
	Block comment! ###
###
	Block comment!
###

You can keep comments in the output by appending an additional hash to them. For example:

## This comment appears in the output!
<!-- This comment appears in the output! -->

Or, with a block:

####
	This comment appears
	in the output!
<!--
This comment appears
in the output!	
-->

Importing other files

# world.hot
span: "world!"
# hello.hot
div: 
	span: "Hello,"
	!import[src: "./world"]

Resulting html of compiling hello.hot:

<div>
	<span>Hello,</span>
	<span>world!</span>
</div>

Passing content in to imported hot files

# helloworld.hot
!import[src: "./hello"]: "world"
# hello.hot
span:= "Hello, " !content "!"
# helloworld.html
<span>Hello, world!</span>

Importing Stylesheets and Scripts:

Javascript

!import[script; src: "./main"]
<script src="./main.js"></script>

CSS

!import[style; src: "./main"]
<link rel="stylesheet" href="./main.css"/>

Importing all hot files in a folder

!import[src: "./folder/*"]

All hot files in the folder are compiled and inserted into the resulting document. The order of the imported files is not guaranteed.

Block strings

p: """
	This is all text that will be in this paragraph element.
	This is a second line of text in the paragraph. 
<p>This is all text that will be in this paragraph element.<br>This is a second line of text in the paragraph.</p>

MIT License

Copyright 2017 Mackenzie McClane