Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sparanoid/grunt-doctype
Minimal effort DOCTYPE transformation
https://github.com/sparanoid/grunt-doctype
almace-scaffolding doctype grunt grunt-plugins
Last synced: 12 days ago
JSON representation
Minimal effort DOCTYPE transformation
- Host: GitHub
- URL: https://github.com/sparanoid/grunt-doctype
- Owner: sparanoid
- License: mit
- Created: 2018-10-14T07:05:17.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-03T15:32:47.000Z (almost 2 years ago)
- Last Synced: 2024-11-29T16:00:00.450Z (about 1 month ago)
- Topics: almace-scaffolding, doctype, grunt, grunt-plugins
- Language: JavaScript
- Size: 223 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# grunt-doctype
[![Greenkeeper badge](https://badges.greenkeeper.io/sparanoid/grunt-doctype.svg)](https://greenkeeper.io/)
[![Build Status](https://api.travis-ci.org/sparanoid/grunt-doctype.svg?branch=master)](https://travis-ci.org/sparanoid/grunt-doctype)
[![Dependency Status](https://david-dm.org/sparanoid/grunt-doctype.svg)](https://david-dm.org/sparanoid/grunt-doctype)
[![devDependency Status](https://david-dm.org/sparanoid/grunt-doctype/dev-status.svg)](https://david-dm.org/sparanoid/grunt-doctype#info=devDependencies)
[![npm Version](https://img.shields.io/npm/v/grunt-doctype.svg)](https://www.npmjs.com/package/grunt-doctype)
[![npm Downloads](https://img.shields.io/npm/dm/grunt-doctype.svg)](https://www.npmjs.com/package/grunt-doctype)> Minimal effort DOCTYPE transformation with grunt.
## Getting Started
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
```shell
npm install grunt-doctype --save-dev
```One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
```js
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()`.
```js
grunt.initConfig({
doctype: {
options: {
selector: '/[]*(\[[^]]*\])?>/i'
transform: function (input) {
return ``;
}
},
all: {
files: {
'dest-index.html': 'source-index.html',
},
},
},
});
```### Options
#### `selector`
Defaults to `/]*?)>/i`.
```js
grunt.initConfig({
doctype: {
all: {
options: {
selector: '/[]*(\[[^]]*\])?>/i'
},
files: {
'dest-index.html': 'source-index.html',
},
},
},
});
```#### `transform`
Defaults to:
```js
function (input) {
return input[0].toLowerCase();
}
``````js
grunt.initConfig({
doctype: {
all: {
options: {
transform: function (input) {
return ``;
}
},
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](http://gruntjs.com/).
## Release History
- See `CHANGELOG.md` for release history