I'm trying to change the indent size for CSS/SCSS to two spaces in Atom Beautify, but it has no effect and the indent remains at four spaces. Even if I set it to two spaces in my .jsbeautifyrc file, it has no effect. Am I missing something?
{
"indent_size": 2,
"indent_char": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"jslint_happy": false,
"space_after_anon_function": false,
"brace_style": "collapse-preserve-inline",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": false,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0
}
atom-beautify uses its own configuration, which can be changed in the following two ways in Atom:
In the Settings GUI
Ctrl + , to open Settings (or File > Settings)
Select Packages
Find atom-beautify and click on Settings
Find CSS and click to expand the Settings for CSS
Enter your desired indent size where it says Indent Size:
Repeat previous 2 steps for SCSS
In config.cson
File > Config... to open config.cson
Add the following
"atom-beautify":
css:
indent_size: 2
scss:
indent_size: 2
Related
When using JS to render a vega-lite chart that was originally built in Python (using altair), the default is to allow a variety of options on the chart itself: save as image, view source, and Open in Vega Editor.
Using this method, we can modify those options by adjusting the vega-embed "actions" option:
"actions": {"editor": false}
Eg:
var spec = JSON.parse({{ graph_json|tojson }})
var opt = { /* Options for the embedding */
"renderer": "canvas",
"actions": {
"export": true, /* "Save as PNG|SVG" */
"source": true, /* "View Source" */
"compiled": true, /* "View Vega Source" */
"editor": false /* Do not allow export to https://vega.github.io/editor */
}
};
vegaEmbed("#vis", spec, opt);
However, when using altair in a colab / Jupyter Notebook, we don't have access to that JS. Is there a way to modify those options using altair directly?
I was thinking there might be a renderer option, but I haven't been able to find anything. Perhaps there's a way to customize the colab renderer?
Alternatively, how about setting editorUrl?
But why do I want to do this?
TL;DR: Data exfiltration risk.
Disabling those "Show Source" and "Editor" buttons is one part of data exfil protection. Using a self-hosted editor instead of the default github one is another acceptable method.
Altair 2.3.0 (2018-12-07) added the mostly-undocumented set_embed_options() method to renderers, which means you can send any args to vega-embed.
Usage:
df = pd.DataFrame({"x": [1, 2, 3], "y": [1, 2, 3]})
alt.renderers.set_embed_options(actions={"editor": False})
alt.Chart(df).mark_bar().encode(...)
alt.renderers.set_embed_options(editorUrl="http://localhost:8080")
I recently updated to brackets 1.8 and now I can't disable the auto close brackets. I've got this in my Braskets.json file
"closeTags":
{
"dontCloseTags": [],
"indentTags": [],
"whenOpening": false,
"whenClosing": false
}
Any ideas?
Just realised what the issue is. I needed this line
"closeBrackets": false,
How can I set the indent size of html to tab in atom-beautifier ?
I tried the following in .jscsrc but it doesn't have any effect.
{
"html": {
"indent_char": " ",
"indent_size": 1,
"indent_with_tabs": true
}
}
The atom-beautifier package is deprecated and the author has suggested that users migrate to the atom-beautify package:
Please use: https://atom.io/packages/atom-beautify It's much better :)
The atom-beautify package supports a .jsbeautifyrc to configure the indent size:
{
"indent_size": 2,
"indent_char": " ",
"other": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"jslint_happy": true,
"indent_handlebars": true
}
{
"indent_char": " ", //Tab here. Make sure editor doesn't change it.
"indent_size": 1,
"indent_with_tabs": true
}
I've put this at $ATOMPATH/packages/atom-beautify/.jsbeautifyrc AND $ATOMPATH/packages/atom-beautify/src/.jsbeautifyrc.
atom-beautify is still buggy as heck with tabs. Also make sure that you turn off "soft tabs" in Atom.
Here's a gist of some tips for killing spaces:
https://gist.github.com/zamicol/c5c926500ddde49006122f9e4e52e48f
I am using a jqGrid that has allot of columns to it.
I added the view option (when clicking on a row and then on the 'view' button, in the bottom left corner of the grid, it opens a model with all the info for that row.
I see that the model has some css style:
overflow-hidden
Therefor if i have allot of columns to show after a certain height that i gave it when creating the grid, they get hidden.
How can i make that dialog box be:
overflow-auto
If possible i want only the inside div to scroll and leave the header of the dialog and the buttons on bottom there all the time.
How can i do this?
myGrid.jqGrid('navGrid', '#pager',
{ edit: false, add: false, del: false, search: false, view: true }, //option
{}, // use default settings for edit
{}, // use default settings for add
{}, // delete instead that del:false we need this
{},
{ height: 250, jqModal: false, closeOnEscape: true} // view options
);
I tried this:
$('#viewmod'+myGridId).css({overflow: 'auto'});
But it didnt work...
You tried the way described here and here.
Found the answer for this.
When declaring the view options add the dataheight option...
{ dataheight: 250, jqModal: false, closeOnEscape: true} // view options
I'm having trouble with jslint, for example when I set the option 'white: true' on aptana, I get even more errors about indentation! but on jslint.com I don't get those messages, the option there works.
Just wondering, is this a known bug, or maybe I'm doing something wrong?
I have in the beginning of the file:
/jslint browser: true, vars: true, white: true/
...and 200+ warning messages :p
/jslint browser: true, vars: true, white: true/
should be
/*jslint browser: true, vars: true, white: true */
BTW, if you go to jslint.org and set the options you want, it produces the exact string you'll need.