{"size": 1332, "ext": "js", "max_stars_repo_path": "article/nodes/heading/heading.js", "max_stars_repo_name": "escire/sps-lens", "max_stars_repo_stars_event_min_datetime": "2015-01-13T04:36:25.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-25T21:23:46.000Z", "max_issues_repo_path": "article/nodes/heading/heading.js", "max_issues_repo_name": "escire/sps-lens", "max_issues_repo_issues_event_min_datetime": "2015-01-02T13:28:29.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-21T00:55:31.000Z", "max_forks_repo_path": "article/nodes/heading/heading.js", "max_forks_repo_name": "escire/sps-lens", "max_forks_repo_forks_event_min_datetime": "2015-01-08T08:27:08.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-05T07:23:21.000Z"}
{"max_stars_count": 249, "max_issues_count": 105, "max_forks_count": 57, "avg_line_length": 17.2987012987, "max_line_length": 55, "alphanum_fraction": 0.6013513514}
"use strict";

var Document = require('../../../substance/document');
var DocumentNode = Document.Node;
var Text = require("../text/text_node");

var Heading = function(node, document) {
  Text.call(this, node, document);
};

// Type definition
// -----------------
//

Heading.type = {
  "id": "heading",
  "parent": "content",
  "properties": {
    "source_id": "string",
    "content": "string",
    "label": "string",
    "level": "number"
  }
};

// Example Heading
// -----------------
//

Heading.example = {
  "type": "heading",
  "id": "heading_1",
  "content": "Introduction",
  "level": 1
};

// This is used for the auto-generated docs
// -----------------
//


Heading.description = {
  "name": "Heading",
  "remarks": [
    "Denotes a section or sub section in your article."
  ],
  "properties": {
    "content": "Heading title",
    "label": "Heading label",
    "level": "Heading level. Ranges from 1..4"
  }
};

Heading.Prototype = function() {

  this.splitInto = 'paragraph';

  // TOC API

  this.includeInToc = function() {
    return true;
  };

  this.getLevel = function() {
    return this.level;
  }

};

Heading.Prototype.prototype = Text.prototype;
Heading.prototype = new Heading.Prototype();
Heading.prototype.constructor = Heading;

DocumentNode.defineProperties(Heading);

module.exports = Heading;
