Created
November 26, 2015 09:09
-
-
Save hideki-a/876a83edcdc710555ad2 to your computer and use it in GitHub Desktop.
インデントなしHTMLをインデントありHTMLに変換
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "indent": 2, | |
| "indent_char": " ", | |
| "indent_scripts": "normal", | |
| "wrap_line_length": 0, | |
| "brace_style": "expand", | |
| "preserve_newlines": true, | |
| "max_preserve_newlines": 1, | |
| "unformatted": [ | |
| "a", | |
| "code", | |
| "pre" | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict' | |
| module.exports = (grunt) -> | |
| require('jit-grunt') grunt | |
| grunt.loadNpmTasks 'grunt-notify' | |
| grunt.initConfig | |
| prettify: | |
| options: | |
| config: '.prettifyrc' | |
| all: | |
| expand: true, | |
| cwd: '../htdocs', | |
| ext: '.html', | |
| src: ['**/*.html'], | |
| dest: '../dist' | |
| replace: | |
| htmlindent: | |
| src: [ | |
| '../dist/*.html' | |
| '../dist/**/*.html' | |
| ] | |
| overwrite: true, | |
| replacements: [ | |
| { | |
| from: /<\/div>\n\s+<!--\s\/(#|\.)/g | |
| to: '</div><!-- /$1' | |
| }, | |
| ] | |
| # Register tasks. | |
| grunt.registerTask 'htmlindent', [ | |
| 'prettify:all' | |
| 'replace:htmlindent' | |
| ] | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "generator-skyward", | |
| "version": "1.0.0", | |
| "scripts": { | |
| "start": "grunt", | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "dependencies": {}, | |
| "devDependencies": { | |
| "grunt": "^0.4.5", | |
| "grunt-notify": "^0.4.1", | |
| "grunt-prettify": "^0.4.0", | |
| "grunt-text-replace": "^0.3.12", | |
| "jit-grunt": "^0.9.0" | |
| }, | |
| "private": true | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment