https://github.com/senselogic/prettify
Source code prettifier.
https://github.com/senselogic/prettify
beautifier c code cpp css d formatter html js json less php prettifier sass scss source xml
Last synced: 2 months ago
JSON representation
Source code prettifier.
- Host: GitHub
- URL: https://github.com/senselogic/prettify
- Owner: SenseLogic
- License: gpl-3.0
- Created: 2017-05-17T15:09:22.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2026-04-05T15:04:58.000Z (2 months ago)
- Last Synced: 2026-04-05T17:11:55.523Z (2 months ago)
- Topics: beautifier, c, code, cpp, css, d, formatter, html, js, json, less, php, prettifier, sass, scss, source, xml
- Language: D
- Size: 123 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README

# Prettify
Source code prettifier.
## Features
* Make source code files with the following extensions adhere to [Coda](https://github.com/senselogic/CODA) spacing rules :
* C : .c .h
* C++ : .cxx .hxx .cpp .hpp
* C# : .cs
* CSS : .css .less .pepss .sass .scss .styl
* JavaScript : .js .jsx .ts .tsx .json
* HTML : .htm .html .xml .twig
* D : .d
* Dart : .dart
* PHP : .php
* Rust : .rs
## Installation
Install the [DMD 2 compiler](https://dlang.org/download.html) (using the MinGW setup option on Windows).
Build the executable with the following command line :
```bash
dmd -m64 prettify.d
```
## Command line
```bash
prettify [options] file_path_filter
```
### Options
```bash
--backup BACKUP_FOLDER/ : store the original files in this folder
--output OUTPUT_FOLDER/ : store the fixed files in this folder
```
### Examples
```bash
prettify ".//*.d"
```
Prettifies all D files in the current folder and its subfolders.
```bash
prettify --backup BACKUP_FOLDER/ "*.php"
```
Prettifies all PHP files after having stored the original files in "BACKUP_FOLDER/".
```bash
prettify --output OUTPUT_FOLDER/ "*.js"
```
Prettifies all JavaScript files and store the fixed files in "OUTPUT_FOLDER/".
## Limitations
- Tabs are systematically converted to four spaces.
- The lexer does not support verbatim strings, raw string literals, interpolated strings and regular expressions.
## Version
1.0
## Author
Eric Pelzer (ecstatic.coder@gmail.com).
## License
This project is licensed under the GNU General Public License version 3.
See the [LICENSE.md](LICENSE.md) file for details.