Coder Social home page Coder Social logo

grunt-doctype's Introduction

grunt-doctype

Greenkeeper badge Build Status Dependency Status devDependency Status npm Version npm Downloads

Minimal effort DOCTYPE transformation with grunt.

Getting Started

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-doctype --save-dev

One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-doctype');

The "doctype" task

Overview

In your project's Gruntfile, add a section named doctype to the data object passed into grunt.initConfig().

grunt.initConfig({
  doctype: {
    options: {
      selector: '/<!DOCTYPE[^>[]*(\[[^]]*\])?>/i'
      transform: function (input) {
        return `<!${input[1].toLowerCase()} HTML>`;
      }
    },
    all: {
      files: {
        'dest-index.html': 'source-index.html',
      },
    },
  },
});

Options

selector

Defaults to /<!(DOCTYPE)([^>]*?)>/i.

grunt.initConfig({
  doctype: {
    all: {
      options: {
        selector: '/<!DOCTYPE[^>[]*(\[[^]]*\])?>/i'
      },
      files: {
        'dest-index.html': 'source-index.html',
      },
    },
  },
});

transform

Defaults to:

function (input) {
  return input[0].toLowerCase();
}
grunt.initConfig({
  doctype: {
    all: {
      options: {
        transform: function (input) {
          return `<!${input[1].toLowerCase()} HTML>`;
        }
      },
      files: {
        'dest-index.html': 'source-index.html',
      },
    },
  },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • See CHANGELOG.md for release history

grunt-doctype's People

Contributors

greenkeeper[bot] avatar renovate-bot avatar sparanoid avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

grunt-doctype's Issues

An in-range update of grunt-contrib-nodeunit is breaking the build 🚨

The devDependency grunt-contrib-nodeunit was updated from 2.0.0 to 2.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

grunt-contrib-nodeunit is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 3 commits.

  • d370717 v2.1.0
  • 02089d5 Clean up and update to latest contrib (#58)
  • deca505 Upgrade nodeunit-x from 0.12.1 to 0.13.0 and tap from ^12.0.1 to ^14.10.6 (#57)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Dependency deprecation warning: time-grunt (npm)

On registry http://registry.npmjs.org/, the "latest" version (v2.0.0) of dependency time-grunt has the following deprecation notice:

Deprecated because Grunt is practically unmaintained. Move on to something better. This package will continue to work with Grunt v1, but it will not receive any updates.

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about time-grunt's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

npm
package.json
  • grunt ^1.0.3
  • grunt-bump ^0.8.0
  • grunt-contrib-clean ^2.0.0
  • grunt-contrib-jshint ^2.0.0
  • grunt-contrib-nodeunit ^2.0.0
  • grunt-conventional-changelog ^6.1.0
  • grunt-npm 0.0.2
  • matchdep ^2.0.0
  • time-grunt ^2.0.0
  • node >= 0.12
travis
.travis.yml
  • node 9
  • node 10

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.