Skip to content
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

Merged
merged 5 commits into from
Sep 5, 2019
Merged

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Sep 4, 2019

Closes #363

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.
@nex3 nex3 requested a review from jelbourn September 4, 2019 22:24
};

var redirect = redirects[window.location.hash];
if (redirect) window.location.href = redirect;

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",

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",

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",

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",

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",

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",

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",

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",

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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

"#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",

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",

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",

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'

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}

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)

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.

@nex3 nex3 temporarily deployed to sass-lang-pr-366 September 5, 2019 00:56 Inactive
Copy link
Member

@jelbourn jelbourn left a 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)
Copy link
Member

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.

Copy link
Contributor Author

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.

source/documentation/at-rules/function.html.md.erb Outdated Show resolved Hide resolved
source/documentation/at-rules/mixin.html.md.erb Outdated Show resolved Hide resolved
source/documentation/modules.html.md.erb Outdated Show resolved Hide resolved
source/documentation/modules.html.md.erb Outdated Show resolved Hide resolved
Copy link
Member

@jelbourn jelbourn left a 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.

@nex3 nex3 merged commit ab7d3ec into feature.use Sep 5, 2019
@nex3 nex3 deleted the built-in-modules branch September 5, 2019 21:54
asaf400 pushed a commit to asaf400/ass-site that referenced this pull request Apr 18, 2024
Module-ify built-in function documentation
asaf400 pushed a commit to asaf400/ass-site that referenced this pull request Apr 18, 2024
Module-ify built-in function documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants