Skip to content

Fix Indentation of Code Block in several pages#4805

Merged
sarah11918 merged 11 commits intowithastro:mainfrom
VoxelMC:voxelmc-fix-indentation
Oct 16, 2023
Merged

Fix Indentation of Code Block in several pages#4805
sarah11918 merged 11 commits intowithastro:mainfrom
VoxelMC:voxelmc-fix-indentation

Conversation

@VoxelMC
Copy link
Copy Markdown
Contributor

@VoxelMC VoxelMC commented Sep 25, 2023

Note: I would like this PR to be considered for Hacktoberfest

What kind of changes does this PR include?

  • Minor content fixes (broken links, typos, etc.)

Description

Corrected indentation for each language on the the middleware documentation page.

This pull request has been recreated from #4583 without the changes to i18n pages.

image

To

image

@netlify
Copy link
Copy Markdown

netlify bot commented Sep 25, 2023

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 58342d3
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/652d2759a8815700086fc893
😎 Deploy Preview https://deploy-preview-4805--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Copy Markdown
Member

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

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

Thank you for this @VoxelMC 😁, LGTM ✅

Copy link
Copy Markdown
Contributor

@Genteure Genteure left a comment

Choose a reason for hiding this comment

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

I think indentation should be added to the code block under 3., instead of removing the indentation before the code block in 2..

The code block should be a child element of the ordered list.


Source text:

1. one
2. two
    ```js
    console.log(1)
    ```
3. three
    ```js
    console.log(1)
    ```

Rendered result:

  1. one
  2. two
    console.log(2)
  3. three
    console.log(3)

The html looks like:

<ol>
  <li>one</li>
  <li>two <code>console.log(2)</code></li>
  <li>three <code>console.log(3)</code></li>
</ol>

Compared to:

1. one
2. two
```js
console.log(1)
```
3. three
```js
console.log(1)
```

Rendered result:

  1. one
  2. two
console.log(2)
  1. three
console.log(3)

The html looks like:

<ol>
  <li>one</li>
  <li>two</li>
</ol>
<code>console.log(2)</code>
<ol>
  <li>three</li>
</ol>
<code>console.log(3)</code>

@VoxelMC
Copy link
Copy Markdown
Contributor Author

VoxelMC commented Sep 27, 2023

I think indentation should be added to the code block under 3., instead of removing the indentation before the code block in 2..

The code block should be a child element of the ordered list.

Source text:

1. one
2. two
    ```js
    console.log(1)
    ```
3. three
    ```js
    console.log(1)
    ```

Rendered result:

  1. one
  2. two
    console.log(2)
  3. three
    console.log(3)

The html looks like:

<ol>
  <li>one</li>
  <li>two <code>console.log(2)</code></li>
  <li>three <code>console.log(3)</code></li>
</ol>

Compared to:

1. one
2. two
```js
console.log(1)
  1. three
console.log(1)

Rendered result:

1. one
2. two

```js
console.log(2)
  1. three
console.log(3)

The html looks like:

<ol>
  <li>one</li>
  <li>two</li>
</ol>
<code>console.log(2)</code>
<ol>
  <li>three</li>
</ol>
<code>console.log(3)</code>

My personal opinion is that this approach is inconsistent with the overall aesthetic of the pages. Overall, it varies from page to page in the documentation. I am just aiming for consistency in terms of the left margin.

However, I am more than willing to make the changes if some more people agree!

@sarah11918
Copy link
Copy Markdown
Member

Hey Hey! I'm here to confirm that @Genteure is correct with what we intend to use in docs! Extra indentation in these numbered lists!

It's a pain and we don't always get it right, but when we notice, we always do correct this way. So if you're happy to re-indent everything, @VoxelMC , that would be fabulous! 🙌 ➡️

@sarah11918 sarah11918 added the improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) label Oct 4, 2023
@VoxelMC
Copy link
Copy Markdown
Contributor Author

VoxelMC commented Oct 4, 2023

Hey Hey! I'm here to confirm that @Genteure is correct with what we intend to use in docs! Extra indentation in these numbered lists!

It's a pain and we don't always get it right, but when we notice, we always do correct this way. So if you're happy to re-indent everything, @VoxelMC , that would be fabulous! 🙌 ➡️

Yes! I can definitely do that :)

Watch out, inconsistent indentation!

@sarah11918
Copy link
Copy Markdown
Member

@VoxelMC are you still interested in saving us from our indentation?? 😄

@VoxelMC
Copy link
Copy Markdown
Contributor Author

