white label
This commit is contained in:
parent
e425464aab
commit
a850aeed63
3 changed files with 13 additions and 13 deletions
|
@ -1,5 +1,6 @@
|
|||
import sys
|
||||
import html
|
||||
from string import Template
|
||||
|
||||
src = ''
|
||||
asm = ''
|
||||
|
@ -16,9 +17,8 @@ for line in sys.stdin:
|
|||
style += 1
|
||||
style %= 5
|
||||
flip = False
|
||||
elif line.startswith("# string table: "):
|
||||
elif line.startswith(".L") or line.startswith(".data") or line.startswith(".text"):
|
||||
asm += line
|
||||
break
|
||||
else:
|
||||
asm += decorate(line)
|
||||
flip = True
|
||||
|
@ -29,13 +29,13 @@ for line in sys.stdin:
|
|||
title = 'RVBTCC Code Gen Demo'
|
||||
|
||||
|
||||
template = '''
|
||||
template = Template('''
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><%title%></title>
|
||||
<title>${title}</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
|
@ -90,25 +90,25 @@ template = '''
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1><%title%></h1>
|
||||
<h1>${title}</h1>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="column">
|
||||
<h2>Source Code</h2>
|
||||
<pre>
|
||||
<code><%src%></code>
|
||||
<code>${src}</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="column">
|
||||
<h2>Assembly</h2>
|
||||
<pre>
|
||||
<code><%asm%></code>
|
||||
<code>${asm}</code>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
'''
|
||||
''')
|
||||
|
||||
print(template.replace("<%title%>", title).replace("<%src%>", src).replace("<%asm%>", asm))
|
||||
print(template.substitute(title=title, src=src, asm=asm))
|
Loading…
Add table
Add a link
Reference in a new issue