from ...plugin import Plugin


# TODO: use base url from the SitePlugin


class CommentsPlugin(Plugin):
    identity = "comments"
    priority = 45
    validity = {
        "type": "object",
        "properties": {
            "enable": {"type": "boolean"},
        },
    }

    # Context

    @property
    def code(self):
        return self.config.get("code")

    @property
    def link(self):
        return self.config.get("link")

    # Process

    def process_markup(self, markup):
        if self.code and self.link:
            markup.add_style("style.css")
            markup.add_script("https://livemark.disqus.com/count.js")
            markup.add_script("script.js")
            markup.add_markup("markup.html", target="#livemark-main")

f7dde8c1d32b717551633e61b9a1f8208f5614d4
<mask token>

<mask token>


class CommentsPlugin(Plugin):
    <mask token>
    <mask token>
    <mask token>

    @property
    def code(self):
        return self.config.get('code')
    <mask token>

    def process_markup(self, markup):
        if self.code and self.link:
            markup.add_style('style.css')
            markup.add_script('https://livemark.disqus.com/count.js')
            markup.add_script('script.js')
            markup.add_markup('markup.html', target='#livemark-main')

<mask token>


class CommentsPlugin(Plugin):
    identity = 'comments'
    priority = 45
    validity = {'type': 'object', 'properties': {'enable': {'type': 'boolean'}}
        }

    @property
    def code(self):
        return self.config.get('code')

    @property
    def link(self):
        return self.config.get('link')

    def process_markup(self, markup):
        if self.code and self.link:
            markup.add_style('style.css')
            markup.add_script('https://livemark.disqus.com/count.js')
            markup.add_script('script.js')
            markup.add_markup('markup.html', target='#livemark-main')

from ...plugin import Plugin


class CommentsPlugin(Plugin):
    identity = 'comments'
    priority = 45
    validity = {'type': 'object', 'properties': {'enable': {'type': 'boolean'}}
        }

    @property
    def code(self):
        return self.config.get('code')

    @property
    def link(self):
        return self.config.get('link')

    def process_markup(self, markup):
        if self.code and self.link:
            markup.add_style('style.css')
            markup.add_script('https://livemark.disqus.com/count.js')
            markup.add_script('script.js')
            markup.add_markup('markup.html', target='#livemark-main')

from ...plugin import Plugin


# TODO: use base url from the SitePlugin


class CommentsPlugin(Plugin):
    identity = "comments"
    priority = 45
    validity = {
        "type": "object",
        "properties": {
            "enable": {"type": "boolean"},
        },
    }

    # Context

    @property
    def code(self):
        return self.config.get("code")

    @property
    def link(self):
        return self.config.get("link")

    # Process

    def process_markup(self, markup):
        if self.code and self.link:
            markup.add_style("style.css")
            markup.add_script("https://livemark.disqus.com/count.js")
            markup.add_script("script.js")
            markup.add_markup("markup.html", target="#livemark-main")
