How to use titleize - 8 common examples

To help you get started, we’ve selected a few titleize 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 garden-io / garden / garden-service / src / docs / config.ts View on Github external
const providerTemplatePath = resolve(TEMPLATES_DIR, "provider.hbs")
  const { markdownReference, yaml } = renderConfigReference(schema)

  const moduleOutputsReference =
    moduleOutputsSchema &&
    renderTemplateStringReference({
      schema: joi.object().keys({
        outputs: moduleOutputsSchema.required(),
      }),
      prefix: "providers",
      placeholder: "",
      exampleName: "my-provider",
    })

  const template = handlebars.compile(readFileSync(providerTemplatePath).toString())
  const frontmatterTitle = titleize(humanize(name))
  return template({ name, frontmatterTitle, markdownReference, yaml, moduleOutputsReference })
}
github doczjs / docz / core / docz-core / src / config / argv.ts View on Github external
const getInitialTitle = (pkg: any): string => {
  const name = get('name', pkg) || 'MyDoc'
  return titleize(humanize(name.replace(/^@.*\//, '')))
}
github panjf2000 / gnet / src / theme / HighlightItems / index.js View on Github external
function Header({groupBy, group}) {
  const slugger = new GithubSlugger();

  switch(groupBy) {
    case 'release':
      return (
        <li>
          <h3>{titleize(group)}</h3>
        </li>
      );
      break;

    case 'type':
      let icon = null;
      let label = pluralize(titleize(group));
      let textColor = null;

      switch(group) {
        case 'breaking change':
          icon = 'alert-triangle';
          textColor = 'danger';
          break;

        case 'enhancement':
github doczjs / docz / packages / docz-core / src / commands / args.ts View on Github external
const getInitialTitle = (pkg: any): string => {
  const name = get(pkg, 'name') || 'MyDoc'
  return titleize(humanize(removeScope(name)))
}
github cssstats / cssstats / src / components / SpacingResets.js View on Github external
children={spacingProperties.map(prop =&gt; {
          const props = properties[prop] || []
          const resets = props.filter(v =&gt; v === '0')

          return (
            
          )
        })}
      /&gt;
github garden-io / garden / garden-service / src / docs / config.ts View on Github external
}),
    prefix: "runtime.services",
    placeholder: "",
    exampleName: "my-service",
  })

  const taskOutputsReference = renderTemplateStringReference({
    schema: TaskRuntimeContext.getSchema().keys({
      outputs: getOutputsSchema(desc, "taskOutputsSchema").required(),
    }),
    prefix: "runtime.tasks",
    placeholder: "",
    exampleName: "my-tasks",
  })

  const frontmatterTitle = titleize(humanize(name))
  const template = handlebars.compile(readFileSync(moduleTemplatePath).toString())
  return template({
    frontmatterTitle,
    name,
    docs,
    markdownReference,
    yaml,
    hasOutputs: moduleOutputsReference || serviceOutputsReference || taskOutputsReference,
    moduleOutputsReference,
    serviceOutputsReference,
    taskOutputsReference,
  })
}
github panjf2000 / gnet / src / theme / HighlightItems / index.js View on Github external
function Header({groupBy, group}) {
  const slugger = new GithubSlugger();

  switch(groupBy) {
    case 'release':
      return (
        <li>
          <h3>{titleize(group)}</h3>
        </li>
      );
      break;

    case 'type':
      let icon = null;
      let label = pluralize(titleize(group));
      let textColor = null;

      switch(group) {
        case 'breaking change':
          icon = 'alert-triangle';
          textColor = 'danger';
          break;

        case 'enhancement':
          icon = 'arrow-up-circle';
          textColor = 'pink';
          break;

        case 'new feature':
          icon = 'gift';
          textColor = 'primary';
github rhiokim / flybook / libs / toc.js View on Github external
/*
       * Parent Directory:
       *   Child Directory: File Path
       *
       * Basic:
       *   Getting Started: 'basic/getting-started.md'
       *
       */
      if (toc.hasOwnProperty(dir)) {
        toc[dir] = Object.assign(toc[dir], {
          [titleize(name)]: file
        })
      } else {
        toc = Object.assign(toc, {
          [titleize(dir)]: {
            [titleize(name)]: file
          }
        })
      }
    })

titleize

Capitalize every word in a string: `unicorn cake` → `Unicorn Cake`

MIT
Latest version published 8 months ago

Package Health Score

76 / 100
Full package analysis

Popular titleize functions