Commit 51104667 authored by Nikolay Gromov's avatar Nikolay Gromov

Автоматизация: улучшил форматирование html

parent b1424790
{
"indent_size": 2,
"indent_char": " ",
"eol": "\n",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 5,
"jslint_happy": false,
"space_after_anon_function": false,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": false,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0,
"wrap_attributes": "auto",
"wrap_attributes_indent_size": 2,
"end_with_newline": true,
"html": {
"unformatted": [
"a",
"abbr",
"acronym",
"address",
"area",
"audio",
"b",
"bdi",
"bdo",
"big",
"br",
"button",
"canvas",
"cite",
"code",
"data",
"datalist",
"del",
"dfn",
"dt",
"em",
"embed",
"i",
"iframe",
"img",
"input",
"ins",
"ins",
"kbd",
"keygen",
"map",
"mark",
"math",
"meter",
"noscript",
"object",
"output",
"progress",
"q",
"ruby",
"s",
"samp",
"select",
"small",
"span",
"strike",
"strong",
"sub",
"sup",
"template",
"text",
"textarea",
"time",
"tt",
"u",
"var",
"video",
"wbr"
],
"js": {
"end_with_newline": false
}
}
}
...@@ -38,6 +38,7 @@ const spritesmith = require('gulp.spritesmith'); ...@@ -38,6 +38,7 @@ const spritesmith = require('gulp.spritesmith');
const merge = require('merge-stream'); const merge = require('merge-stream');
const imagemin = require('gulp-imagemin'); const imagemin = require('gulp-imagemin');
const prettyHtml = require('gulp-pretty-html'); const prettyHtml = require('gulp-pretty-html');
const replace = require('gulp-replace');
const ghpages = require('gh-pages'); const ghpages = require('gh-pages');
const path = require('path'); const path = require('path');
...@@ -105,6 +106,9 @@ function compilePug() { ...@@ -105,6 +106,9 @@ function compilePug() {
.pipe(debug({title: 'Compiles '})) .pipe(debug({title: 'Compiles '}))
.pipe(pug(pugOption)) .pipe(pug(pugOption))
.pipe(prettyHtml(prettyOption)) .pipe(prettyHtml(prettyOption))
.pipe(replace(/^(\s*)(<button.+?>)(.*)(<\/button>)/gm, '$1$2\n$1 $3\n$1$4'))
.pipe(replace(/^( *)(<.+?>)(<script>)([\s\S]*)(<\/script>)/gm, '$1$2\n$1$3\n$4\n$1$5\n'))
.pipe(replace(/^( *)(<.+?>)(<script\s+src.+>)(?:[\s\S]*)(<\/script>)/gm, '$1$2\n$1$3$4'))
.pipe(through2.obj(getClassesToBlocksList)) .pipe(through2.obj(getClassesToBlocksList))
.pipe(dest(dir.build)); .pipe(dest(dir.build));
} }
...@@ -126,6 +130,9 @@ function compilePugFast() { ...@@ -126,6 +130,9 @@ function compilePugFast() {
.pipe(debug({title: 'Compiles '})) .pipe(debug({title: 'Compiles '}))
.pipe(pug(pugOption)) .pipe(pug(pugOption))
.pipe(prettyHtml(prettyOption)) .pipe(prettyHtml(prettyOption))
.pipe(replace(/^(\s*)(<button.+?>)(.*)(<\/button>)/gm, '$1$2\n$1 $3\n$1$4'))
.pipe(replace(/^( *)(<.+?>)(<script>)([\s\S]*)(<\/script>)/gm, '$1$2\n$1$3\n$4\n$1$5\n'))
.pipe(replace(/^( *)(<.+?>)(<script\s+src.+>)(?:[\s\S]*)(<\/script>)/gm, '$1$2\n$1$3$4'))
.pipe(through2.obj(getClassesToBlocksList)) .pipe(through2.obj(getClassesToBlocksList))
.pipe(dest(dir.build)); .pipe(dest(dir.build));
} }
......
...@@ -16,6 +16,8 @@ block header ...@@ -16,6 +16,8 @@ block header
block content block content
h1 Заголовок h1 Заголовок
p Содержимое. #[a(href='blocks-demo.html') Библиотека блоков]. p Содержимое. #[a(href='blocks-demo.html') Библиотека блоков].
svg(xmlns='http://www.w3.org/2000/svg', width='32', height='32', viewBox='0 0 470.513 470.513')
path(d='M271.521 154.17v-40.541c0-6.086.28-10.8.849-14.13.567-3.335 1.857-6.615 3.859-9.853 1.999-3.236 5.236-5.47 9.706-6.708 4.476-1.24 10.424-1.858 17.85-1.858h40.539V0h-64.809c-37.5 0-64.433 8.897-80.803 26.691-16.368 17.798-24.551 44.014-24.551 78.658v48.82h-48.542v81.086h48.539v235.256h97.362V235.256h64.805l8.566-81.086h-73.37z')
block footer block footer
+page-footer() +page-footer()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment