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:
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.
```javascript
{ "some": "json" }
```
I tried using json
but didn't like the way it looked. javascript
looks a bit more pleasing to my eye.
```yaml
{
"this-json": "looks awesome..."
}
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.
Source: Stackoverflow.com