當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript gulp-markdown.default函數代碼示例

本文整理匯總了TypeScript中gulp-markdown.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: src

task('markdown-docs', () => {
  // Extend the renderer for custom heading anchor rendering
  markdown.marked.Renderer.prototype.heading = (text: string, level: number): string => {
    if (level === 3 || level === 4) {
      const escapedText = text.toLowerCase().replace(/[^\w]+/g, '-');
      return `
        <h${level} id="${escapedText}" class="docs-header-link">
          <div header-link="${escapedText}"></div>
          ${text}
        </h${level}>
      `;
    } else {
      return `<h${level}>${text}</h${level}>`;
    }
  };

  return src(['src/lib/**/*.md', 'src/cdk/**/*.md', 'guides/*.md'])
      .pipe(markdown({
        // Add syntax highlight using highlight.js
        highlight: (code: string, language: string): string => {
          if (language) {
            // highlight.js expects "typescript" written out, while Github supports "ts".
            let lang = language.toLowerCase() === 'ts' ? 'typescript' : language;
            return hljs.highlight(lang, code).value;
          }

          return code;
        }
      }))
      .pipe(transform(transformMarkdownFiles))
      .pipe(dom(createTagNameAliaser('docs-markdown')))
      .pipe(dest('dist/docs/markdown'));
});
開發者ID:GuzmanPI,項目名稱:material2,代碼行數:33,代碼來源:docs.ts

示例2:

gulp.task('docs', () => {
  return gulp.src(['src/lib/**/*.md'])
      .pipe(markdown())
      .pipe(transform((content: string) =>
          content.toString().replace(EXAMPLE_PATTERN, (match: string, name: string) =>
              `<div material-docs-example="${name}"></div>`)))
      .pipe(gulp.dest('dist/docs'));
});
開發者ID:CedricCazin,項目名稱:material2,代碼行數:8,代碼來源:docs.ts

示例3: src

task('markdown-docs-cdk', () => {
  return src(['src/cdk/**/!(README).md'])
      .pipe(rename({prefix: 'cdk-'}))
      .pipe(markdown(markdownOptions))
      .pipe(transform(transformMarkdownFiles))
      .pipe(dom(createTagNameAliaser('docs-markdown')))
      .pipe(dest('dist/docs/markdown'));
});
開發者ID:shlomiassaf,項目名稱:material2,代碼行數:8,代碼來源:docs.ts

示例4:

gulp.task('markdown-docs', () => {
  return gulp.src(['src/lib/**/*.md', 'guides/*.md'])
      .pipe(markdown({
        // Add syntax highlight using highlight.js
        highlight: (code: string, language: string) => {
          if (language) {
            // highlight.js expects "typescript" written out, while Github supports "ts".
            let lang = language.toLowerCase() === 'ts' ? 'typescript' : language;
            return hljs.highlight(lang, code).value;
          }

          return code;
        }
      }))
      .pipe(transform(transformMarkdownFiles))
      .pipe(gulp.dest('dist/docs/markdown'));
});
開發者ID:dharmeshpipariya,項目名稱:material2,代碼行數:17,代碼來源:docs.ts

示例5:

gulp.task('docs', () => {
  return gulp.src(['src/lib/**/*.md', 'guides/*.md'])
      .pipe(markdown({
        // Add syntax highlight using highlight.js
        highlight: (code: string, language: string) => {
          if (language) {
            // highlight.js expects "typescript" written out, while Github supports "ts".
            let lang = language.toLowerCase() === 'ts' ? 'typescript' : language;
            return hljs.highlight(lang, code).value;
          }

          return code;
        }
      }))
      .pipe(transform((content: string) =>
          content.toString().replace(EXAMPLE_PATTERN, (match: string, name: string) =>
              `<div material-docs-example="${name}"></div>`)))
      .pipe(gulp.dest('dist/docs'));
});
開發者ID:BernhardRode,項目名稱:material2,代碼行數:19,代碼來源:docs.ts


注:本文中的gulp-markdown.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。