UNPKG

1.5 kBSource Map (JSON)View Raw
1{"version":3,"names":[],"mappings":"","sources":["Markdown.js"],"sourcesContent":["/**\n * @file\n * @copyright 2013 Michael Aufreiter (Development Seed) and 2016 Yahoo Inc.\n * @license Licensed under {@link https://spdx.org/licenses/BSD-3-Clause-Clear.html BSD-3-Clause-Clear}.\n * Github.js is freely distributable.\n */\n\nimport Requestable from './Requestable';\n\n/**\n * Renders html from Markdown text\n */\nclass Markdown extends Requestable {\n /**\n * construct a Markdown\n * @param {Requestable.auth} auth - the credentials to authenticate to GitHub\n * @param {string} [apiBase] - the base Github API URL\n * @return {Promise} - the promise for the http request\n */\n constructor(auth, apiBase) {\n super(auth, apiBase);\n }\n\n /**\n * Render html from Markdown text.\n * @see https://developer.github.com/v3/markdown/#render-an-arbitrary-markdown-document\n * @param {Object} options - conversion options\n * @param {string} [options.text] - the markdown text to convert\n * @param {string} [options.mode=markdown] - can be either `markdown` or `gfm`\n * @param {string} [options.context] - repository name if mode is gfm\n * @param {Requestable.callback} [cb] - will receive the converted html\n * @return {Promise} - the promise for the http request\n */\n render(options, cb) {\n return this._request('POST', '/markdown', options, cb, true);\n }\n}\n\nmodule.exports = Markdown;\n"],"file":"Markdown.js"}
\No newline at end of file