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


TypeScript marked.default函數代碼示例

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


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

示例1: marked

    wikiContent.forEach(page => {
        //console.log("Page names: ", page.pageName);
        let wiki_title_template =   document.createElement("div");
        wiki_title_template.className = "panel panel-default";

        let panel_heading = document.createElement("div");
        panel_heading.className = "panel-heading";
        panel_heading.setAttribute("data-toggle","collapse");
        panel_heading.setAttribute("href","#" + "wiki-" + wiki_page_counter);
        panel_heading.innerHTML = page.pageName;

        let panel_body = document.createElement("div");
        panel_body.className = "panel-body collapse";
        panel_body.id = "wiki-" + wiki_page_counter;
        panel_body.innerHTML = marked(page.pageContent);

        wiki_title_template.appendChild(panel_heading);
        wiki_title_template.appendChild(panel_body);
        wiki_content.appendChild(wiki_title_template);

        wiki_page_counter++;
        /*let wiki_content_template =   document.createElement("div");
        wiki_content_template.className = "panel panel-default";
        let content_body = document.createElement("div");
        content_body.className = "content-body";
        content_body.innerHTML = marked(page.pageContent);
        
        wiki_content_template.appendChild(content_body);
        wiki_titles.appendChild(wiki_content_template);*/
    });
開發者ID:cchampernowne,項目名稱:project-seed,代碼行數:30,代碼來源:wiki.ts

示例2: rewrite

  rewrite() {
    let value = this.expression(this.scope) || '' + '';
    if (value === this.lastValue) return;

    this.buffer.innerHTML = marked(value);

    // Fix code highlighting classes.
    let codeBlocks = this.buffer.querySelectorAll('pre code');
    for (let i = 0, ii = codeBlocks.length; i < ii; ++i) {
      let node = codeBlocks[i];
      if (node instanceof Element) node.classList.add('hljs');
    }

    // Remove existing content.
    while (this.element.hasChildNodes()) {
      this.element.removeChild(this.element.firstChild);
    }

    // Add new content.
    while (this.buffer.hasChildNodes()) {
      this.element.appendChild(this.buffer.removeChild(this.buffer.firstChild));
    }

    this.lastValue = value;
  }
開發者ID:Mitranim,項目名稱:atril,代碼行數:25,代碼來源:markdown-live.ts

示例3: constructor

 constructor(
   public nav: NavController,
   public navParams: NavParams) {
     this.nav = nav;
     this.provider = navParams.get('item');
     this.synopsis = parse(this.provider.categorySynopsis);
 }
開發者ID:StreetSupport,項目名稱:streetsupport-app,代碼行數:7,代碼來源:help-category-detail.ts

示例4: convertJson

function convertJson(input: string, outputFile: string, keysFile?: string, yamlFile?: string): Promise<void> {
	const render = new Renderer();

	marked.setOptions({
		renderer: render
	});

	marked(input);

	const promises: Array<Promise<void>> = [ writeFilePromise(outputFile, render.getOutput()) ];

	if (keysFile) {
		let treeKeys: any = {};

		addChildKeys(render.getFullObject().children, treeKeys);

		let jsonStr = JSON.stringify(treeKeys, null, 4);

		promises.push(writeFilePromise(keysFile, jsonStr));
	}

	if (yamlFile) {
		promises.push(writeFilePromise(yamlFile, render.getYamlOutput()));
	}

	return Promise.all(promises).then(() => undefined);
}
開發者ID:tristau,項目名稱:dnd-5e-srd,代碼行數:27,代碼來源:index.ts

示例5: getHtml

export function getHtml(parsedReq: ParsedRequest) {
    const { text, theme, md, fontSize, images, widths, heights } = parsedReq;
    return `<!DOCTYPE html>
<html>
    <meta charset="utf-8">
    <title>Generated Image</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        ${getCss(theme, fontSize)}
    </style>
    <body>
        <div>
            <div class="spacer">
            <div class="logo-wrapper">
                ${images.map((img, i) =>
                    getPlusSign(i) + getImage(img, widths[i], heights[i])
                ).join('')}
            </div>
            <div class="spacer">
            <div class="heading">${emojify(
                md ? marked(text) : sanitizeHtml(text)
            )}
            </div>
        </div>
    </body>
</html>`;
}
開發者ID:kjhx,項目名稱:og-image,代碼行數:27,代碼來源:template.ts

示例6: function

 md: function(text: string) {
   if (text && text.length) {
     var html = marked(text, {
       renderer: markedRenderer
     });
     return new handlebars.SafeString(html);
   }
   return '';
 },
開發者ID:bayeslife,項目名稱:jsonschema2class,代碼行數:9,代碼來源:helpers.ts

示例7: makedownTohtml

 makedownTohtml() {
     if(!this.html) return '';
     let marked = require('marked');
     let html = marked(this.html);
     return `<div class="markdown-body">
                 <h1>${this.title}</h1>
                 ${html}
             </div>`;
 }
開發者ID:CAaRrLl,項目名稱:Blog,代碼行數:9,代碼來源:html.render.ts

示例8: marked

 return new Promise<string>((resolve, reject) => {
   marked(content, (err: any, content: string) => {
     if (err) {
       reject(err);
     } else {
       resolve(content);
     }
   });
 });
開發者ID:jupyter,項目名稱:jupyterlab,代碼行數:9,代碼來源:renderers.ts

示例9: marked

const getLicense = () => {
  return marked(
    fs
      .readFileSync(path.join(process.env.NODE_PATH || ".", "LICENSE.md"))
      .toString()
  )
    .split("\n")
    .slice(1)
    .join("\n");
};
開發者ID:AnandChowdhary,項目名稱:mit-license,代碼行數:10,代碼來源:license.ts

示例10: function

 fs.readFile('../Markdown.md', function (err, data) {
     // Assuming we're reading UTF-8, we strip the byte order mark (3 bytes).
     var content = data.toString('utf8', 3);
     var model = {
         title: 'Markdown Demo',
         raw: content,
         parsed: marked(content)
     };
     res.render(root + '/markdown', model);
 });
開發者ID:irysius,項目名稱:NodeSiteTemplate,代碼行數:10,代碼來源:demos.ts


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