How to use dmd - 10 common examples

To help you get started, we’ve selected a few dmd 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 amekkawi / cwlogs-writable / .bin / docs / index.js View on Github external
function buildSplit(templateData, options) {
	var additionalOptions = {
		helper: path.join(__dirname, 'helpers.js'),
		partial: path.join(__dirname, 'partials/*.hbs')
	};

	// Create main index file
	return dmd.async(templateData, Object.assign({}, options, additionalOptions, {
		data: templateData,
		template: '# cwlogs-writable ' + (includeProtected ? 'Extended API' : 'API') + '\n\n{{>main-index}}'
	}))
		.then(function(output) {
			return new Promise(function(resolve, reject) {
				fs.writeFile(path.join(outputPath, 'README.md'), output, function(err) {
					if (err) {
						reject(err);
					}
					else {
						resolve();
					}
				});
			});
		})
		.then(function() {
github amekkawi / cwlogs-writable / .bin / docs / index.js View on Github external
.then(function(templateREADME) {
			// Create project README
			return dmd.async(templateData, Object.assign({}, options, additionalOptions, {
				data: templateData,
				template: templateREADME
			}))
		})
		.then(function(output) {
github electron-userland / electron-builder / scripts / renderer / src / properties.ts View on Github external
function renderMemberListDescription(text: string, indent: string) {
  let data: string = dmdHelper.inlineLinks(text)
    .replace(/<br>/g, "\n")
    .replace(/\n/g, "\n" + indent)
    .replace(new RegExp("\\*{2}\\\\/", "g"), "**/")
    .trim()
  if (data.includes("\n")) {
    // mkdocs requires newline for multi line list item text (otherwise next item on the same line and rendered as list item)
    data += "\n"
  }
  return data
}
github jsdoc2md / jsdoc-to-markdown / es5 / lib / jsdoc-to-markdown.js View on Github external
return this.getTemplateData(options).then(function (templateData) {
          return dmd.async(templateData, dmdOptions);
        });
      }
github jsdoc2md / jsdoc-to-markdown / es5 / lib / jsdoc-to-markdown.js View on Github external
value: function render(options) {
      options = options || {};
      var dmdOptions = new DmdOptions(options);
      if (options.data) {
        return dmd.async(options.data, dmdOptions);
      } else {
        return this.getTemplateData(options).then(function (templateData) {
          return dmd.async(templateData, dmdOptions);
        });
      }
    }
  }, {
github signicode / scramjet / scripts / tasks / full-docs.js View on Github external
.map(async ([filename, contents]) => {
                if (filename === "orphans.md") {
                    log.warn("Orphans found!");
                    contents.forEach(item => log.warn(item.longname, item.meta && `${item.meta.filename}:${item.meta.lineno}`));
                }
                contents.fullIndex = index;

                const output = await dmd.async(contents, {
                    ...options,
                    "member-index-format": "list"
                });

                return new Vinyl({
                    path: filename,
                    contents: Buffer.from(output)
                });
            })
            .catch((err) => {
github jsdoc2md / jsdoc-to-markdown / index.js View on Github external
render (options) {
    options = options || {}
    const dmdOptions = new DmdOptions(options)
    if (options.data) {
      return dmd.async(options.data, dmdOptions)
    } else {
      return this.getTemplateData(options)
        .then(templateData => dmd.async(templateData, dmdOptions))
    }
  }
github amekkawi / cwlogs-writable / .bin / docs / index.js View on Github external
function buildUnified(templateData, options) {
	return dmd.async(templateData, Object.assign({}, options, {
		'param-list-format': 'list',
		data: templateData
	}))
		.then(function(output) {
			return new Promise(function(resolve, reject) {
				fs.writeFile(outputPath, output, function(err) {
					if (err) {
						reject(err);
					}
					else {
						resolve();
					}
				});
			});
		});
}
github jsdoc2md / jsdoc-to-markdown / index.js View on Github external
        .then(templateData => dmd.async(templateData, dmdOptions))
    }
github electron-userland / electron-builder / scripts / jsdoc / helpers.js View on Github external
function parseLink(text) {
  return dmdHelpers.parseLink(text)
}