Commits

Maciej Fijalkowski  committed 6da6c08

work in progress

  • Participants
  • Parent commits 0f907b8

Comments (0)

Files changed (5)

File codeviewer/dump.py

      parse_code_data
 from pypy.tool.logparser import extract_category
 
+
 def load_code(fname):
     res = gather_all_code_objs(fname)
     return res

File codeviewer/file.jinja

+<html>
+<head>
+   <script type="text/javascript" src="jquery.min.js"></script>
+   <script type="text/javascript" src="jquery.scrollTo-1.4.2-min.js"></script>
+   <script type="text/javascript" src="jquery.viewport.mini.js"></script>
+   <script type="text/javascript" src="x.js"></script>
+   <link rel="stylesheet" href="pygments.css">
+   <link rel="stylesheet" href="x.css">
+</head>
+<body>
+  <div class="main-source">
+  {{ source }}
+  </div>
+  <div class="rightpan">
+    <div id="container">
+    </div>
+  </div>
+</body>
+</html>

File codeviewer/x.css

+.body {
+	background-color: #fff;
+}
+
 .active {
     background-color: #AAEEEE;
 }
 
-.main {
+.main-source {
     padding-right: 530px;
 }
 
+#main-code-browser {
+    float: left;
+}
+
 .rightpan {
     position: fixed;
     top: 20px;
     width: 500px;
     height: 500px;
 }
+
+.box {
+	border: 1px solid #cacaca;
+	color: #101010;
+	font: 20px/1.4em Monaco, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace;
+	overflow: auto;
+	padding: 7px 7px 8px 7px;
+	margin: 10px 30px 0 30px;
+	-moz-border-radius: 5px;
+	-webkit-border-radius: 5px;
+	border-radius: 5px;
+	-webkit-box-shadow: 0px 0px 7px #cacaca;
+}
+
+.box-cls {
+    color: red;
+}
+
+.box-code {
+    color: green;
+}
+
+.box-func {
+    color: blue;
+}

File codeviewer/x.jinja

-<html>
-<head>
-   <script type="text/javascript" src="jquery.min.js"></script>
-   <script type="text/javascript" src="jquery.scrollTo-1.4.2-min.js"></script>
-   <script type="text/javascript" src="jquery.viewport.mini.js"></script>
-   <script type="text/javascript" src="x.js"></script>
-   <link rel="stylesheet" href="pygments.css">
-   <link rel="stylesheet" href="x.css">
-</head>
-<body>
-  <div class="main">
-  {{ source }}
-  </div>
-  <div class="rightpan">
-    <div id="container">
-      </div>
-  </div>
-</body>
-</html>

File codeviewer/xdemo.py

     f.write(HtmlFormatter().get_style_defs('.highlight'))
 with open('x.html', 'w') as f:
     source = highlight(code, PythonLexer(), CustomHtmlFormatter())
-    f.write(Template(open("x.jinja").read()).render(source=source))
+    f.write(Template(open("file.jinja").read()).render(source=source))