-
Notifications
You must be signed in to change notification settings - Fork 54
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
html: Fix typo in JavaScript example #386
Conversation
WalkthroughThe change addresses a syntax error in a JavaScript object declaration within Go templates by fixing a missing colon in a key-value pair. This correction ensures that the JavaScript code embedded in the templates will execute correctly, preventing potential runtime errors and improving the overall robustness of the application. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Outside diff range and nitpick comments (4)
html/TEMPLATES_CHEATSHEET.md (4)
Line range hint
3-3
: Consider adding a comma before "but" to improve readability.- Both packages use the same interface but the following examples of the core features are directed towards HTML applications. + Both packages use the same interface, but the following examples of the core features are directed towards HTML applications.
Line range hint
25-25
: Add a comma after "Finally" to clarify the sentence structure.- Finally analysis of large Go codebases finds that `.tpl` is often used by developers. + Finally, analysis of large Go codebases finds that `.tpl` is often used by developers.
Line range hint
95-95
: Capitalize "Internet Explorer" to refer correctly to the browser.- detecting internet explorer. + detecting Internet Explorer.
Line range hint
129-129
: Correct the possessive pronoun to "its".- then it’s fields can be accessed using the dot with the field name `{{ .FieldName }}`. + then its fields can be accessed using the dot with the field name `{{ .FieldName }}`.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- html/TEMPLATES_CHEATSHEET.md (1 hunks)
Additional Context Used
LanguageTool (45)
html/TEMPLATES_CHEATSHEET.md (45)
Near line 3: Use a comma before ‘but’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...ks. Both packages use the same interface but the following examples of the core feat...
Rule ID: COMMA_COMPOUND_SENTENCE_2
Near line 25: A comma may be missing after the conjunctive/linking adverb ‘Finally’.
Context: ...ing in both Atom and GoSublime editors. Finally analysis of large Go codebases finds th...
Rule ID: SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA
Near line 25: Consider adding a comma here.
Context: ... developers. While the extension is not important it is still good to be consistent withi...
Rule ID: IF_THAT_S_NOT_POSSIBLE_COMMA
Near line 45: Consider adding a comma.
Context: ...emplate Once a template has been parsed there are two options to execute them. A sing...
Rule ID: IF_THERE_COMMA
Near line 59: The auxiliary verb ‘do’ requires the base form of the verb.
Context: ...coding Go’s html/template package does encoding based on the context of the code. As a ...
Rule ID: DID_BASEFORM
Near line 61: After the expression ‘for example’ a comma is usually used.
Context: ...encoding to be rendered correctly. For example the < and > in"<h1>A header!</h1>"
w...
Rule ID: COMMA_FOR_EXAMPLE
Near line 95: Possible missing comma found.
Context: ...This can cause issues when comments are necessary such as detecting internet explorer. `...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 95: The proper noun “Internet Explorer” (= Microsoft browser) needs to be capitalized.
Context: ...omments are necessary such as detecting internet explorer. ```html <!--[if IE]> Place content ...
Rule ID: MICROSOFT_PRODUCTS
Near line 127: Loose punctuation mark.
Context: ... the template can be accessed using dot{{ . }}
. If the data is a complex type then ...
Rule ID: UNLIKELY_OPENING_PUNCTUATION
Near line 129: Consider adding a comma.
Context: ...{{ . }}`. If the data is a complex type then it’s fields can be accessed using the d...
Rule ID: IF_THEN_COMMA
Near line 129: Did you mean to use the possessive pronoun “its”?
Context: ...}`. If the data is a complex type then it’s fields can be accessed using the dot wi...
Rule ID: IT_S_ITS
Near line 137: Possible missing comma found.
Context: ...= .}}We use the
$number` to create a variable then initialize it with the value passe...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 137: It seems that a comma is missing.
Context: ...alue passed to the template. To use the variable we call it in the template with `{{$num...
Rule ID: IN_ORDER_TO_VB_COMMA
Near line 152: It appears that a comma is missing.
Context: ...tdout, "templateName", 23) ``` In this example we pass 23 to the template and stored i...
Rule ID: DURING_THAT_TIME_COMMA
Near line 160: It seems that a comma is missing.
Context: ...ment to check for values, if it doesn’t exist we can use an else value. The empty val...
Rule ID: IF_COMMA
Near line 174: “out” (outside) seems less likely than “our” (belonging to us).
Context: ...or we can use the minus sign-
within out template. `Hello, {{if .Name}} {{....
Rule ID: AI_HYDRA_LEO_CP_OUT_OUR
Near line 209: Consider adding a comma after this introductory phrase.
Context: ...l for each Item automatically. Within a range each Item becomes the{{.}}
and the i...
Rule ID: AS_A_NN_COMMA
Near line 221: Possible missing comma found.
Context: ...sed to the template is a map, slice, or array it can be indexed from the template. We...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 221: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...he keyword, x is the data and number is a integer for the index value. If we had ...
Rule ID: EN_A_VS_AN
Near line 247: It appears that a noun is missing after “The”.
Context: ...s slice. --- #### Theand
Function The and function returns the boolean AND of...
Rule ID: THE_CC
Near line 260: Consider using “who” when you are referring to a person instead of an object.
Context: ... } ``` Pass a ViewData with a User that has Admin set true to the following tem...
Rule ID: THAT_WHO
Near line 271: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...esult will beYou are an admin user!
. However if the ViewData did not include a *Use...
Rule ID: SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA
Near line 271: Comparison is written ‘as false as’.
Context: ...*User object or Admin was set as false then the result will beAccess denied!
. -...
Rule ID: AS_ADJ_AS
Near line 276: It appears that a noun is missing after “The”.
Context: ...denied!. --- #### The
or` Function The or function operates similarly to the a...
Rule ID: THE_CC
Near line 277: It appears that a noun is missing after “the”.
Context: ... The or function operates similarly to the and function however will stop at the f...
Rule ID: THE_CC
Near line 277: Did you mean “end”?
Context: ...e or function operates similarly to the and function however will stop at the first...
Rule ID: AND_END
Near line 277: Consider adding two commas here.
Context: ...n operates similarly to the and function however will stop at the first true.or x y
i...
Rule ID: HOWEVER_COMMA
Near line 277: Did you mean the noun “truth”?
Context: ...function however will stop at the first true.or x y
is equivalent to `if x then x...
Rule ID: TRUE_TRUTH
Near line 297: The phrase “a variety of” may be wordy. To make your writing clearer, consider replacing it.
Context: ...s Thehtml/template
package provides a variety of functions to do comparisons between ope...
Rule ID: A_VARIETY_OF
Near line 316: Possible missing comma found.
Context: ...ple. Rather than updating each template separately we can use a nested template that all o...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 353: Use a comma before ‘but’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...me range to loop through Items as before but we pass the name to the header template...
Rule ID: COMMA_COMPOUND_SENTENCE
Near line 361: Possible missing comma found.
Context: ...as a{{define “templateName”}}
within it then that name will be usable. A speci...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 361: Do not mix variants of the same word (‘usable’ and ‘useable’) within a single text.
Context: ...me”}}` within it then that name will be usable. A specific template can be executed u...
Rule ID: EN_WORD_COHERENCY
Near line 363: This sentence should probably be started with a verb instead of the noun ‘Writer’. If not, consider inserting a comma for better clarity.
Context: ...object of type Template,w
is type io.Writer such as anhttp.ResponseWriter
, Then ...
Rule ID: SENT_START_NN_DT
Near line 389: Possible missing comma found.
Context: ...s are parsed in main. When route/
is reached the template defined asbootstrap
is ...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 438: Consider inserting a comma for improved readability.
Context: ...ype User has been passed to the template we can then call this method from the temp...
Rule ID: INITIAL_ADVP_COMMA
Near line 460: Possible missing comma found.
Context: ...e Method HasPermission has to change at times then the Function Variables (Methods) i...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 460: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ... implementation may not fit the design. Instead aHasPermission func(string) bool
att...
Rule ID: SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA
Near line 513: Possible missing comma found.
Context: ...er a single return value, or two return values where the second has type error. ```go...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 526: Possible missing comma found.
Context: ... }).ParseFiles("hello.gohtml") ``` Here the function to check if a user has per...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 541: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart.
Context: ...eing passed to the template. This works in many cases but in a large application passing too ...
Rule ID: IN_MANY_STYLE_CASES
Near line 541: Possible missing comma found.
Context: ...o the template. This works in many cases but in a large application passing too many...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 553: Use a comma before ‘but’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... The default function just returns false but it defines the function and implementat...
Rule ID: COMMA_COMPOUND_SENTENCE
Near line 555: Possible missing comma found.
Context: ...assed to it. Within the handler for the template you can redefine any functions to use t...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 580: It appears that a comma is missing.
Context: ...lServerError) } } ``` In this handler aUser
is created with ID and Email, ...
Rule ID: DURING_THAT_TIME_COMMA
Markdownlint (61)
html/TEMPLATES_CHEATSHEET.md (61)
23: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
43: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
57: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
125: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
158: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
219: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
295: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
314: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
419: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
72: Column: 5
Hard tabs
73: Column: 5
Hard tabs
107: Column: 5
Hard tabs
108: Column: 5
Hard tabs
188: Column: 5
Hard tabs
189: Column: 5
Hard tabs
193: Column: 5
Hard tabs
194: Column: 5
Hard tabs
231: Column: 5
Hard tabs
232: Column: 5
Hard tabs
237: Column: 5
Hard tabs
238: Column: 5
Hard tabs
321: Column: 5
Hard tabs
374: Column: 5
Hard tabs
375: Column: 5
Hard tabs
376: Column: 5
Hard tabs
377: Column: 5
Hard tabs
378: Column: 5
Hard tabs
380: Column: 5
Hard tabs
381: Column: 5
Hard tabs
385: Column: 5
Hard tabs
400: Column: 5
Hard tabs
405: Column: 5
Hard tabs
476: Column: 5
Hard tabs
477: Column: 5
Hard tabs
478: Column: 5
Hard tabs
479: Column: 5
Hard tabs
480: Column: 5
Hard tabs
481: Column: 5
Hard tabs
482: Column: 5
Hard tabs
483: Column: 5
Hard tabs
484: Column: 5
Hard tabs
485: Column: 5
Hard tabs
486: Column: 5
Hard tabs
487: Column: 5
Hard tabs
559: Column: 5
Hard tabs
561: Column: 5
Hard tabs
562: Column: 5
Hard tabs
563: Column: 5
Hard tabs
564: Column: 5
Hard tabs
565: Column: 5
Hard tabs
566: Column: 5
Hard tabs
567: Column: 5
Hard tabs
568: Column: 5
Hard tabs
569: Column: 5
Hard tabs
570: Column: 5
Hard tabs
571: Column: 5
Hard tabs
572: Column: 5
Hard tabs
573: Column: 5
Hard tabs
574: Column: 5
Hard tabs
575: Column: 5
Hard tabs
576: Column: 5
Hard tabs
Additional comments not posted (1)
html/TEMPLATES_CHEATSHEET.md (1)
88-88
: Corrected the missing colon in the JavaScript object declaration. This fix is crucial for proper syntax and functionality.
@sno2 Thanks! 💪 |
No description provided.