<commit_before>'use strict'

React = require('react')
ReactCSS = require('reactcss')
Remarkable = require('remarkable')
hljs = require('highlight.js')
md = new Remarkable
  highlight: (str) ->
    try
      return hljs.highlightAuto(str).value
    catch err
      console.log err
_ = require('lodash')

# require('../../../node_modules/highlight.js/styles/kimbie.dark.css')




{ Raised, Tabs, Tile } = require('react-material-design')



module.exports = class Code extends ReactCSS.Component

  @propTypes =
    files: React.PropTypes.array

  classes: ->
    'default':
      shortCodeBlock:
        display: 'inline-block'

      shortCode:
        padding: '14px 16px'

      head:
        borderRadius: '2px 2px 0 0'
        background: '#fafafa'

      files:
        display: 'inline-block'

      Files:
        align: 'none'
        color: '#666'

      center:
        fontFamily: 'Monaco'
        fontSize: '14px'
        lineHeight: '19px'
        color: 'rgba(0,0,0,.77)'

      numbers:
        fontSize: '14px'
        lineHeight: '19px'
        display: 'inline-block'
        textAlign: 'right'
        color: 'rgba(0,0,0,.20)'

    'condensed':
      Tile:
        condensed: true

      center:
        paddingBottom: '16px'
        fontSize: '13px'
        lineHeight: '15px'

      numbers:
        fontSize: '13px'
        lineHeight: '15px'

  render: ->
    rendered = md.render("```\n#{ @props.files[0].js }```").trim()
    lines = rendered.split('\n').length

    if lines is 2
      <div is="shortCodeBlock">
        <Raised>
          <div is="shortCode" className="rendered" dangerouslySetInnerHTML={ __html: _.unescape(rendered) } />
        </Raised><commit_msg>homepage condensed Tile fix<commit_after>'use strict'

React = require('react')
ReactCSS = require('reactcss')
Remarkable = require('remarkable')
hljs = require('highlight.js')
md = new Remarkable
  highlight: (str) ->
    try
      return hljs.highlightAuto(str).value
    catch err
      console.log err
_ = require('lodash')

# require('../../../node_modules/highlight.js/styles/kimbie.dark.css')




{ Raised, Tabs, Tile } = require('react-material-design')



module.exports = class Code extends ReactCSS.Component

  @propTypes =
    files: React.PropTypes.array

  classes: ->
    'default':
      shortCodeBlock:
        display: 'inline-block'

      shortCode:
        padding: '14px 16px'

      head:
        borderRadius: '2px 2px 0 0'
        background: '#fafafa'

      files:
        display: 'inline-block'

      Files:
        align: 'none'
        color: '#666'

      center:
        fontFamily: 'Monaco'
        fontSize: '14px'
        lineHeight: '19px'
        color: 'rgba(0,0,0,.77)'

      numbers:
        fontSize: '14px'
        lineHeight: '19px'
        display: 'inline-block'
        textAlign: 'right'
        color: 'rgba(0,0,0,.20)'

    'condensed':
      Tile:
        condensed: true

      center:
        paddingTop: '16px'
        paddingBottom: '16px'
        fontSize: '13px'
        lineHeight: '15px'

      numbers:
        paddingTop: '16px'
        fontSize: '13px'
        lineHeight: '15px'

  render: ->
    rendered = md.render("```\n#{ @props.files[0].js }```").trim()
    lines = rendered.split('\n').length

    if lines is 2
      <div is="shortCodeBlock">
        <Raised>
          <div is="shortCode" className="rendered" dangerouslySetInnerHTML={ __html: _.unescape(rendered) } />
        </Raised>
{'fraction_non_alphanumeric': 0.1417824074074074, 'fraction_numerical': 0.02488425925925926, 'mean_word_length': 2.230841121495327, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '3691288', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1108, 'n_words': 242}