<commit_before>//Main template of all articles on page
//Should we serve a random poem when user clicks this link?

var React = require('react');
var ArticleSubsection = require('./ArticleSubsection.react');
var ArticleImage = require('./ArticleImage.react');
var WikiPoetryStore = require('../../stores/WikiPoetryStore');
var API = require('../../api/wikiApi');

var Article = React.createClass({

  getInitialState: function () {
    return {
      term: this.props.routeParams.term,
      text: {
        mainTitle: '',
        summaryPoem: '',
        subheading1: '',
        subheading2: '',
        subPoem1: '',
        subPoem2: ''
      },
      type: WikiPoetryStore.getType()
    }
  },

  componentDidMount: function () {
    API.getArticle({type: this.state.type, term: this.state.term}, function (data) {
      this.setState({text: {
        summaryPoem: data
      }});
    }.bind(this));  
  },

  render: function () {
    var newInfo = this.props.location.state;
    
    return (
      <div className="ten columns" id="article">
        <div className="article-container">
          <h3 className="article-title">{newInfo.term}</h3>
          <ArticleImage picture={newInfo.picture} />
          <p>{newInfo.poem}</p>
          <ArticleSubsection
            subheading={this.state.text.subheading1}
            subcontent={this.state.text.subPoem1} />
          <ArticleSubsection
            subheading={this.state.text.subheading2}
            subcontent={this.state.text.subPoem2} />
          <ArticleSubsection
            subheading={this.state.text.subheading3}
            subcontent={this.state.text.subPoem3} />
        </div>
      </div>
    );
  }
});

module.exports = Article;<commit_msg>feat/article added subheadings<commit_after>//Main template of all articles on page
//Should we serve a random poem when user clicks this link?

var React = require('react');
var ArticleSubsection = require('./ArticleSubsection.react');
var ArticleImage = require('./ArticleImage.react');
var WikiPoetryStore = require('../../stores/WikiPoetryStore');
var API = require('../../api/wikiApi');

var Article = React.createClass({

  getInitialState: function () {
    return {
      term: this.props.routeParams.term,
      text: {
        mainTitle: '',
        summaryPoem: '',
        subheading1: '',
        subheading2: '',
        subPoem1: '',
        subPoem2: ''
      },
      type: WikiPoetryStore.getType()
    }
  },

  componentDidMount: function () {
    API.getArticle({type: this.state.type, term: this.state.term}, function (data) {
      this.setState({text: {
        summaryPoem: data
      }});
    }.bind(this));  
  },

  render: function () {
    var newInfo = this.props.location.state;
    console.log(newInfo)
    
    return (
      <div className="ten columns" id="article">
        <div className="article-container">
          <h3 className="article-title">{newInfo.term}</h3>
          <ArticleImage picture={newInfo.picture} />
          <p>{newInfo.poem}</p>
          <ArticleSubsection
            subheading={newInfo.headings[0]}
            subcontent={this.state.text.subPoem1} />
          <ArticleSubsection
            subheading={newInfo.headings[1]}
            subcontent={this.state.text.subPoem2} />
          <ArticleSubsection
            subheading={newInfo.headings[2]}
            subcontent={this.state.text.subPoem3} />
        </div>
      </div>
    );
  }
});

module.exports = Article;
{'fraction_non_alphanumeric': 0.1477207155222158, 'fraction_numerical': 0.006924408540103866, 'mean_word_length': 2.425889328063241, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1206998', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1020, 'n_words': 186}