posthtml / posthtml-beautify Goto Github PK
View Code? Open in Web Editor NEWA posthtml plugin to beautify you html files. Online service -
Home Page: https://posthtml.github.io/posthtml-beautify/
License: MIT License
A posthtml plugin to beautify you html files. Online service -
Home Page: https://posthtml.github.io/posthtml-beautify/
License: MIT License
{
groups: ['meta', 'script', 'link']
}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
instead
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
export default {
a: {
status: [],
attrs: []
}
}
Currently the eol
setting does nothing to the last line in file. Having it set to \n
should add a new blank line to the end of file.
In posthtml.config.js
I have multiple plugins, which set tree.messages
API property for later usage by posthtml-loader
. I also have posthtml-beautify
as a last plugin declared in posthtml.config.js
.
tree.messages
has proper value if there is no posthtml-beautify
declared in config, but it has undefined
value if I declare posthtml-beautify
in a config (I test this value by checking result.messages
in a posthtml-loader
on this line). So posthtml-beautify
somehow interferes with this property, but from the source I yet can not find how exactly
https://github.com/morishitter/stylefmt
postcss-sorting
<![if !IE]><p>You are not using Internet Explorer.</p><![endif]>
after htmlparser2 return
{ tag: 'p',
content: [ 'You are not using Internet Explorer.' ] }
<!--[if !IE]>--><link href="non-ie.css" rel="stylesheet"><!--<![endif]-->
<!--[if gte IE 7]><!--><p>This is shown in downlevel browsers and IE7 or later.</p><!--<![endif]-->
after htmlparser2 return
1: '<!--[if !IE]>-->',
2: { tag: 'link',
attrs: { href: 'non-ie.css', rel: 'stylesheet' } },
3: '<!--<![endif]-->'
4: '<!--[if gt IE 6]><!-->'
5: 'This code displays on non-IE browsers and on IE 7 or higher.'
6: '<!--<![endif]-->'
see options posthtml processor and options for myself
input html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>instagramator</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<module href="src/html/components/btn-outline.html">Анализировать</module>
</body>
</html>
output html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>instagramator</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<button class="btn-outline">
Анализировать
</button>
</body>
</html>
module html
<button class="btn-outline">
<content></content>
</button>
export default {
a: {
status: [],
attrs: ['href', 'target']
}
}
https://squizlabs.github.io/HTML_CodeSniffer/
Posthtml-w3c
Posthtml-hint
Posthtml-lint
instead {indend} should be {rules}
rules value should be string or boolean
...this is hidden, collapsable content...
export default {
require: {
status: ['deprecated', 'email'], // email - convert style to old attrs for email
boolean: true
}
}
Посмотрите, о чем твитнул(а) @forwebdev: https://twitter.com/forwebdev/status/816347934052728832?s=09
Index 140
How do you feel about running the content of <style></style>
tags through stylefmt and the contents of <script></script>
tags through eslint?
const fixture = '<div></div>\n\n<div></div>';
need return unix notation
When I try to use posthtml-beautify with posthtml running in sync mode, I get this error:
Error: Can’t process contents in sync mode because of async plugin:
base.html
<html>
<head>
<meta charset="utf-8">
<title><block name="title"></block></title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.0.0/normalize.min.css">
<link rel="stylesheet" href="css/demo.css">
<link rel="stylesheet" href="../dist/css/slims.min.css">
</head>
<body class="sl-row-12">
<div class="sl-row-11">
<nav class="sl-offset-pv-10">
<a
href="/"
class="sl-box-inline sl-v-top sl-offset-ph-15 sl-offset-pv-15"
>slims
</a><a
href="https://github.com/gitscrum/slims"
class="sl-box-inline sl-v-top sl-offset-ph-15 sl-offset-pv-15"
>view on GitHub</a>
</nav>
<main><block name="content"></block></main>
</div>
<footer class="sl-row-1 sl-offset-pv-20"><block name="footer">footer content</block></footer>
</body>
</html>
index.html
<extends src="layout/base.html">
<block name="title">slims</block>
<block name="content">
<div class="sl-clearfix sl-offset-pv-20">
<aside class="sl-box-right sl-col-4"><module href="layout/menu.html"></module></aside>
<section class="sl-box-left sl-col-8">
<header>
<h1 class="sl-offset-mh-0">slims</h1>
<p>Vanilla CSS framework</p>
</header>
</section>
</div>
</block>
</extends>
resutl.html
<html>
<head>
<meta charset="utf-8">
<title>slims</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.0.0/normalize.min.css">
<link rel="stylesheet" href="css/demo.css">
<link rel="stylesheet" href="../dist/css/slims.min.css">
</head>
<body class="sl-row-12">
<div class="sl-row-11">
<nav class="sl-offset-pv-10">
<a href="/" class="sl-box-inline sl-v-top sl-offset-ph-15 sl-offset-pv-15">slims
</a><a href="https://github.com/gitscrum/slims" class="sl-box-inline sl-v-top sl-offset-ph-15 sl-offset-pv-15">view on GitHub</a>
</nav>
<main>
<div class="sl-clearfix sl-offset-pv-20">
<aside class="sl-box-right sl-col-4">
<ul>
<li>test</li>
</ul>
</aside>
<section class="sl-box-left sl-col-8">
<header>
<h1 class="sl-offset-mh-0">slims</h1>
<p>Vanilla CSS framework</p>
</header>
</section>
</div>
</main>
</div>
<footer class="sl-row-1 sl-offset-pv-20">footer content</footer>
</body>
</html>
if (level === 0 && (tree.length - 1) === index) {
return [...previousValue, node];
}
update to
if (level === 0 && (tree.length - 1) === index) {
return [...previousValue, getIndent(level), node];
}
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.
Since we did not receive a CI status on the greenkeeper/initial
branch, we assume that you still need to configure it.
If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/
.
We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.