-
Notifications
You must be signed in to change notification settings - Fork 301
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
cue fmt indents top-level comments #722
Comments
This also applies to
|
@rogpeppe |
Elaborating from testscript above by @rogpeppe, this shows similarities and differences between Are any of these differences intended?
|
This also affects the playground: https://cuelang.org/play/?id=G3wjR5M0KCi#w=function&i=cue&f=eval&o=cue I've just started filling out the set of preloadable examples for the playground, and almost every single one of them will need leading comments, explaining what's about to be demonstrated. This bug will give a less than great impression of the playground to newcomers, IMHO!! |
This adds a small set of representative examples to the playground, replacing the current invalid examples. They are placed in an indicative structure, with the "Introduction" category being intended to hold examples for the user who landed on the playground before reading any other part of the site, and the "Tour" category showing a couple of CUE examples taken directly from the on-page CUE in docs/tour/. The Tour category isn't expanded to include all the docs examples, yet, as both cue-lang/cue#2995 and cue-lang/cue#2900 need resolving to let us avoid spending a *lot* of time on manual content syncing. Formatting notes for as&when the examples are expanded, and if their generation is automated: - Because cue-lang/cue#722 also strikes the playground ("top-level comments are indented") when the playground's default of "cue eval" is selected, care has been taken to make sure that comments are used that don't trigger this bug (as it looks pretty poor for predefined examples to have this problem). Some relevant information: - only the first comment presented at the top of the "eval" output is affected - it doesn't affect comments which aren't included in the output, such as introductory comments which are separated by a blank line from the first field emitted - it doesn't affect fields with a struct or list value - it only affects single-line comments - it can affect a comment that's not the first line of the source, if it's attached to any definition of the first field that's present in the emitted output - Including links from tour-derived examples back to the relevant tour page feels like a win, but they need to be split over two comment lines or the end of the URL disappears from view. This also has the nice effect of pushing the URL to the second line of the editor, which makes the "Follow link (ctrl+click)" mouseover popup *not* get visually truncated by the top edge of the editor pane. Preview-Path: /play Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I374ee591f767bea3a0e07f29ce7825468661f42f
This adds a small set of representative examples to the playground, replacing the current invalid examples. They are placed in an indicative structure, with the "Introduction" category being intended to hold examples for the user who landed on the playground before reading any other part of the site, and the "Tour" category showing a couple of CUE examples taken directly from the on-page CUE in docs/tour/. The Tour category isn't expanded to include all the docs examples, yet, as both cue-lang/cue#2995 and cue-lang/cue#2900 need resolving to let us avoid spending a *lot* of time on manual content syncing. Formatting notes for as&when the examples are expanded, and if their generation is automated: - Because cue-lang/cue#722 also strikes the playground ("top-level comments are indented") when the playground's default of "cue eval" is selected, care has been taken to make sure that comments are used that don't trigger this bug (as it looks pretty poor for predefined examples to have this problem). Some relevant information: - only the first comment presented at the top of the "eval" output is affected - it doesn't affect comments which aren't included in the output, such as introductory comments which are separated by a blank line from the first field emitted - it doesn't affect fields with a struct or list value - it only affects single-line comments - it can affect a comment that's not the first line of the source, if it's attached to any definition of the first field that's present in the emitted output - Including links from tour-derived examples back to the relevant tour page feels like a win, but they need to be split over two comment lines or the end of the URL disappears from view. This also has the nice effect of pushing the URL to the second line of the editor, which makes the "Follow link (ctrl+click)" mouseover popup *not* get visually truncated by the top edge of the editor pane. Preview-Path: /play Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I374ee591f767bea3a0e07f29ce7825468661f42f Dispatch-Trailer: {"type":"trybot","CL":1188421,"patchset":2,"ref":"refs/changes/21/1188421/2","targetBranch":"master"}
This adds a small set of representative examples to the playground, replacing the current invalid examples. They are placed in an indicative structure, with the "Introduction" category being intended to hold examples for the user who landed on the playground before reading any other part of the site, and the "Tour" category showing a couple of CUE examples taken directly from the on-page CUE in docs/tour/. The Tour category isn't expanded to include all the docs examples, yet, as both cue-lang/cue#2995 and cue-lang/cue#2900 need resolving to let us avoid spending a *lot* of time on manual content syncing. Formatting notes for as&when the examples are expanded, and if their generation is automated: - Because cue-lang/cue#722 also strikes the playground ("top-level comments are indented") when the playground's default of "cue eval" is selected, care has been taken to make sure that comments are used that don't trigger this bug (as it looks pretty poor for predefined examples to have this problem). Some relevant information: - only the first comment presented at the top of the "eval" output is affected - it doesn't affect comments which aren't included in the output, such as introductory comments which are separated by a blank line from the first field emitted - it doesn't affect fields with a struct or list value - it only affects single-line comments - it can affect a comment that's not the first line of the source, if it's attached to any definition of the first field that's present in the emitted output - Including links from tour-derived examples back to the relevant tour page feels like a win, but they need to be split over two comment lines or the end of the URL disappears from view. This also has the nice effect of pushing the URL to the second line of the editor, which makes the "Follow link (ctrl+click)" mouseover popup *not* get visually truncated by the top edge of the editor pane. Preview-Path: /play Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I374ee591f767bea3a0e07f29ce7825468661f42f
This adds a small set of representative examples to the playground, replacing the current invalid examples. They are placed in an indicative structure, with the "Introduction" category being intended to hold examples for the user who landed on the playground before reading any other part of the site, and the "Tour" category showing a couple of CUE examples taken directly from the on-page CUE in docs/tour/. The Tour category isn't expanded to include all the docs examples, yet, as both cue-lang/cue#2995 and cue-lang/cue#2900 need resolving to let us avoid spending a *lot* of time on manual content syncing. Formatting notes for as&when the examples are expanded, and if their generation is automated: - Because cue-lang/cue#722 also strikes the playground ("top-level comments are indented") when the playground's default of "cue eval" is selected, care has been taken to make sure that comments are used that don't trigger this bug (as it looks pretty poor for predefined examples to have this problem). Some relevant information: - only the first comment presented at the top of the "eval" output is affected - it doesn't affect comments which aren't included in the output, such as introductory comments which are separated by a blank line from the first field emitted - it doesn't affect fields with a struct or list value - it only affects single-line comments - it can affect a comment that's not the first line of the source, if it's attached to any definition of the first field that's present in the emitted output - Including links from tour-derived examples back to the relevant tour page feels like a win, but they need to be split over two comment lines or the end of the URL disappears from view. This also has the nice effect of pushing the URL to the second line of the editor, which makes the "Follow link (ctrl+click)" mouseover popup *not* get visually truncated by the top edge of the editor pane. Preview-Path: /play Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I374ee591f767bea3a0e07f29ce7825468661f42f Dispatch-Trailer: {"type":"trybot","CL":1188421,"patchset":3,"ref":"refs/changes/21/1188421/3","targetBranch":"master"}
This adds a small set of representative examples to the playground, replacing the current invalid examples. They are placed in an indicative structure, with the "Introduction" category being intended to hold examples for the user who landed on the playground before reading any other part of the site, and the "Tour" category showing a couple of CUE examples taken directly from the on-page CUE in docs/tour/. The Tour category isn't expanded to include all the docs examples, yet, as both cue-lang/cue#2995 and cue-lang/cue#2900 need resolving to let us avoid spending a *lot* of time on manual content syncing. Formatting notes for as&when the examples are expanded, and if their generation is automated: - Because cue-lang/cue#722 also strikes the playground ("top-level comments are indented") when the playground's default of "cue eval" is selected, care has been taken to make sure that comments are used that don't trigger this bug (as it looks pretty poor for predefined examples to have this problem). Some relevant information: - only the first comment presented at the top of the "eval" output is affected - it doesn't affect comments which aren't included in the output, such as introductory comments which are separated by a blank line from the first field emitted - it doesn't affect fields with a struct or list value - it only affects single-line comments - it can affect a comment that's not the first line of the source, if it's attached to any definition of the first field that's present in the emitted output - Including links from tour-derived examples back to the relevant tour page feels like a win, but they need to be split over two comment lines or the end of the URL disappears from view. This also has the nice effect of pushing the URL to the second line of the editor, which makes the "Follow link (ctrl+click)" mouseover popup *not* get visually truncated by the top edge of the editor pane. For cue-lang/docs-and-content#92 Preview-Path: /play Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I374ee591f767bea3a0e07f29ce7825468661f42f
This adds a small set of representative examples to the playground, replacing the current invalid examples. They are placed in an indicative structure, with the "Introduction" category being intended to hold examples for the user who landed on the playground before reading any other part of the site, and the "Tour" category showing a couple of CUE examples taken directly from the on-page CUE in docs/tour/. The Tour category isn't expanded to include all the docs examples, yet, as both cue-lang/cue#2995 and cue-lang/cue#2900 need resolving to let us avoid spending a *lot* of time on manual content syncing. Formatting notes for as&when the examples are expanded, and if their generation is automated: - Because cue-lang/cue#722 also strikes the playground ("top-level comments are indented") when the playground's default of "cue eval" is selected, care has been taken to make sure that comments are used that don't trigger this bug (as it looks pretty poor for predefined examples to have this problem). Some relevant information: - only the first comment presented at the top of the "eval" output is affected - it doesn't affect comments which aren't included in the output, such as introductory comments which are separated by a blank line from the first field emitted - it doesn't affect fields with a struct or list value - it only affects single-line comments - it can affect a comment that's not the first line of the source, if it's attached to any definition of the first field that's present in the emitted output - Including links from tour-derived examples back to the relevant tour page feels like a win, but they need to be split over two comment lines or the end of the URL disappears from view. This also has the nice effect of pushing the URL to the second line of the editor, which makes the "Follow link (ctrl+click)" mouseover popup *not* get visually truncated by the top edge of the editor pane. For cue-lang/docs-and-content#92 Preview-Path: /play Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I374ee591f767bea3a0e07f29ce7825468661f42f Dispatch-Trailer: {"type":"trybot","CL":1188421,"patchset":4,"ref":"refs/changes/21/1188421/4","targetBranch":"master"}
This adds a small set of representative examples to the playground, replacing the current invalid examples. They are placed in an indicative structure, with the "Introduction" category being intended to hold examples for the user who landed on the playground before reading any other part of the site, and the "Tour" category showing a couple of CUE examples taken directly from the on-page CUE in docs/tour/. The Tour category isn't expanded to include all the docs examples, yet, as both cue-lang/cue#2995 and cue-lang/cue#2900 need resolving to let us avoid spending a *lot* of time on manual content syncing. Formatting notes for as&when the examples are expanded, and if their generation is automated: - Because cue-lang/cue#722 also strikes the playground ("top-level comments are indented") when the playground's default of "cue eval" is selected, care has been taken to make sure that comments are used that don't trigger this bug (as it looks pretty poor for predefined examples to have this problem). Some relevant information: - only the first comment presented at the top of the "eval" output is affected - it doesn't affect comments which aren't included in the output, such as introductory comments which are separated by a blank line from the first field emitted - it doesn't affect fields with a struct or list value - it only affects single-line comments - it can affect a comment that's not the first line of the source, if it's attached to any definition of the first field that's present in the emitted output - Including links from tour-derived examples back to the relevant tour page feels like a win, but they need to be split over two comment lines or the end of the URL disappears from view. This also has the nice effect of pushing the URL to the second line of the editor, which makes the "Follow link (ctrl+click)" mouseover popup *not* get visually truncated by the top edge of the editor pane. For cue-lang/docs-and-content#92 Preview-Path: /play Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I374ee591f767bea3a0e07f29ce7825468661f42f Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1188421 Reviewed-by: Paul Jolly <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
This removes several uses of "```" to format code on the page, and replaces them with "{{{with code ...}}}". This benefits us by increasing automated "cue fmt" coverage of the examples on the site, and by engaging syntax highlighting without manual language markers. Some examples of "```" remain, such as where an environment variable is being demonstrated; or inside the language guide and spec, which aren't being updated on the master branch currently. One example in the modules reference triggers cue-lang/cue#722, and ends up with a leading comment being incorrectly indented; this error is allowed to exist as the issue is fixed, and the page will soon fix itself when the site is updated to use CUE v0.10.0 or later. One page (list-no-duplicates) loses the highlighting of specific lines in some examples. This is acceptable in light of the changes anticipated by cue-lang/docs-and-content#171, which are likely to result in this page being completely rewritten or subsumed into another howto guide. Preview-Path: /docs/howto/list-no-duplicates/ Preview-Path: /docs/introduction/ Preview-Path: /docs/reference/modules/ Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I1a15a52ddf979ad6ee44bc8950d5e67892bfeb2f Dispatch-Trailer: {"type":"trybot","CL":1198345,"patchset":1,"ref":"refs/changes/45/1198345/1","targetBranch":"master"}
This removes several uses of "```" to format code on the page, and replaces them with "{{{with code ...}}}". This benefits us by increasing automated "cue fmt" coverage of the examples on the site, and by engaging syntax highlighting without manual language markers. Some examples of "```" remain, such as where an environment variable is being demonstrated; or inside the language guide and spec, which aren't being updated on the master branch currently. One example in the modules reference triggers cue-lang/cue#722, and ends up with a leading comment being incorrectly indented; this error is allowed to exist as the issue is fixed, and the page will soon fix itself when the site is updated to use CUE v0.10.0 or later. One page (list-no-duplicates) loses the highlighting of specific lines in some examples. This is acceptable in light of the changes anticipated by cue-lang/docs-and-content#171, which are likely to result in this page being completely rewritten or subsumed into another howto guide. Preview-Path: /docs/howto/list-no-duplicates/ Preview-Path: /docs/introduction/ Preview-Path: /docs/reference/modules/ Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I1a15a52ddf979ad6ee44bc8950d5e67892bfeb2f Dispatch-Trailer: {"type":"trybot","CL":1198345,"patchset":2,"ref":"refs/changes/45/1198345/2","targetBranch":"master"}
This removes several uses of "```" to format code on the page, and replaces them with "{{{with code ...}}}". This benefits us by increasing automated "cue fmt" coverage of the examples on the site, and by engaging syntax highlighting without manual language markers. Some examples of "```" remain, such as where an environment variable is being demonstrated; or inside the language guide and spec, which aren't being updated on the master branch currently. One example in the modules reference triggers cue-lang/cue#722, and ends up with a leading comment being incorrectly indented; this issue is fixed, and the example will have its #nofmt removed after the site is updated to use CUE v0.10.0 or later. One page (list-no-duplicates) loses the highlighting of specific lines in some examples. This is acceptable in light of the changes anticipated by cue-lang/docs-and-content#171, which are likely to result in this page being completely rewritten or subsumed into another howto guide. Preview-Path: /docs/howto/list-no-duplicates/ Preview-Path: /docs/introduction/ Preview-Path: /docs/reference/modules/ Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I1a15a52ddf979ad6ee44bc8950d5e67892bfeb2f Dispatch-Trailer: {"type":"trybot","CL":1198345,"patchset":3,"ref":"refs/changes/45/1198345/3","targetBranch":"master"}
This removes several uses of "```" to format code on the page, and replaces them with "{{{with code ...}}}". This benefits us by increasing automated "cue fmt" coverage of the examples on the site, and by engaging syntax highlighting without manual language markers. Some examples of "```" remain, such as where an environment variable is being demonstrated; or inside the language guide and spec, which aren't being updated on the master branch currently. One example in the modules reference triggers cue-lang/cue#722, and ends up with a leading comment being incorrectly indented; this issue is fixed, and the example will have its #nofmt removed after the site is updated to use CUE v0.10.0 or later. One page (list-no-duplicates) loses the highlighting of specific lines in some examples. This is acceptable in light of the changes anticipated by cue-lang/docs-and-content#171, which are likely to result in this page being completely rewritten or subsumed into another howto guide. Preview-Path: /docs/howto/list-no-duplicates/ Preview-Path: /docs/introduction/ Preview-Path: /docs/reference/modules/ Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I1a15a52ddf979ad6ee44bc8950d5e67892bfeb2f Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1198345 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
Originally opened by @bbkane in cuelang/cue#722
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: