[json] How to style a JSON block in Github Wiki?

Is there a way to nicely format/style JSON code in Github Wiki (i.e Markdown preferred)?

Something like this with few colors (or bold) and correct indentation:

http://www.freeformatter.com/json-formatter.html#ad-output

This question is related to json github markdown wiki

The answer is


You can use some online websites to beautify JSON, such as: JSON Formatter, and then paste the beautified result to WIKI


I encountered the same problem. So, I tried representing the JSON in different Language syntax formats.But all time favorites are Perl, js, python, & elixir.

This is how it looks.

The following screenshots are from the Gitlab in a markdown file. This may vary based on the colors using for syntax in MARKDOWN files.

JsonasPerl

JsonasPython

JsonasJs

JsonasElixir


```javascript
{ "some": "json" }
```

I tried using json but didn't like the way it looked. javascript looks a bit more pleasing to my eye.


2019 Github Solution

```yaml
{
   "this-json": "looks awesome..."
}

Result

enter image description here

If you want to have keys a different colour to the parameters, set your language as yaml

@Ankanna's answer gave me the idea of going through github's supported language list and yaml was my best find.


Examples related to json

Use NSInteger as array index Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) HTTP POST with Json on Body - Flutter/Dart Importing json file in TypeScript json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 190) Angular 5 Service to read local .json file How to import JSON File into a TypeScript file? Use Async/Await with Axios in React.js Uncaught SyntaxError: Unexpected token u in JSON at position 0 how to remove json object key and value.?

Examples related to github

Does the target directory for a git clone have to match the repo name? Issue in installing php7.2-mcrypt How can I switch to another branch in git? How to draw checkbox or tick mark in GitHub Markdown table? How to add a new project to Github using VS Code git clone error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 How to add empty spaces into MD markdown readme on GitHub? key_load_public: invalid format git - remote add origin vs remote set-url origin Cloning specific branch

Examples related to markdown

How to add empty spaces into MD markdown readme on GitHub? how to make a new line in a jupyter markdown cell How do I display local image in markdown? How to markdown nested list items in Bitbucket? How to apply color in Markdown? How to right-align and justify-align in Markdown? Is there a way to add a gif to a Markdown file? How to add new line in Markdown presentation? How link to any local file with markdown syntax? How to insert a line break <br> in markdown

Examples related to wiki

Resize image in the wiki of GitHub using Markdown How to style a JSON block in Github Wiki?