The compile_html method takes two arguments, one file from which it reads the markup, and one to write HTML. Example:

defcompile_html(self,source,dest):iftextileisNone:raiseException('To build this site, you need to install the "textile" package.')try:os.makedirs(os.path.dirname(dest))except:passwithcodecs.open(dest,"w+","utf8")asout_file:withcodecs.open(source,"r","utf8")asin_file:data=in_file.read()output=textile(data,head_offset=1)out_file.write(output)

Make sure to use utf8 everyhere.

The create_post function is used to create a new, empty, post with some metadata in it. Example: