<commit_before>/* eslint no-console: 0 */

const fs = require('fs');
const path = require('path');
const execSync = require('child_process').execSync;

const marked = require('marked');
const mdlRenderer = require('marked-renderer-mdl');
const Prism = require('prismjs');
require('prismjs/components/prism-jsx');

const babel = require('babel-core');

const DOC_PAGES_DIR = path.join('docs', 'pages');
const DOC_PAGES_DIR_OUTPUT = path.join('docs', 'pages', 'html');

function getCodePenForm(jsx, entireClass) {
    const prefix = 'for(const component in ReactMDL) { if(ReactMDL.hasOwnProperty(component)) { window[component] = ReactMDL[component]; } } dialogPolyfill.registerDialog(document.querySelector("dialog"));';
    const suffix = "ReactDOM.render(<Demo />, document.getElementById('demo'))";
    const code = (entireClass) ? jsx : `
const Demo = (props) => {
    return ${jsx};
}`;

    const JS = `${prefix}
${code}
${suffix}`;

    const data = {
        title: 'React-MDL example',
        editors: '001',<commit_msg>fixes codepen demos (fixes #240)<commit_after>/* eslint no-console: 0 */

const fs = require('fs');
const path = require('path');
const execSync = require('child_process').execSync;

const marked = require('marked');
const mdlRenderer = require('marked-renderer-mdl');
const Prism = require('prismjs');
require('prismjs/components/prism-jsx');

const babel = require('babel-core');

const DOC_PAGES_DIR = path.join('docs', 'pages');
const DOC_PAGES_DIR_OUTPUT = path.join('docs', 'pages', 'html');

function getCodePenForm(jsx, entireClass) {
    const prefix = `for(const component in ReactMDL) { if(ReactMDL.hasOwnProperty(component)) { window[component] = ReactMDL[component]; } }
const dialogs = document.querySelector("dialog"); dialogs && dialogPolyfill.registerDialog(dialogs);`;
    const suffix = "ReactDOM.render(<Demo />, document.getElementById('demo'))";
    const code = (entireClass) ? jsx : `
const Demo = (props) => {
    return ${jsx};
}`;

    const JS = `${prefix}
${code}
${suffix}`;

    const data = {
        title: 'React-MDL example',
        editors: '001',
{'fraction_non_alphanumeric': 0.17274017983909135, 'fraction_numerical': 0.005205868433506862, 'mean_word_length': 5.0922190201729105, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2078161', 'n_tokens_mistral': 696, 'n_tokens_neox': 679, 'n_words': 153}