Exemple #1
0
    def get(self):
        full_name = "about.markdown"
        post = BasicParser.parse(options.about_dir, full_name)
        post["title"] = options.author

        params = get_site_info()
        
        template_file_name = "about.html"
        self.render(template_file_name, post = post, params = params)
Exemple #2
0
 def get(self):
     uri = self.request.uri
     print uri
     post_name = uri.split("/")[2]
     full_name = post_name.split(".")[0] + ".markdown"
     post = BasicParser.parse(options.posts_dir, full_name)
     params = get_site_info()
     template_file_name = "post.html"
     self.render(template_file_name, post = post, params = params)
Exemple #3
0
 def get(self):
     uri = self.request.uri
     print uri
     post_name = uri.split("/")[2]
     full_name = post_name.split(".")[0] + ".markdown"
     post = BasicParser.parse(options.posts_dir, full_name)
     params = get_site_info()
     template_file_name = "post.html"
     self.render(template_file_name, post=post, params=params)
Exemple #4
0
def generateAbout():  
    dest = options.build_dir + os.sep + "about"
    mkdir(dest)
    post = BasicParser.parse(options.about_dir, "about.markdown")
    post["title"] = options.author
    params = getSiteInfo()
    
    html = TemplateParser.parse(options.current_template_dir, "about.html", post=post, params=params)
    about_file = open(dest + os.sep + "index.html", "wb")
    about_file.write(html)
Exemple #5
0
def generate_about():
    dest = options.build_dir + os.sep + "about"
    mkdir(dest)
    post = BasicParser.parse(options.about_dir, "about.markdown")
    post["title"] = options.author
    params = get_site_info()

    html = TemplateParser.parse(options.current_template_dir,
                                "about.html",
                                post=post,
                                params=params)
    about_file = open(dest + os.sep + "index.html", "wb")
    about_file.write(html)
Exemple #6
0
#!/usr/bin/env python

import os
from src.common.markdown_parser import BasicParser

if __name__ == "__main__":
    path = os.path.dirname(os.path.abspath(__file__))
    md = BasicParser.parse(path + os.sep + "resources",
                           "2014-03-1-talk-about-bitcoin-change.markdown")
    print BasicParser.getBriefContent(md["content"])
#!/usr/bin/env python

import os

from src.common.markdown_parser import BasicParser


if __name__ == "__main__":
    path = os.path.dirname(os.path.abspath(__file__))
    md = BasicParser.parse(path + os.sep + "resources", "2014-03-1-talk-about-bitcoin-change.markdown")
    print BasicParser.get_brief_content(md["content"]);
'''
Created on Oct 6, 2014

@author: sunnycomes
'''
import os
from src.common.markdown_parser import BasicParser
from src.common import template_parser

if __name__ == '__main__':
    params = {}
    params["author"] = "options.author"
    params["url"] = "options.url"
    params["title"] = "options.title"
    params["github_fork_link"] = "options.github_fork_link"
    params["disqus_shortname"] = "options.disqus_shortname"
    
    post = BasicParser.parse(os.getcwd() + os.sep + "resources", "2014-03-1-talk-about-bitcoin-change.markdown")
    
    path = os.getcwd() + os.sep + "resources"
    
    file_name = "post.html"
    
    html = template_parser.TemplateParser.parse(path, file_name, post=post, params=params)
    print html
Exemple #9
0
'''
Created on Oct 6, 2014

@author: sunnycomes
'''
import os
from src.common.markdown_parser import BasicParser
from src.common import template_parser

if __name__ == '__main__':
    params = {}
    params["author"] = "options.author"
    params["url"] = "options.url"
    params["title"] = "options.title"
    params["github_link"] = "options.github_link"
    params["disqus_shortname"] = "options.disqus_shortname"

    post = BasicParser.parse(os.getcwd() + os.sep + "resources",
                             "2014-03-1-talk-about-bitcoin-change.markdown")

    path = os.getcwd() + os.sep + "resources"

    file_name = "post.html"

    html = template_parser.TemplateParser.parse(path,
                                                file_name,
                                                post=post,
                                                params=params)
    print html