独立的跨平台Web美化器,用于异步单文件。
项目描述
# css-html-prettify
Async single-file cross-platform no-dependencies Prettifier Beautifier for the Web. [](https://open-source.org.cn/licenses/GPL-3.0) [](https://open-source.org.cn/licenses/LGPL-3.0) [](https://pythonlang.cn)

https://pypi.python.org/pypi/css-html-prettify
```bash
css-html-prettify.py --help
用法:css-html-prettify.py [-h] [--version] [--prefix PREFIX] [--timestamp]
[--quiet] [--checkupdates] [--after AFTER]
[--before BEFORE] [--watch] [--group] [--justify]
fullpath
CSS-HTML-Prettify. 独立版 异步 单文件 跨平台 无依赖
适用于Web的Unicode兼容 Python3兼容的美化器
位置参数
fullpath 本地文件或文件夹的完整路径。
可选参数
-h, --help 显示此帮助信息并退出
--version 显示程序版本号并退出
--prefix PREFIX 在输出文件名前添加前缀字符串。
--timestamp 在所有CSS/SCSS输出文件上添加时间戳。
--quietQuiet, Silent, 强制禁用所有日志。
--checkupdates 在运行时检查更新。
--after AFTER 运行后要执行的命令(实验性)。
--before BEFORE 运行前要执行的命令(实验性)。
--watch 如果文件更改则重新压缩(实验性)。
--group Group Alphabetically CSS Poperties by name.
--justify Right Justify CSS Properties (Experimental).
--extraline Add 1 New Line for each New Line (Experimental)
CSS-HTML-Prettify: 接受文件或文件夹的完整路径字符串,处理所有
CSS/SCSS/HTML。如果参数不是文件/文件夹将失败。检查更新
在Python3上运行。StdIn到StdOut已被弃用,因为它可能会与unicode字符失败。
CSS属性按字母顺序排序,以帮助识别克隆的属性,选择器不排序。
Watch适用于整个文件夹,运行之间至少有~60秒的间隔。
```
- 接受任何东西的完整路径,文件或文件夹,然后解析,美化,以供人类开发。
- 如果完整路径是包含多个文件的文件夹,它将使用异步多进程。
- 将美化后的彩色日志打印到标准输出和操作系统临时文件夹中的日志文件。
- 设置自己的进程名称并显示在进程列表中。
- 完全支持Unicode/UTF-8,支持SASS SCSS。
- 平滑CPU使用率。
- 可以监视文件更改。
- 可以在运行前后执行任意命令。
- `*.css`文件保存为`*.css`,`*.html`保存为`*.html`,除非提供前缀。
# 使用
```shell
css-html-prettify.py file.html
css-html-prettify.py file.htm
css-html-prettify.py file.css
css-html-prettify.py file.scss
css-html-prettify.py /project/static/
```
# 安装
```
pip install css-html-prettify
```
卸载 `pip uninstall css-html-prettify`
# 为什么?
- 此项目是[另一个项目的较小版本,该项目的功能与此相反,是一个Web的Minifier Compressor](https://github.com/juancarlospaco/css-html-js-minify#css-html-js-minify)。
# 必要条件
- [Python 3.6+](https://pythonlang.cn "Python Homepage")
**可选:**
- BeautifulSoup 4+(推荐,用于HTML5美化,没有BeautifulSoup也可以工作,但只能处理严格的XHTML)
# 示例
<details>
**输入CSS:**
```css
/* 不删除此注释 */
.class, #NotHex, input[type="text"], a:hover {
border:none;
margin:0 0 0 0;
border-color: fuchsia;
color: mediumspringgreen;
background-position:0 0;
transform-origin:0 0;
margin: 0px !important;
color: #000000;
background-color: #FFFFFF;
}
.foo {content: "If you leave too much new lines it will add a horizontal line"}
```
**输出CSS:**
```css
@charset utf-8;
/* 不删除此注释 */
.class, #NotHex, input[type="text"], a:hover {
background-color: #FFFFFF;
background-position: 0 0;
border: none;
border-color: fuchsia;
color: mediumspringgreen;
color: #000000;
margin: 0 0 0 0;
margin: 0 !important;
transform-origin: 0 0;
}
/* ------------------------------------------------------------------------ */
.foo {content: "If you leave too much new lines it will add a horizontal line"}
```
</details>
# 编码风格指南
- Lint, [PEP-8](https://pythonlang.cn/dev/peps/pep-0008), [PEP-257](https://pythonlang.cn/dev/peps/pep-0257), [iSort](https://github.com/timothycrosley/isort) 必须通过。
- 如果有任何类型的测试,它们必须通过,如果没有测试,那是可以的,如果提供了测试,那就更好了。
# 贡献者
- **请在Github上星标此仓库**,这有助于更快地在搜索结果中显示。
- [帮助](https://help.github.com/articles/using-pull-requests) 和更多 [帮助](https://help.github.com/articles/fork-a-repo) 以及交互式快速 [Git 教程](https://try.github.io)。
# 许可证
- GNU GPL 最新版本 *和* GNU LGPL 最新版本 *以及* 您通过错误报告请求的任何许可证 [您可以通过错误报告](https://github.com/juancarlospaco/css-html-prettify/issues/new)。
Async single-file cross-platform no-dependencies Prettifier Beautifier for the Web. [](https://open-source.org.cn/licenses/GPL-3.0) [](https://open-source.org.cn/licenses/LGPL-3.0) [](https://pythonlang.cn)

https://pypi.python.org/pypi/css-html-prettify
```bash
css-html-prettify.py --help
用法:css-html-prettify.py [-h] [--version] [--prefix PREFIX] [--timestamp]
[--quiet] [--checkupdates] [--after AFTER]
[--before BEFORE] [--watch] [--group] [--justify]
fullpath
CSS-HTML-Prettify. 独立版 异步 单文件 跨平台 无依赖
适用于Web的Unicode兼容 Python3兼容的美化器
位置参数
fullpath 本地文件或文件夹的完整路径。
可选参数
-h, --help 显示此帮助信息并退出
--version 显示程序版本号并退出
--prefix PREFIX 在输出文件名前添加前缀字符串。
--timestamp 在所有CSS/SCSS输出文件上添加时间戳。
--quietQuiet, Silent, 强制禁用所有日志。
--checkupdates 在运行时检查更新。
--after AFTER 运行后要执行的命令(实验性)。
--before BEFORE 运行前要执行的命令(实验性)。
--watch 如果文件更改则重新压缩(实验性)。
--group Group Alphabetically CSS Poperties by name.
--justify Right Justify CSS Properties (Experimental).
--extraline Add 1 New Line for each New Line (Experimental)
CSS-HTML-Prettify: 接受文件或文件夹的完整路径字符串,处理所有
CSS/SCSS/HTML。如果参数不是文件/文件夹将失败。检查更新
在Python3上运行。StdIn到StdOut已被弃用,因为它可能会与unicode字符失败。
CSS属性按字母顺序排序,以帮助识别克隆的属性,选择器不排序。
Watch适用于整个文件夹,运行之间至少有~60秒的间隔。
```
- 接受任何东西的完整路径,文件或文件夹,然后解析,美化,以供人类开发。
- 如果完整路径是包含多个文件的文件夹,它将使用异步多进程。
- 将美化后的彩色日志打印到标准输出和操作系统临时文件夹中的日志文件。
- 设置自己的进程名称并显示在进程列表中。
- 完全支持Unicode/UTF-8,支持SASS SCSS。
- 平滑CPU使用率。
- 可以监视文件更改。
- 可以在运行前后执行任意命令。
- `*.css`文件保存为`*.css`,`*.html`保存为`*.html`,除非提供前缀。
# 使用
```shell
css-html-prettify.py file.html
css-html-prettify.py file.htm
css-html-prettify.py file.css
css-html-prettify.py file.scss
css-html-prettify.py /project/static/
```
# 安装
```
pip install css-html-prettify
```
卸载 `pip uninstall css-html-prettify`
# 为什么?
- 此项目是[另一个项目的较小版本,该项目的功能与此相反,是一个Web的Minifier Compressor](https://github.com/juancarlospaco/css-html-js-minify#css-html-js-minify)。
# 必要条件
- [Python 3.6+](https://pythonlang.cn "Python Homepage")
**可选:**
- BeautifulSoup 4+(推荐,用于HTML5美化,没有BeautifulSoup也可以工作,但只能处理严格的XHTML)
# 示例
<details>
**输入CSS:**
```css
/* 不删除此注释 */
.class, #NotHex, input[type="text"], a:hover {
border:none;
margin:0 0 0 0;
border-color: fuchsia;
color: mediumspringgreen;
background-position:0 0;
transform-origin:0 0;
margin: 0px !important;
color: #000000;
background-color: #FFFFFF;
}
.foo {content: "If you leave too much new lines it will add a horizontal line"}
```
**输出CSS:**
```css
@charset utf-8;
/* 不删除此注释 */
.class, #NotHex, input[type="text"], a:hover {
background-color: #FFFFFF;
background-position: 0 0;
border: none;
border-color: fuchsia;
color: mediumspringgreen;
color: #000000;
margin: 0 0 0 0;
margin: 0 !important;
transform-origin: 0 0;
}
/* ------------------------------------------------------------------------ */
.foo {content: "If you leave too much new lines it will add a horizontal line"}
```
</details>
# 编码风格指南
- Lint, [PEP-8](https://pythonlang.cn/dev/peps/pep-0008), [PEP-257](https://pythonlang.cn/dev/peps/pep-0257), [iSort](https://github.com/timothycrosley/isort) 必须通过。
- 如果有任何类型的测试,它们必须通过,如果没有测试,那是可以的,如果提供了测试,那就更好了。
# 贡献者
- **请在Github上星标此仓库**,这有助于更快地在搜索结果中显示。
- [帮助](https://help.github.com/articles/using-pull-requests) 和更多 [帮助](https://help.github.com/articles/fork-a-repo) 以及交互式快速 [Git 教程](https://try.github.io)。
# 许可证
- GNU GPL 最新版本 *和* GNU LGPL 最新版本 *以及* 您通过错误报告请求的任何许可证 [您可以通过错误报告](https://github.com/juancarlospaco/css-html-prettify/issues/new)。
项目详情
下载文件
下载您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。
源分布
css-html-prettify-2.5.5.zip (18.0 kB 查看哈希值)
构建分布
css_html_prettify-2.5.5-py3.6.egg (10.4 kB 查看哈希值)
关闭
css-html-prettify-2.5.5.zip 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 4fbdd6d42256fc9573fea57874852b8df58bef469b0a3e2f154000b85bcbbc44 |
|
MD5 | 60c75b52d27fa66261d85f3e01f2ebaa |
|
BLAKE2b-256 | 4904bb7856e351315046516399c37974e9dafbb3f1ca1593f35ccbfe25aa4ad1 |
关闭
css_html_prettify-2.5.5-py3.6.egg 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | d1df7cf0830298a5dd532dfefa240291021d66097b4f8446cbbf3b3050f04b61 |
|
MD5 | fa16a905e48a6e43fcd7f193a7cfb6a8 |
|
BLAKE2b-256 | 23655d29956c12db631e1b3711c368fd492c10cc47afe7e64d1aeb06d9c22df8 |
关闭
css_html_prettify-2.5.5-py2.py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 992040e47cd81511c8ca8f632febda380b7d93908418703a29d310c0b56077a6 |
|
MD5 | c8baee8868bcb229a62f5085a187d53d |
|
BLAKE2b-256 | bc604160db2abca67e80cc61c3c59dc2d477c59701a0412f3c1742094f7e2d8d |