-
Couldn't load subscription status.
- Fork 3k
PR: Split the Generator Command from Output for Clarity Fixes #6441 #6442
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
base: main
Are you sure you want to change the base?
Conversation
…inners following the context guide. fixes phoenixframework#6441
|
Thank you! I think this is good, but we have more places where this is an issue, so if we change this, I think we should change them all. For example, same page we have |
|
Unfortunately, I can also see people wanting to copy the whole contents, so splitting the command and the output looks like a good idea to me |
|
Gents, I'm happy to go through all the docs and apply these changes for consistency. 👌 |
|
Very nice, thank you a lot! :) |
|
Should I apply the changes to this PR or open a separate one? (happy either way, just want to keep it reviewable) |
|
This one! Also feel free to do it as separate commits and we will squash it all at the end automatically. |
|
@nelsonic I think we should also do the same for chapter 4 and 5 if you did not already plan to do that. |
|
@SteffenDE good plan. 🧑💻 👌 |
…s_context_boundaries.md
…will will" -> "will"
| - Phoenix v1.8 moved the `<.flash_group>` component to the `Layouts` module. You are **forbidden** from calling `<.flash_group>` outside of the `layouts.ex` module | ||
| - Out of the box, `core_components.ex` imports an `<.icon name="hero-x-mark" class="w-5 h-5"/>` component for for hero icons. **Always** use the `<.icon>` component for icons, **never** use `Heroicons` modules or similar | ||
| - **Always** use the imported `<.input>` component for form inputs from `core_components.ex` when available. `<.input>` is imported and using it will will save steps and prevent errors | ||
| - **Always** use the imported `<.input>` component for form inputs from `core_components.ex` when available. `<.input>` is imported and using it will save steps and prevent errors |
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.
💡 This and the similar change in usage-rules/phoenix.md could be extracted to a separate PR and merged sooner, as they're simple typo fixes.
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.
Ok. Will split into separate PR when I’m back at my desk tomorrow morning. Thanks.
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.
Separate micro-PR to fix: #6492
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.
Some suggestions from an outside contributor who wants to see docs getting better and likes the initiative in this PR :)
| ```console | ||
| $ mix phx.gen.context Catalog Category categories \ | ||
| mix phx.gen.context Catalog Category categories \ |
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.
In my experience the console "language" is used when there's a prompt like $ , while shell is used for when there's no prompt.
Examples:
$ mix phx.gen.context Catalog Category categories \
title:string:unique --no-scopemix phx.gen.context Catalog Category categories \
title:string:unique --no-scopeNot much to syntax highlight anyway :)
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.
let's keep the $ for console when it shows a command to run :)
| Do you want to create a LiveView based authentication system? [Yn] | ||
| ``` | ||
|
|
||
| Type `n` followed by `Return` key, |
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.
I wonder if it's worth mentioning the exact keystrokes here. Some keyboards/locales will have enter, some return, maybe others?!
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.
Take your point. 👌
People tend to know the Return key is interchangeable with Enter. 💭
Just being explicit so people know they need to perform that input. ⌨️
|
|
||
| You will see output confirming the migration file was created: | ||
|
|
||
| ```console |
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.
I think for pure console output blocks we should use no language hint = no syntax highlight (I'm not part of the Phoenix team, though, just an outside contributor :) -- Steffen and other maintainers have the say here).
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.
When there's no language hint, ExDoc uses Elixir, so for just text you want text as language. But console works fine as well. The only thing console does is make the dollar sign at the start of lines non-selectable and ignored when copying.
| ```console | |
| ```text |
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.
Will apply this suggestion on localhost. 👌
Co-authored-by: Rodolfo Carvalho <rhcarvalho@gmail.com>
This PR splits the command from it's output in the docs to fix #6441
Feel free to ignore if you prefer to keep it the way it is ... 👌
I'm sure people can figure it out for themselves, just feels like a unpleasant experience IMO. 🙃