I have a data.json
file that contains html
, css
and js
which I am then using to display it on a webpage.
An example of the data.json
file is this
{
{
"content": "Variables",
"id": "#variables",
"html": "<html>\n\t<p>Variables</p>\n</html>",
"js": "var message = 'Hello World';\nvar name = 'Peter';
}
}
You can see that I am using \n
for a newline and \t
for a tab indentation. This is because it is in a json file so I cannot have tabs and newlines (as far as I am aware). This works, however, it is quite time consuming. It would be far more convenient to write the code in my text editor and then pass through some online tool which would do this formatting for me.
Does anyone know of such a tool or a way I could do this easily?