Skip to content
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

print: add page #15597

Merged
merged 11 commits into from
Feb 11, 2025
Merged

print: add page #15597

merged 11 commits into from
Feb 11, 2025

Conversation

gsspdev
Copy link
Contributor

@gsspdev gsspdev commented Jan 24, 2025

  • The page(s) are in the correct platform directories: common, linux, osx, windows, sunos, android, etc.
  • The page(s) have at most 8 examples.
  • The page description(s) have links to documentation or a homepage.
  • The page(s) follow the content guidelines.
  • The page(s) follow the style guide.
  • The PR title conforms to the recommended templates.
  • Version of the command being documented (if known):

@CLAassistant
Copy link

CLAassistant commented Jan 24, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added new command Issues requesting creation of a new page or PRs adding a new page for a command. review needed Prioritized PRs marked for reviews from maintainers. labels Jan 24, 2025
@tldr-pages tldr-pages deleted a comment from tldr-bot Jan 24, 2025
@Managor
Copy link
Collaborator

Managor commented Jan 24, 2025

The first time struggle is real. Welcome to the project.

@gsspdev
Copy link
Contributor Author

gsspdev commented Jan 24, 2025

The first time struggle is real. Welcome to the project.

I had to recover my work from a screenshot I had and it messed up the formatting haha. Thx for the welcome!

Copy link
Collaborator

@MachiavelliII MachiavelliII left a comment

Choose a reason for hiding this comment

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

@Managor do you think it will conflict with pages/Linux/print.md because they have the same name?

@Managor
Copy link
Collaborator

Managor commented Jan 24, 2025

It will. Platform specific pages will overshadow common pages. Judging by the content, I'm for removing linux/print.md.

@gsspdev
Copy link
Contributor Author

gsspdev commented Jan 24, 2025

There's also a pages/windows/print.md.

I considered submitting it to pages/osx/print.md as zsh is the default MacOS shell, but it's also default on notable Linux distributions.

If you stumble across 'print' it's hard to find documentation for it and it's not obvious that it's a zsh builtin. There isn't a dedicated manpage, trying '-h' or '--help' as flags provides no help, and it's generic name makes it more difficult to find information on by Googling or asking an LLM.

@Managor
Copy link
Collaborator

Managor commented Jan 24, 2025

Does help print, enable print or info print do anything. They're keywords in bash
#10584 (comment)

EDIT: Also try which print

@sbrl sbrl mentioned this pull request Jan 25, 2025
@sbrl
Copy link
Member

sbrl commented Jan 25, 2025

As far as I understand, we have a conflict between run-mailcap's print and zsh's print.

To this end, I suggest:

  • zsh's print becomes print-zsh
  • run-mailcap's print becomes print-mailcap or mailcap-run-print
  • print becomes a disambiguation page:
# print

> Multiple commands have the name `print`.
> See also `print-zsh` and `mailcap-run-print`.

- View tldr page for zsh's print command:

`tldr print-zsh`

- View tldr page for mailcap's print alias:

`tldr run-mailcap-print`

@MachiavelliII
Copy link
Collaborator

Will this be a standard in the project for resolving conflicts between other commands that share the same name and platform?

@Managor
Copy link
Collaborator

Managor commented Jan 25, 2025

@gsspdev Would you like to implement this or pass the task to someone else?

@gsspdev
Copy link
Contributor Author

gsspdev commented Jan 25, 2025

As far as I understand, we have a conflict between run-mailcap's print and zsh's print.

To this end, I suggest:

  • zsh's print becomes print-zsh

  • run-mailcap's print becomes print-mailcap or mailcap-run-print

  • print becomes a disambiguation page:

# print



> Multiple commands have the name `print`.

> See also `print-zsh` and `mailcap-run-print`.



- View tldr page for zsh's print command:



`tldr print-zsh`



- View tldr page for mailcap's print alias:



`tldr run-mailcap-print`

While the last option does cleanly resolve the difference I don't think it's useful to users. The reason for this is as I described before, it is not obvious that 'print' is a zsh command.

In the interest of tldr's intent, to provide short descriptions of what something is and how to use it, I think prioritizing zsh's print as I implemented it and moving the current version to 'print-mailcap' makes the most sense.

If you use the usual 'info', 'man', and 'help' commands it brings up a better (and already quite short) documentation on how 'print' is an alias of 'mailcap-print'. Tldr provides less utility here.

I haven't tried 'info' and 'help' (except as a flag) on zsh's 'print', but could test these. The main concern I have with the proposal is again that a user trying to find information about 'print' is very likely not to know that is a 'zsh' command and would not know which documentation to look in. Another concern is that I think it's important to include the note of 'printf' being the more widely used standard for shell scripting with format strings.

The spiritual question to be asked is should tldr prioritize documentation that is comprehensive or simple.

I propose adding a short note making the user aware of there also being the mailcap command page which has been moved to a new page and adding that to the see also. I'm willing to create the pull request if others are on board.

@Managor
Copy link
Collaborator

Managor commented Jan 25, 2025

I agree with your sentiment. I have never heard of mailcap before and if someone is looking for mailcap instructions, they probably already know the difference.
Compare this to zsh where a newbie has it preinstalled and is just starting to learn the ropes

@Managor
Copy link
Collaborator

Managor commented Jan 25, 2025

I went and tested help, info and the others. None of them provided with any meaningful insight.

Copy link
Collaborator

@Managor Managor left a comment

Choose a reason for hiding this comment

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

In terms of this page, this seems to be fine. Lets push this and then make another pull that addresses the overlap. Discuss the issue in #15605

@sbrl
Copy link
Member

sbrl commented Jan 28, 2025

Note that print also exists in the windows platform.

The net effect of merging this PR is that it will not be visible to users on linux OR windows natively without e.g. specifying platform.

I don't see why we can't merge this now, but just something to keep in mind.

Copy link
Member

@sbrl sbrl left a comment

Choose a reason for hiding this comment

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

Just got a single comment.

pages/common/print.md Outdated Show resolved Hide resolved
Co-authored-by: Starbeamrainbowlabs <[email protected]>
@Managor Managor merged commit 78d0ad2 into tldr-pages:main Feb 11, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new command Issues requesting creation of a new page or PRs adding a new page for a command. review needed Prioritized PRs marked for reviews from maintainers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants