annotate textshaper/textshaper.py @ 1:92baf2c5652f

-> http://k0s.org/portfolio/ideas/textshaper.py
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 10 Aug 2013 22:00:50 -0700
parents
children e5adf3414c6b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/usr/bin/env python
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 = textshaper =
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 /text manipulation/
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 So you have a block of text ...
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 What do you want to do with it?!?
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 == Desired Functionality ==
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 == Previous work ==
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 /corpus of past programs -> consolidate/
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 - onelineit
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 - quoting
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 - dequoting (including e.g. +/-, diff-ish shit)
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 - removing timestamps
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22 - removing/adding irc quote tags
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24 Interface:
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25 - library code
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 - (n)curses
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27 - javascript/REST
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
28
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 Consider the pattern:
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31 * things that add and/or remove a thing
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32 * things that alter spacing
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
33
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35 == Reference ==
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
36
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
37 Previous k0s.ware (big and small):
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
38 - http://k0s.org/hg/config/rev/5e0b4ec36013
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
39
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
40 Highly related (~> identity): http://k0s.org/portfolio/ideas/cleanuptext.py
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
41
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
42 Ubuntu packages:
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
43 - par (paragraph reformatter)
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
44 """
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
45
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
46 #!/usr/bin/env python
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
47
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
48
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
49
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
50
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
51
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
52
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
53
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
54
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
55
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
56
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
57
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
58