prettyprint.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 03 Oct 2015 18:29:10 +0300
changeset 1765 2132765de2f4
parent 1334 9bf0d5a1f0cf
child 1905 fba288d59662
permissions -rw-r--r--
Cellular automaton.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1334
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1326
diff changeset
     1
.. -*- coding: utf-8; -*-
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1326
diff changeset
     2
.. include:: HEADER.rst
1209
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
===========================
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
 Pretty print source code.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
===========================
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
.. contents::
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
1326
8aac6cb8518d About pretty printing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1323
diff changeset
     9
About pretty printing.
8aac6cb8518d About pretty printing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1323
diff changeset
    10
======================
8aac6cb8518d About pretty printing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1323
diff changeset
    11
1209
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
Code formatter, beautifier, pretty printer.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
1326
8aac6cb8518d About pretty printing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1323
diff changeset
    14
  http://en.wikipedia.org/wiki/Pretty-printer
8aac6cb8518d About pretty printing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1323
diff changeset
    15
                Wiki article.
8aac6cb8518d About pretty printing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1323
diff changeset
    16
1209
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
xml.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
====
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
tidy.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
-----
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
::
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
  $ tidy -xml -i -utf8 -o out.xml in.xml
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    25
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
or in Emacs::
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
  C-x h C-x <RET> c utf-8 <RET> C-u M-| tidy -q -xml -i -utf8 -
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
  http://tidy.sourceforge.net
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
                Home page.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
  http://www.emacswiki.org/cgi-bin/wiki/tidy.el
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
                Emacs bindings.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
xmllint.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
--------
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
::
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    39
  $ xmllint --format file.xml
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41
or in Emacs:
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
  : C-x h C-u M-| xmllint --format - <RET>
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    44
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    45
Emacs and nxml.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    46
---------------
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    47
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    48
You need introduce line-breaks and then::
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    49
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    50
  C-x h C-M-\
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    51
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    52
xmlindent.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    53
----------
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    54
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    55
  http://xmlindent.sourceforge.net/
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    56
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    57
c/c++/java/c#.
1323
1d94538d70c9 http://perltidy.sourceforge.net/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1209
diff changeset
    58
==============
1209
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    59
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    60
Artistic Style, astyle.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    61
-----------------------
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    62
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    63
A Free, Fast and Small Automatic Formatter for C, C++, C#, and Java Source Code.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    64
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    65
There are exist package for Cygwin, Debian.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    66
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    67
  http://astyle.sourceforge.net/
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    68
                home page
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    69
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    70
Uncrustify.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    71
-----------
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    72
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    73
Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    74
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    75
Exist package for Windows (binary from home page), Debian.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    77
  http://uncrustify.sourceforge.net/
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    78
                home page
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    79
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    80
jpplib.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    81
-------
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    83
Pretty Printer Library.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
  http://jpplib.sourceforge.net/
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
                Home page.
bb6eaf58a856 Pretty Printer Library.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
1323
1d94538d70c9 http://perltidy.sourceforge.net/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1209
diff changeset
    88
Perl.
1d94538d70c9 http://perltidy.sourceforge.net/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1209
diff changeset
    89
=====
1d94538d70c9 http://perltidy.sourceforge.net/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1209
diff changeset
    90
1d94538d70c9 http://perltidy.sourceforge.net/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1209
diff changeset
    91
  http://perltidy.sourceforge.net/
1d94538d70c9 http://perltidy.sourceforge.net/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1209
diff changeset
    92
                Home page.
1d94538d70c9 http://perltidy.sourceforge.net/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1209
diff changeset
    93