本文整理汇总了TypeScript中gulp-transform.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-transform.default函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论