# Path: scribbler/errors.py
# class ScribblerError(Exception):
#     pass


import os
import pdfkit
from .errors import ScribblerError
                break
        else:
            raise ScribblerError("Unrecognized extension for file '{}'".format(basename))
        self.src_path = src_path
        self.html_path = None
        self.pdf_path = None
        self.update()
    
    def _pdf_path(self):
        """
        Returns the path where a PDF file is expected to be, relative to
        the notebook root.
        """
        return os.path.join(self.notebook.PDF_DIR, str(self.slug) + '.pdf')
    
    def _html_path(self):
        """
        Returns the path where an HTML file is expected to be, relative to
        the notebook root.
        """
        if os.path.basename(os.path.dirname(self.src_path)) == self.notebook.NOTE_DIR:
            return os.path.join(self.notebook.HTML_DIR, self.notebook.NOTE_DIR, str(self.slug) + '.html')
        else:
            return os.path.join(self.notebook.HTML_DIR, 'pages', str(self.slug) + '.html')
    
    def update(self):
        """
        Updates information about the content.
        """
        if not os.path.isfile(os.path.join(self.notebook.location, self.src_path)):

# Path: scribbler/errors.py
# class ScribblerError(Exception):
#     pass


# Path: scribbler/content.py
import os
import pdfkit
from .errors import ScribblerError

                break
        else:
            raise ScribblerError("Unrecognized extension for file '{}'".format(basename))
        self.src_path = src_path
        self.html_path = None
        self.pdf_path = None
        self.update()
    
    def _pdf_path(self):
        """
        Returns the path where a PDF file is expected to be, relative to
        the notebook root.
        """
        return os.path.join(self.notebook.PDF_DIR, str(self.slug) + '.pdf')
    
    def _html_path(self):
        """
        Returns the path where an HTML file is expected to be, relative to
        the notebook root.
        """
        if os.path.basename(os.path.dirname(self.src_path)) == self.notebook.NOTE_DIR:
            return os.path.join(self.notebook.HTML_DIR, self.notebook.NOTE_DIR, str(self.slug) + '.html')
        else:
            return os.path.join(self.notebook.HTML_DIR, 'pages', str(self.slug) + '.html')
    
    def update(self):
        """
        Updates information about the content.
        """
        if not os.path.isfile(os.path.join(self.notebook.location, self.src_path)):

            raise ScribblerError("Note with path '{}' does not exist".format(self.src_path))