Code Monkey home page Code Monkey logo

css-html-prettify's Introduction

css-html-prettify

Async single-file cross-platform no-dependencies Prettifier Beautifier for the Web. GPL License LGPL License Python Version

screenshot

https://pypi.python.org/pypi/css-html-prettify

css-html-prettify.py --help

usage: css-html-prettify.py [-h] [--version] [--prefix PREFIX] [--timestamp]
[--quiet] [--checkupdates] [--after AFTER]
[--before BEFORE] [--watch] [--group] [--justify]
fullpath

CSS-HTML-Prettify. StandAlone Async single-file cross-platform no-dependencies
Unicode-ready Python3-ready Prettifier Beautifier for the Web.

positional arguments:
    fullpath         Full path to local file or folder.

optional arguments:
    -h, --help       show this help message and exit
    --version        show programs version number and exit
    --prefix PREFIX  Prefix string to prepend on output filenames.
    --timestamp      Add a Time Stamp on all CSS/SCSS output files.
    --quiet          Quiet, Silent, force disable all Logging.
    --checkupdates   Check for Updates from Internet while running.
    --after AFTER    Command to execute after run (Experimental).
    --before BEFORE  Command to execute before run (Experimental).
    --watch          Re-Compress if file changes (Experimental).
    --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: Takes file or folder full path string and process all
CSS/SCSS/HTML found. If argument is not file/folder will fail. Check Updates
works on Python3. StdIn to StdOut is deprecated since may fail with unicode
characters. CSS Properties are AlphaSorted,to help spot cloned ones,Selectors
not. Watch works for whole folders, with minimum of ~60 Secs between runs.
  • Takes a full path to anything, a file or a folder, then parse, Prettify and Beautify for Human Development.
  • If full path is a folder with multiple files it will use Async Multiprocessing.
  • Pretty-Printed colored Logging to Standard Output and Log File on OS Temporary Folder.
  • Set its own Process name and show up on Process lists.
  • Full Unicode/UTF-8 support, SASS SCSS Support.
  • Smooth CPU usage.
  • Can Watch for changes on files.
  • Can execute arbitrary commands after and before running.
  • *.css files are saved as *.css, *.html are saved as *.html, unless provided a prefix.

Use

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/

Install

pip install css-html-prettify

Uninstall pip uninstall css-html-prettify

Why?

Requisites

Optional:

  • BeautifulSoup 4+ (Recommeded, for HTML5 Prettify, without BeautifulSoup it works, but only strict XHTML can be processed)

Example

Input CSS:

/* dont remove this comment */
.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"}

Output CSS:

@charset utf-8;


/* dont remove this comment */
.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"}

Coding Style Guide

  • Lint, PEP-8, PEP-257, iSort must Pass Ok. pip install prospector pre-commit isort
  • If theres any kind of Tests, they must Pass Ok, if theres no Tests, its ok, if Tests provided, is even better.

Contributors

  • Please Star this Repo on Github !, it helps to show up faster on searchs.
  • Help and more Help and Interactive Quick Git Tutorial.

Licence

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.