# end-of-loop
def _head_l(self, line):
+ line = line.rstrip()
+ if re.search(ur"\*{[a-zA-Z0-9_]*}\s*$", line):
+ self._anchor = re.search(ur"\*\{([a-zA-Z0-9_]*)\}\s*$", line).group(1)
+ line = re.sub(ur"\s*\*\{[a-zA-Z0-9_]*\}\s*$", "", line)
+
line = self._default_markup_rule(line)
if self._anchor != "":
- line = re.sub(ur"^●(.*)$", ur'<h4 id="%s">\1</h4>' % self._anchor, line)
+ line = re.sub(ur"^●(.*)$", ur'<div id="%s"><h3>\1</h3></div>' % self._anchor, line)
self._anchor = ""
else:
- line = re.sub(ur"^●(.*)$", ur"<h4>\1</h4>", line)
+ line = re.sub(ur"^●(.*)$", ur"<h3>\1</h3>", line)
print line
def _head_m(self, line):
+ line = line.rstrip()
+ if re.search(ur"\*{[a-zA-Z0-9_]*}\s*$", line):
+ self._anchor = re.search(ur"\*\{([a-zA-Z0-9_]*)\}\s*$", line).group(1)
+ line = re.sub(ur"\s*\*\{[a-zA-Z0-9_]*\}\s*$", "", line)
+
line = self._default_markup_rule(line)
if self._anchor != "":
- line = re.sub(ur"^○(.*)$", ur'<b id="%s">\1</b>' % self._anchor, line)
+ line = re.sub(ur"^○(.*)$", ur'<div id="%s"><h4>\1</h4></div>' % self._anchor, line)
self._anchor = ""
else:
- line = re.sub(ur"^○(.*)$", ur"<b>\1</b>", line)
+ line = re.sub(ur"^○(.*)$", ur"<h4>\1</h4>", line)
print line
def _paragraph(self, line):
# line = line.strip()
if re.search(ur"^☆}}}", line):
break
- print line,
+ print line
def _comment(self, line):
for line in self.input_iter:
</div>
"""
+ arrow = '<div style="margin:1em auto;"><img src="%s"></div>\n' % (down_arrow,)
rex_title = re.compile(ur"^☆flow\s+(.*)$")
if rex_title.search(line):
fig = self._anchored_fig(file, cap)
outputs.append(flow_item % (fig, cap))
- arrow = '<img src="%s">\n' % (down_arrow,)
print flow_header
print flow_title % (title,)
print arrow.join(outputs)
str_title = re.search(ur"^☆(図.*)$", line).group(1)
except AttributeError:
str_title = ""
+ if str_title.find(u"図*") == 0:
+ str_title = str_title.replace(u"図*", "")
print self._fig_start()
line = self.input_iter.next()
except AttributeError:
str_title = ""
fig_name = ""
+ if str_title.find(u"表*") == 0:
+ str_title = str_title.replace(u"表*", "")
+
print self._table_start(str_title)
self._table_buf1 = self._table_start(str_title)
ga_file = codecs.open(ga_data_path, "r", input_codec)
output_file = codecs.open(output_path, "w", output_codec)
-ga_dict = {}
+#ga_data = []
ga_titles = []
for row in ga_file:
#Page Title,Pageviews,Unique Pageviews,Avg. Time on Page,Bounce Rate,% Exit,$ Index
items = row.strip().split( "," )
title = items.pop(0)
- ga_dict[title] = items
- ga_titles.append(title)
+# ga_dict.append(items)
+ ga_titles.append((title,items))
# print title
ga_file.close()
#url,title,editor,PVs,comments,date,tags
items = row.strip().split( "," )
- for ga_title in ga_titles:
+ for (ga_title, ga_item) in ga_titles:
if ga_title.find( items[1] ) != -1:
- ga_info = ga_dict.pop(ga_title)
- ga_info.append( items[5] )
- ga_info.append( items[6] )
- updated_dict[ga_title] = ga_info
+ ga_item.append( items[5] )
+ ga_item.append( items[6] )
break
else:
sys.stderr.write( "! %s - %s\n" % (items[1],items[5]) )
otp_file.close()
-for title in updated_dict:
- print >> output_file, title, ",", ",".join( updated_dict[title] )
+for (title, item) in ga_titles:
+ print >> output_file, title, ",", ",".join(item)
-for title in ga_dict:
- print >> output_file, title, ",", ",".join( ga_dict[title] )
+#for title in updated_dict:
+# print >> output_file, title, ",", ",".join( updated_dict[title] )
+
+#for title in ga_dict:
+# print >> output_file, title, ",", ",".join( ga_dict[title] )
output_file.close()
fig = self._anchored_fig(file, cap)
outputs.append(flow_item % (fig))
- arrow = '<div style="margin-top: 1em;"><img src="%s"></div>\n' % (down_arrow,)
+ arrow = '<div style="margin: 1em auto;"><img src="%s"></div>\n' % (down_arrow,)
print flow_header
print flow_title % (title,)
print arrow.join(outputs)
str_title = re.search(ur"^☆(図.*)$", line).group(1)
except AttributeError:
str_title = ""
+ if str_title.find(u"図*") == 0:
+ str_title = str_title.replace(u"図*", "")
print self._fig_start()
line = self.input_iter.next()
if not os.path.isfile(file_s):
file_s = file
- return """[[Thumb(%s, caption=%s)]]""" % (file, alt)
+ return """[[Thumb(%s, size=large, caption=%s)]]""" % (file, alt)
def _fig_release(self, line):
except AttributeError:
str_title = ""
fig_name = ""
+ if str_title.find(u"表*") == 0:
+ str_title = str_title.replace(u"表*", "")
# print self._table_start(str_title)
self._table_buf1 = self._table_start(str_title) + "\n"