function TOCArticle(def, parent) {
    // Title
    this.title = def.title;

    // Parent TOCPart or TOCArticle
    this.parent = parent;

    // As string indicating the overall position
    // ex: '1.0.0'
    this.level;
    this._next;
    this._prev;

    // When README has been automatically added
    this.isAutoIntro = def.isAutoIntro;
    this.isIntroduction = def.isIntroduction;

    this.validate();

    // Path can be a relative path or an url, or nothing
    this.ref = def.path;
    if (this.ref && !this.isExternal()) {
        var parts = this.ref.split('#');
        this.path = (parts.length > 1? parts.slice(0, -1).join('#') : this.ref);
        this.anchor = (parts.length > 1? '#' + _.last(parts) : null);

        // Normalize path to remove ('./', etc)
        this.path = location.normalize(this.path);
    }

    this.articles = _.map(def.articles || [], function(article) {
        if (article instanceof TOCArticle) return article;
        return new TOCArticle(article, this);
    }, this);
}
/*
    An article represent an entry in the Summary.
    It's defined by a title, a reference, and children articles,
    the reference (ref) can be a filename + anchor or an external file (optional)
*/
An article represent an entry in the Summary.
It's defined by a title, a reference, and children articles,
the reference (ref) can be a filename + anchor or an external file (optional)
An article represent an entry in the Summary . It ' s defined by a title a reference and children articles the reference ( ref ) can be a filename + anchor or an external file ( optional )
function TOCArticle(def, parent) {
    this.title = def.title;
    this.parent = parent;
    this.level;
    this._next;
    this._prev;
    this.isAutoIntro = def.isAutoIntro;
    this.isIntroduction = def.isIntroduction;
    this.validate();
    this.ref = def.path;
    if (this.ref && !this.isExternal()) {
        var parts = this.ref.split('#');
        this.path = (parts.length > 1? parts.slice(0, -1).join('#') : this.ref);
        this.anchor = (parts.length > 1? '#' + _.last(parts) : null);
        this.path = location.normalize(this.path);
    }
    this.articles = _.map(def.articles || [], function(article) {
        if (article instanceof TOCArticle) return article;
        return new TOCArticle(article, this);
    }, this);
}
function TOCArticle ( def , parent ) { this . title = def . title ; this . parent = parent ; this . level ; this . _next ; this . _prev ; this . isAutoIntro = def . isAutoIntro ; this . isIntroduction = def . isIntroduction ; this . validate ( ) ; this . ref = def . path ; if ( this . ref && ! this . isExternal ( ) ) { var parts = this . ref . split ( '#' ) ; this . path = ( parts . length > 1 ? parts . slice ( 0 , - 1 ) . join ( '#' ) : this . ref ) ; this . anchor = ( parts . length > 1 ? '#' + _ . last ( parts ) : null ) ; this . path = location . normalize ( this . path ) ; } this . articles = _ . map ( def . articles || [ ] , function ( article ) { if ( article instanceof TOCArticle ) return article ; return new TOCArticle ( article , this ) ; } , this ) ; }
An article represent an entry in the Summary.
An article represent an entry in the Summary .
// Title // Parent TOCPart or TOCArticle // As string indicating the overall position // ex: '1.0.0' // When README has been automatically added // Path can be a relative path or an url, or nothing // Normalize path to remove ('./', etc)