#append this to module path so we can load from the parent directory
import os
import sys
from scaffold import web
from scaffold.loaders import load
from scaffold.readers.markdown_reader import markdown_reader


class page:
    name = __name__
    title = 'Review of "Effective Python"'
    tags = 'review', 'books', 'python'
    intro = 'Short review of "Effective Python"'
    date = '2015-08-19'
    image = web.template.path_image + 'thumbs/effectivepython.jpg'

    def create_content(self):
        web.link.create(
            'Effective Python', 
            web.images.create(
                self.image,
                title='Effective Python'
            ).render(),
            'http://www.amazon.co.uk/Effective-Python-Specific-Software-Development/dp/0134034287')
        
        web.page.section(
            web.div.create(
                web.link.render()
            ).set_classes('sources').render()
        )

        web.page.section(
            markdown_reader(
                os.path.abspath('./content/reviews/effectivepython.md')
            ).render()
        )

