function Page(book, filename) {
    if (!(this instanceof Page)) return new Page(book, filename);
    var extension;
    _.bindAll(this);

    this.book = book;
    this.log = this.book.log;

    // Map of attributes from YAML frontmatter
    // Description is also extracted by default from content
    this.attributes = {};

    // Current content
    this.content = '';

    // Relative path to the page
    this.path = location.normalize(filename);

    // Absolute path to the page
    this.rawPath = this.book.resolve(filename);

    // Last modification date
    this.mtime = 0;

    // Can we parse it?
    extension = path.extname(this.path);
    this.parser = parsers.getByExt(extension);
    if (!this.parser) throw error.ParsingError(new Error('Can\'t parse file "'+this.path+'"'));

    this.type = this.parser.name;
}
/*
A page represent a parsable file in the book (Markdown, Asciidoc, etc)
*/
A page represent a parsable file in the book (Markdown, Asciidoc, etc)
A page represent a parsable file in the book ( Markdown Asciidoc etc )
function Page(book, filename) {
    if (!(this instanceof Page)) return new Page(book, filename);
    var extension;
    _.bindAll(this);
    this.book = book;
    this.log = this.book.log;
    this.attributes = {};
    this.content = '';
    this.path = location.normalize(filename);
    this.rawPath = this.book.resolve(filename);
    this.mtime = 0;
    extension = path.extname(this.path);
    this.parser = parsers.getByExt(extension);
    if (!this.parser) throw error.ParsingError(new Error('Can\'t parse file "'+this.path+'"'));
    this.type = this.parser.name;
}
function Page ( book , filename ) { if ( ! ( this instanceof Page ) ) return new Page ( book , filename ) ; var extension ; _ . bindAll ( this ) ; this . book = book ; this . log = this . book . log ; this . attributes = { } ; this . content = '' ; this . path = location . normalize ( filename ) ; this . rawPath = this . book . resolve ( filename ) ; this . mtime = 0 ; extension = path . extname ( this . path ) ; this . parser = parsers . getByExt ( extension ) ; if ( ! this . parser ) throw error . ParsingError ( new Error ( 'Can\'t parse file "' + this . path + '"' ) ) ; this . type = this . parser . name ; }
A page represent a parsable file in the book (Markdown, Asciidoc, etc)
A page represent a parsable file in the book ( Markdown Asciidoc etc )
// Map of attributes from YAML frontmatter // Description is also extracted by default from content // Current content // Relative path to the page // Absolute path to the page // Last modification date // Can we parse it?