-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module-ify built-in function documentation #366
Conversation
This hierarchy is now going to document built-in modules, which mostly contain functions but can also contain mixins and may potentially contain variables in the future.
This isn't ideal, since these functions aren't defined with @function, but there's not really a better place to put it. It certainly doesn't make sense in the built-in module documentation anymore.
}; | ||
|
||
var redirect = redirects[window.location.hash]; | ||
if (redirect) window.location.href = redirect; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected '{' and instead saw 'window'.
"#unit-instance_method": "/documentation/modules/math#unit", | ||
"#unitless-instance_method": "/documentation/modules/math#is-unitless", | ||
"#unquote-instance_method": "/documentation/modules/string#unquote", | ||
"#variable_exists-instance_method": "/documentation/modules/meta#variable-exists", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
"#str_slice-instance_method": "/documentation/modules/string#slice", | ||
"#to_lower_case-instance_method": "/documentation/modules/string#to-lower-case", | ||
"#to_upper_case-instance_method": "/documentation/modules/string#to-upper-case", | ||
"#transparentize-instance_method": "/documentation/modules/color#transparentize", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
"#str_length-instance_method": "/documentation/modules/string#length", | ||
"#str_slice-instance_method": "/documentation/modules/string#slice", | ||
"#to_lower_case-instance_method": "/documentation/modules/string#to-lower-case", | ||
"#to_upper_case-instance_method": "/documentation/modules/string#to-upper-case", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
"#str_insert-instance_method": "/documentation/modules/string#insert", | ||
"#str_length-instance_method": "/documentation/modules/string#length", | ||
"#str_slice-instance_method": "/documentation/modules/string#slice", | ||
"#to_lower_case-instance_method": "/documentation/modules/string#to-lower-case", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
"#max-instance_method": "/documentation/modules/math#max", | ||
"#min-instance_method": "/documentation/modules/math#min", | ||
"#mix-instance_method": "/documentation/modules/color#mix", | ||
"#mixin_exists-instance_method": "/documentation/modules/meta#mixin-exists", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
"#length-instance_method": "/documentation/modules/list#length", | ||
"#lighten-instance_method": "/documentation/modules/color#lighten", | ||
"#lightness-instance_method": "/documentation/modules/color#lightness", | ||
"#list_separator-instance_method": "/documentation/modules/list#separator", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
"#inspect-instance_method": "/documentation/modules/meta#inspect", | ||
"#invert-instance_method": "/documentation/modules/color#invert", | ||
"#is_bracketed-instance_method": "/documentation/modules/list#is-bracketed", | ||
"#is_superselector-instance_method": "/documentation/modules/selector#is-superselector", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
"#index-instance_method": "/documentation/modules/list#index", | ||
"#inspect-instance_method": "/documentation/modules/meta#inspect", | ||
"#invert-instance_method": "/documentation/modules/color#invert", | ||
"#is_bracketed-instance_method": "/documentation/modules/list#is-bracketed", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
"#feature_exists-instance_method": "/documentation/modules/meta#feature-exists", | ||
"#floor-instance_method": "/documentation/modules/math#floor", | ||
"#get_function-instance_method": "/documentation/modules/meta#get-function", | ||
"#global_variable_exists-instance_method": "/documentation/modules/meta#global-variable-exists", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
586cb2e
to
cd10213
Compare
"#desaturate-instance_method": "/documentation/modules/color#desaturate", | ||
"#feature_exists-instance_method": "/documentation/modules/meta#feature-exists", | ||
"#floor-instance_method": "/documentation/modules/math#floor", | ||
"#get_function-instance_method": "/documentation/modules/meta#get-function", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
"#content_exists-instance_method": "/documentation/modules/meta#content-exists", | ||
"#darken-instance_method": "/documentation/modules/color#darken", | ||
"#desaturate-instance_method": "/documentation/modules/color#desaturate", | ||
"#feature_exists-instance_method": "/documentation/modules/meta#feature-exists", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
"#change_color-instance_method": "/documentation/modules/color#change", | ||
"#comparable-instance_method": "/documentation/modules/math#compatible", | ||
"#complement-instance_method": "/documentation/modules/color#complement", | ||
"#content_exists-instance_method": "/documentation/modules/meta#content-exists", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
@@ -490,7 +491,7 @@ def return_type_link(return_type) | |||
when 'boolean'; link_to type, '/documentation/values/booleans' | |||
when 'null'; link_to '<code>null</code>', '/documentation/values/null' | |||
when 'function'; link_to type, '/documentation/values/functions' | |||
when 'selector'; link_to type, '/documentation/functions/selector#selector-values' | |||
when 'selector'; link_to type, '/documentation/modules/selector#selector-values' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Metrics/LineLength: Line is too long. [86/80]
name_element = signature_elements.find {|el| el.text == name} | ||
unless names.include?(name_without_namespace) | ||
names << name_without_namespace | ||
name_element = signature_elements.find {|el| el.text == name_without_namespace} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/CollectionMethods: Prefer detect over find.
Layout/SpaceInsideBlockBraces: Space between { and | missing.
Metrics/LineLength: Line is too long. [87/80]
Layout/SpaceInsideBlockBraces: Space missing inside }.
@@ -434,7 +434,8 @@ def _impl_status_row(name, status) | |||
def function(*signatures, returns: nil) | |||
names = Set.new | |||
highlighted_signatures = signatures.map do |signature| | |||
name = signature.split("(").first | |||
name, rest = signature.split("(", 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/UselessAssignment: Useless assignment to variable - rest. Use _ or _rest as a variable name to indicate that it won't be used.
cd10213
to
b1b0754
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got about halfway through, will look at the rest tomorrow
|
||
### Plain CSS Functions | ||
|
||
Any function call that's not either a user-defined or [built-in](../modules) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of rewording this into two sentence:
Sass evaluates user-defined and build-in functions during compilation.
All other functions compile to plain CSS functions unless they use the Sass
argument syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a bit confusing... "evaluates" is being used there to mean "invokes code defined for that function", but we use it elsewhere to mean more generally evaluating an expression, which does happen for plain CSS functions. It's just that the result of that evaluation is an unquoted string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for the rest; I didn't read all the function/module docs, assuming they're pretty much the same as before.
Module-ify built-in function documentation
Module-ify built-in function documentation
Closes #363