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

gulp-hotcopy

v0.7.3

Published

A tool to include converted ArchieML-to-JSON copy in a page's nunjucks context.

Downloads

14

Readme

Dynamic copy for your Gulp-generated HTML.

npm version npm downloads npm Github issues

Features

  • Descriptions TK.

Installation

This library is very specific to projects built with the latest versions of the generator-dmninteractives tool. As such, the instructions may not be particularly clear to external users.

If you're already using our generator tool, you can add hot copy in four easy steps:

  1. Run the following line (or add gulp-hotcopy to your project's dependencies/devDependencies):
npm install gulp-hotcopy
  1. Add an ArchieML file (with a .aml extension) to ./src/assets/hotcopy/.

  2. Add the line "hotCopyDocument": "true" to your meta.json.

  3. Connect the hot copy to your template using the following code:

{% set hotCopy = hotCopyHelper() %}
{% set copy = hotCopy.connect('my_file') %}

NOTE: The my_file value should have the same name as the .aml file you created earlier. You can connect several .aml files to an individual HTML page — just repeat the second line above, changing both the value passed to hotCopy.connect() and the variable this output is assigned to on each successive call.

  1. Test the integration by loading a value from the ArchieML file.

A variable called headline at the top level of the ArchieML file should now be accessible as {{ copy.headline }}.

You can also use the following formatters to render pieces of content in standard DMN styles:

  • {% include "hot-copy/_author-formatter.html" %}: Renders the first <p> tag in our byline block, using an authors variable at the top level of the ArchieML file. (This formatter expects the authors variable to be a list of author objects, each of which must contain name and email fields.)

  • {% for bodyGraph in copy.body %}{% include "hot-copy/_graph-formatter.html" %}{% endfor %}: Renders each item listed in the top-level body variable, according to defined styles. Items in this list without a specific type will be rendered by the ./src/templates/hot-copy/text-graph.html (plain paragraph) template. Other types will be rendered by their corresponding .html file in ./src/templates/embeds/.

Credits