How to use pretty - 10 common examples

To help you get started, we’ve selected a few pretty examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github L-Chris / vue-design / src / renderer / services / models / Project.js View on Github external
save ({name, path}, data, cb) {
    /* eslint-disable */
    let template, styles, code
    const scripts = `
github Ariel-Rodriguez / react-amp-template / src / index.jsx View on Github external
export const renderToString = (body, options = {}) => {
  setOptions(options)
  const sheet = new ServerStyleSheet()
  const bodyStyless = pretty(renderToStaticMarkup(sheet.collectStyles(body)))
  const styles = sheet.getStyleElement()[0]
  // eslint-disable-next-line no-underscore-dangle
  const css = styles ? styles.props.dangerouslySetInnerHTML.__html : ''
  const head = pretty(renderToStaticMarkup())
    .replace('<style></style>', store.boilerplate)

  return `\n\n${head}\n${bodyStyless}\n`
}
github evgenykochetkov / react-storybook-addon-static-markup / src / index.js View on Github external
render() {
    const { children } = this.props;

    const markup = pretty(ReactDOMServer.renderToStaticMarkup(children));

    const channel = addons.getChannel();
    channel.emit('evgenykochetkov/static-markup/show-markup', markup);

    return children;
  }
}
github cozy / cozy.github.io / en / cozy-banks / src / ducks / transactions / TransactionModal.spec.jsx View on Github external
it('should render correctly', () =&gt; {
    const root = mount(
      
         {}}
          requestClose={() =&gt; {}}
          urls={{}}
          brands={[]}
        /&gt;
      
    )
    expect(pretty(root.html())).toMatchSnapshot()
  })
})
github furioussoul / esview / ui / src / helper / code_helper.js View on Github external
export function getVueCode(soul) {
  let data = {},
    vueHtml = '<template>' + getVueHtml(soul,data) + '</template>',
  vueScript = getVueScript(data)
  return vueHtml+'\r\n'+pretty(vueScript)
}
github Raathigesh / semantic-edit / src / SemanticEditMain.jsx View on Github external
beautify()  {
		let prettyHtml = pretty(this.state.html);
		let prettyJsx = pretty(this.state.jsx);

		this.setState({
			html: prettyHtml,
			jsx: prettyJsx,
			isJsxMode: this.state.isJsxMode,
			editorHeight: this.state.editorHeight
		});
	}
github material-components / material-components-web-catalog / src / hero / WebTab.js View on Github external
initCodeString = () => {
    let codeString = '';
    if (this.htmlRef.current) {
      codeString = pretty(this.htmlRef.current.innerHTML);
      classesToRemove.forEach((str) => codeString = codeString.replace(new RegExp(str, 'g'), ''));
      this.setState({codeString});
    }

    this.setState({codeString});
  };
github sitegeist / Sitegeist.Monocle / Resources / Private / JavaScript / containers / styleguide / main / info-tabs / index.js View on Github external
description,
            renderedHtml,
            renderedCode,
            parsedCode,
            anatomy,
            prototypes
        } = this.props;

        return (
            
                
                    <h2>{title} <small>{prototypeName}</small></h2>
                    {description}
                
                
                    <code>
                </code><code>
                
                    <code>
                </code><code>
                
                    <code>
                </code><code>
                
                    
                
            </code></code></code><code><code><code>
        );
    }
}</code></code></code>
github Raathigesh / semantic-edit / src / SemanticEditMain.jsx View on Github external
beautify()  {
		let prettyHtml = pretty(this.state.html);
		let prettyJsx = pretty(this.state.jsx);

		this.setState({
			html: prettyHtml,
			jsx: prettyJsx,
			isJsxMode: this.state.isJsxMode,
			editorHeight: this.state.editorHeight
		});
	}
github balajmarius / svg2jsx / packages / app / utils / getFileText.ts View on Github external
fileReader.onload = () => {
      resolve(pretty(fileReader.result));
    };
    fileReader.onerror = () => {

pretty

Some tweaks for beautifying HTML with js-beautify according to my preferences.

MIT
Latest version published 8 years ago

Package Health Score

65 / 100
Full package analysis

Popular pretty functions