Skip to content

Fix indent level for build.rs example #1431

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

Merged
merged 2 commits into from
Aug 18, 2021
Merged

Fix indent level for build.rs example #1431

merged 2 commits into from
Aug 18, 2021

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Jun 24, 2021

Follow-up to #1325.

r? @syphar

@jyn514 jyn514 added A-frontend Area: Web frontend S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Jun 24, 2021
@@ -1,4 +1,4 @@
{# The example Cargo.toml used in about.html #}
{~# The example Cargo.toml used in about.html #~}
Copy link
Member

Choose a reason for hiding this comment

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

Is this not being rendered by tera, not handlebars? AFAICT from the docs tera has no way to control whitespace in comments (though, if it did, it'd be {#- The example ... -#}).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this will be rendered inline, and -#} doesn't work to suppress the post-comment-whitespace:

"{# foobar #}\n"
=> Ok("\n")

"{# foobar -#}\n"
=> Ok("\n")

"{~# foobar #~}\n"
=> Ok("{~# foobar #~}\n")

"{% if true %}{% endif -%}\n"
=> Ok("")

Copy link
Member

Choose a reason for hiding this comment

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

When I check the /about/metadata, this actually makes the comment visible in the page, which I assume is not what we want.

Copy link
Member

Choose a reason for hiding this comment

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

we could fix this here to reduce the space on the top of the code-section on that page, or revert this change

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, fixed it by putting [package] on the same line as the comment.

Copy link
Member

@syphar syphar left a comment

Choose a reason for hiding this comment

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

change of the dedent level seems to work fine,

when we revert or fix the metadata part, this is good to merge

@@ -1,4 +1,4 @@
{# The example Cargo.toml used in about.html #}
{~# The example Cargo.toml used in about.html #~}
Copy link
Member

Choose a reason for hiding this comment

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

When I check the /about/metadata, this actually makes the comment visible in the page, which I assume is not what we want.

@@ -1,4 +1,4 @@
{# The example Cargo.toml used in about.html #}
{~# The example Cargo.toml used in about.html #~}
Copy link
Member

Choose a reason for hiding this comment

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

we could fix this here to reduce the space on the top of the code-section on that page, or revert this change

@syphar syphar added S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Jul 19, 2021
This is a followup to rust-lang#1315 to fix the extra blank line at the top and
to fix the indentation.
@jyn514 jyn514 added S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Aug 16, 2021
@jyn514 jyn514 merged commit 369e1bb into rust-lang:master Aug 18, 2021
@jyn514 jyn514 deleted the about branch August 18, 2021 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Web frontend S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants