Convert code to forum post. I have seen @castles_made_sand_post posting with highlighted text, and figured now that we have the framework to print HTML color coded, why not forum posts as well.
Here is an example. I still have work to do, but stay tuned.
[pre=#000000] 396 def convert_view_to_post(self, the_post):
397 for line in self.view.split_by_newlines(sublime.Region(self.end, self.size)):
398 self.size = line.end()
399 line = self.convert_line_to_post()
400 the_post.write(self.print_line(line, self.curr_row))
401 self.curr_row += 1
402
403 def format_text(self, line, text, the_colour, the_style, highlight=False):
404 code = (FORUM_CODE % {“color”: the_colour, “content”: text}).replace(’\n’, ‘’)
405 line.append(code)
406
407 def convert_line_to_post(self):
408 line = ]
409 hl_found = False
410
411 # Continue highlight form last line
412 if self.hl_continue != None:
413 self.curr_hl = self.hl_continue
414 self.hl_continue = None[/pre]