24 | Did you know that any piece of code is likely to be read over a hundred times more often than is written?
25 | Most of a developer's time is spent and trying to understand code.
26 | Sigvehtml is a HTML dialect which focuses on readability and the ability to get a quick overview.
27 |
28 |
29 |
30 | With sigvehtml, there is no longer any need to wade trough thickets of nested divs and spans and what-have-you's to get to a real understanding of what is going on.
31 | Throw the boilerplate soup out of the window, and increase your productivity hundred-fold by re-writing all your code to sigvehtml.
32 | You wont regret it.
33 |
34 |
35 |
36 | Remember: you only need to rewrite to sigvehtml once.
37 | And then you can read again and again and again, each time fully aware of what the finished output is going to look like.
38 | The dark ages of web development is over!
39 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/index.sigvehtml:
--------------------------------------------------------------------------------
1 |
2 | _ _ _ _
3 | (_) | | | | | |
4 | ___ _ __ ___ _____| |__ | |_ _ __ ___ | |
5 | / __| |/ _` \ \ / / _ \ '_ \| __| '_ ` _ \| |
6 | \__ \ | (_| |\ V / __/ | | | |_| | | | | | |
7 | |___/_|\__, | \_/ \___|_| |_|\__|_| |_| |_|_|
8 | __/ |
9 | |___/
10 |
11 |
12 | #=====================================================================#
13 | | ___.-~"~-._ __....__ |
14 | | .' ` \ ~"~ ``-. |
15 | | /` _ ) `\ `\ |
16 | | /` a) / | `\ |
17 | | :` / | \ |
18 | | <`-._|` .-. ( / . `;\\ |
19 | | `-. `--'_.'-.;\___/' . . | \\ |
20 | | _ /:--` | / / .' \\ |
21 | | ("\ /`/ | ' ' / :`; |
22 | | `\'\_/`/ .\ /`~`=-.: / `` |
23 | | `._.' /`\ | `\ /( |
24 | | / /\ | `Y / \ |
25 | | jgs J / Y | | /`\ \ |
26 | | / | | | | | | | |
27 | | "---" /___| /___| /__| |
28 | | '""" '""" '""" |
29 | #=====================================================================#
30 |
31 | #===================================================# #===============#
32 | | Did you know that any piece of code is likely to | | |
33 | | be read over a hundred times more often than it | | * Home |
34 | | is written? Most of a developer's time is spent | | * Download |
35 | | trying to understand code. Sigvehtml is a HTML | | * Legal |
36 | | dialect which focuses on readability and the | | * About Us |
37 | | ability to get a quick overview. | | |
38 | | | | |
39 | | With sigvehtml, there is no longer any need to | | |
40 | | wade trough thickets of nested divs and spans | | |
41 | | and what-have-yous to get to a real understanding | | |
42 | | of what is going on. Throw the boilerplate soup | | |
43 | | out of the window, and increase your productivity | | |
44 | | hundred-fold by re-writing all your code to | | |
45 | | sigvehtml. You wont regret it. | | |
46 | | | | |
47 | | Remember: you only need to rewrite to sigvehtml | | |
48 | | once. And then you can read again and again and | | |
49 | | again, each time fully aware of what the finished | | |
50 | | output is going to look like. The dark ages of | | |
51 | | web development is over! | | |
52 | #===================================================# #===============#
53 |
--------------------------------------------------------------------------------
/sigvehtml.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import re
3 |
4 |
5 | def convert(lines):
6 |
7 | # remove \n
8 | lines = [line[:-1] for line in lines]
9 |
10 | boxes = [[] for i in range(len(lines))]
11 |
12 | for y, line in enumerate(lines):
13 | if '#' in line:
14 | for x, letter in enumerate(line):
15 | if letter == '#':
16 | boxes[y].append(x)
17 |
18 | boxes = filter(lambda x: x[1], enumerate(boxes))
19 |
20 | output = []
21 |
22 | for i in range(0, len(boxes), 2):
23 | start = boxes[i]
24 | end = boxes[i + 1]
25 |
26 | output.append(row())
27 |
28 | for j in range(0, len(start[1]), 2):
29 | topleft = start[0], start[1][j]
30 | topright = start[0], start[1][j + 1]
31 | bottomleft = end[0], end[1][j]
32 | bottomright = end[0], end[1][j + 1]
33 |
34 | width = (topright[1] - topleft[1] + 2) / 6
35 |
36 | output.append(div(width))
37 |
38 | # do we think it is a picture?
39 | picture = True
40 | for line in lines[topleft[0] + 1:bottomleft[0]]:
41 | line = line[topleft[1] + 1:topright[1]]
42 | if 'the' in line or 'Download' in line:
43 | picture = False
44 |
45 | if picture:
46 | image = educated_guess_at_image()
47 | output.append('' % image)
48 | else:
49 | output.append('
\n')
50 | for _line in lines[topleft[0] + 1:bottomleft[0]]:
51 | line = _line[topleft[1] + 1:topright[1]]
52 | if not line.strip():
53 | output.append('
\n
\n')
54 | else:
55 | if '*' in line:
56 | idx = line.find('*')
57 | text = line[idx+2:].strip()
58 | # yes, we cheat and drop the ul tags
59 | output.append('