For example, for a simple file like this, it displays everything in one line:
{"315": "appear", "1529": "perVobj", "88": "JJR", "2212": "xM"}
I would like it to be displayed at multiple lines, like:
{
key:value,
key: value,
...
}
Try to use:
Ctrl+Shift+Alt+L
it would reformat your file
go to File->Settings->Code Style->JSON and set as per your needs.
Further, go to settings and create shortcut for reformat or use Ctrl+Shift+Alt+L(default) to reformat the file.
see this
Related
enter image description here
When I use VS Code, a problem notice likes that(in the above image) is printed.
Although I want to fix it and really don't want to see it, I can't find any way to fix.
I am very painful about just seeing that error message all the time.
Please give me some helps.
You opened a { parenthesis at line 2784 and didn't close it. You should close it. --> }
Also, you have an extra comma , at 2793 that you have to remove.
Not use {}, because you may already mess your settings.json before.
so my suggestion as follows:
// in/your/settings.json/file
...
setting0_name:[setting0.0, setting0.1],
seting1_name : settings,
...
I want to know how to change title on login page via Keycloak?
The easiest way is to change the following line in themes/base/login/messages/messages_[your_language].properties.
loginTitle=Log in to {0}
However, I suggest you should read the official document and create your original theme.
You can change to themes[your theme]\login\resources\css\login.css
You can add like this
/* Title */
#kc-page-title::after {
content: " to MyHomeLogin"
}
I suggest the following if you are working with a custom theme.
Go to themes/base/login.
Copy the file template.ftl
Go to themes/custom/login -> 'custom' or the name of your theme
Paste the template.ftl file there
Open template.ftl
Search for the element
Replace the content with your desired text
Save it and reload the page
I prefer this method because it only overwrites the base theme at runtime without making any changes to the base theme directly. Thanks.
I'm trying to display a JSON object nicely (this means on several lines with indentation) with Alex Gorbatchev plugin : http://alexgorbatchev.com/SyntaxHighlighter/
Unfortunately, it all displays on a single line.
I'm using the javascript brush.
I've created a code pen : http://codepen.io/hugsbrugs/pen/XJVjjP?editors=101
var json_object = {"hello":{"my_friend":"gérard", "my_dog":"billy"}};
$('#nice-json').html('<pre class="brush: javascript">' + JSON.stringify(json_object) + '</pre>');
SyntaxHighlighter.highlight();
Please don't give a list of other plugins since I know there is a bunch but I don't want to load additional plugins ... I'd like to achieve it with this plugin.
Thanks for your help
Try indenting the json with the stringify method.
JSON.stringify(json_object, undefined, 2);
You can use the optional third parameter of JSON.stringify(...) which is the space argument.
Change:
JSON.stringify(json_object)
to:
JSON.stringify(json_object, null, '\t')
Here is your codepen updated to show the result of the above modifications. The above modification causes your JSON to be pretty printed over multiple lines.
i have a word file with 100 different hyperlinks.
Eg:
http://word1.com
http://word2.com
upto http://wordn.com
I have to create a html file with these n links.
like word1 which has a hyperlink to word1.com, word2 which has a hyperlink to word2.com etc
Any easy way to do this? rather than copy pasting the link and writing the code?
You could use a JavaScript loop to do this. Such as the for loop:
for (var i=0;i<100;i++)
{
document.write('Word' + i + '');
}
like so...
I don't know if this is what you're looking for, but i hope I helped!
You can use a simple loop and create an anchor in each run. Use the .setAttribute("href", "word"+count+".com") where count keeps incrementing, using Javascript. See fiddle
How can I remove the upload button helper FileUpload.GetHtml?
#FileUpload.GetHtml(
initialNumberOfFiles:1,
allowMoreFilesToBeAdded:true,
includeFormTag:true,
addText:"Adicionar",
uploadText:"")
Unfortunately not. The only way to remove it using code is to set includeFormTag to false. But then you'd lose all the rest of the post html. :)
However, since the html output is consistent you can just do a simple replace.
#Html.Raw(FileUpload.GetHtml(
initialNumberOfFiles:1,
allowMoreFilesToBeAdded:true,
includeFormTag:true,
addText:"Adicionar",
uploadText:"").ToString().Replace("<input value=\"\" type=\"submit\"/>", ""))
It's rather ugly though.