Skip to content

Commit

Permalink
Merge branch 'add-render-markdown-example' into pull-request-403
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Gallo committed Jul 28, 2016
2 parents 94e9609 + 167af7d commit 1e1a49a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/getRawBlob.js
Expand Up @@ -29,5 +29,5 @@ github.gitdata.getBlob({
repo: "node-github",
sha: "b361f529df9b49f2a6b5748b5d71b792c8383e5e"
}, function(err, res) {
console.log(res['data']);
console.log(err, res['data']);
});
19 changes: 19 additions & 0 deletions examples/renderMarkdown.js
@@ -0,0 +1,19 @@
"use strict";

var Client = require("./../lib/index");
var testAuth = require("./../testAuth.json");

var github = new Client({
debug: false
});

github.authenticate({
type: "oauth",
token: testAuth["token"]
});

github.misc.renderMarkdown({
"text": "Hello world github/linguist#1 **cool**, and #1!"
}, function(err, res) {
console.log(err, res["data"]);
});
5 changes: 3 additions & 2 deletions lib/routes.json
Expand Up @@ -2619,14 +2619,15 @@
"required": false,
"validation": "^(markdown|gfm)$",
"invalidmsg": "",
"description": "The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly."
"description": "The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly.",
"default": "markdown"
},
"context": {
"type": "String",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "The repository context, only taken into account when rendering as `gfm`"
"description": "The repository context. Only taken into account when rendering as `gfm`"
}
},
"description": "Render an arbitrary Markdown document"
Expand Down

0 comments on commit 1e1a49a

Please sign in to comment.