VoxelMC commented Oct 12, 2023

@VoxelMC are you still interested in saving us from our indentation?? 😄

Yup! I will get started on that soon! Just had a project deadline yesterday... :p

I have modified the indentation of code blocks and tips for 19 pages, with some extra changes to ensure some consistency and readability.
@VoxelMC
Copy link
Copy Markdown
Contributor Author

VoxelMC commented Oct 15, 2023

@sarah11918 I believe I have found all of the culprits! There is one on the Cloudflare README, so I may open up a PR there too, for consistency's sake. Let me know if it's okay!

@sarah11918
Copy link
Copy Markdown
Member

Hi @VoxelMC ! Just to let you know, in future I would really appreciate if these were separate PRs. This is 18 files to go through and check previews, some with multiple changes at different points on a page, and it is now much bigger than the original PR.

I appreciate the enthusiasm, and obviously we do want these all fixed! Just know that these changes turn a very simple PR, that can be merged quite quickly, into one that requires a lot of checking on the part of the reviewers. For example, this is not something I can approve in 30 seconds anymore when I have a spare minute. Now, I have to keep a checklist to make sure I haven't missed verifying any of the changes!

I will edit this one as is, but in future please do not do this as it is not actually as helpful as you might think it is. 😅 A handy rule is, if your changes no longer reflect the original PR title, you may have gotten a little too enthusiastic in your changes...

@VoxelMC
Copy link
Copy Markdown
Contributor Author

VoxelMC commented Oct 15, 2023

Hi @VoxelMC ! Just to let you know, in future I would really appreciate if these were separate PRs. This is 18 files to go through and check previews, some with multiple changes at different points on a page, and it is now much bigger than the original PR.

I appreciate the enthusiasm, and obviously we do want these all fixed! Just know that these changes turn a very simple PR, that can be merged quite quickly, into one that requires a lot of checking on the part of the reviewers. For example, this is not something I can approve in 30 seconds anymore when I have a spare minute. Now, I have to keep a checklist to make sure I haven't missed verifying any of the changes!

I will edit this one as is, but in future please do not do this as it is not actually as helpful as you might think it is. 😅 A handy rule is, if your changes no longer reflect the original PR title, you may have gotten a little too enthusiastic in your changes...

Yes of course, I am sorry! I realize my overstepping. I won't do it again, and from now on I will keep the perspective of the reviewers at the top of my list. I know you have a lot of work to do.

Copy link
Copy Markdown
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Some comments going through below! I appreciate your enthusiasm, but as you'll see from some of my comments, this really went off the rails and it can't happen again. 😄

It's not just that it took me more than 30 minutes to review (instead of 30 seconds), our translators also use these PRs as the source to update language files. Now, it becomes difficult for them to update because so many changes happened at once.

Thanks for understanding and working with our process that tries to make things as straightforward as possible for everyone! 🙌

- npm run build
serve: dist
```
```yaml title="Spacefile" {6,8,9}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This does not render indented, probably needs another set of tabs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was the indentation of the numbered list above it. If you agree with my idea, i will revert this and open a separate PR to fix it there instead.

Copy link
Copy Markdown
Member

@sarah11918 sarah11918 Oct 16, 2023

Choose a reason for hiding this comment

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

Ah, looking more closely, neither of these should be indented since the code description isn't part of the step, the list of things are all things to add to the code snippet. So, the current version is fine and I'll remove the change on this page.

return next();
};
```
```js title="src/middleware.js"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is also not indented in my preview, and is literally the single thing this PR was supposed to fix?? 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed, and checked that it is actually indented. I guess i fixed the one I changed but didn't change the one I was supposed to...

@sarah11918 sarah11918 changed the title Fix Indentation of Code Block in Docs Middleware Fix Indentation of Code Block in several pages Oct 16, 2023
@sarah11918 sarah11918 added hacktoberfest-accepted Mark a PR as accepted to contribute towards Hacktoberfest consistency/formatting Standardizing without changing docs content e.g. indenting, lists etc. and removed improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) labels Oct 16, 2023
@sarah11918 sarah11918 merged commit 91a669d into withastro:main Oct 16, 2023
yanthomasdev pushed a commit that referenced this pull request Nov 12, 2023
yanthomasdev added a commit that referenced this pull request Nov 13, 2023
Minor update with PR #4805

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consistency/formatting Standardizing without changing docs content e.g. indenting, lists etc. hacktoberfest-accepted Mark a PR as accepted to contribute towards Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants