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

Document difference between folders #2813

Closed
aaronjanse opened this issue Feb 28, 2019 · 13 comments · Fixed by #12314
Closed

Document difference between folders #2813

aaronjanse opened this issue Feb 28, 2019 · 13 comments · Fixed by #12314
Labels
architecture Organization of the pages per language, platform, etc. documentation Issues/PRs modifying the documentation.

Comments

@aaronjanse
Copy link
Contributor

We could put a README.md in linux, common, osx, etc, to document what each folder is intended to contain.

#2808 (comment)

@waldyrious waldyrious added documentation Issues/PRs modifying the documentation. architecture Organization of the pages per language, platform, etc. labels Feb 28, 2019
@waldyrious
Copy link
Member

It may be more appropriate to have the information in CONTRIBUTING.md, especially since one would have to scroll down quite a bit to get to the readmes in those folders, which typically have lots of files.

@aaronjanse
Copy link
Contributor Author

How about this as a starting place for file placement recommendations:

  1. If a command is shared between two or more of windows, linux, osx, and sunos, put the file in the commons folder (duplication is hard to maintain). If not, the file goes in the relevant folder (is which folder self-explanatory?)
  2. If an OS has a command with the same name as one correctly placed in the common folder, the OS-specific folder should have a file "overriding" the command in the commons folder.
folder examples
common echo, whoami-unix, zip
linux distro package managers, tlp
sunos svcadm, svcs
windows choco, reg, whoami-windows

Is there a reason that the commons folder shouldn't be named "unix"? I can't think of any command shared between osx/linux/sunos and windows.

@agnivade
Copy link
Member

agnivade commented Mar 1, 2019

  1. If an OS has a command with the same name as one correctly placed in the common folder, the OS-specific folder should have a file "overriding" the command in the commons folder.

Yeah, but we don't need to rename the file to append the platform name. It is the job of the client to figure this out. In your example, the filename will be whoami.md in both common and windows folder.

Is there a reason that the commons folder shouldn't be named "unix"? I can't think of any command shared between osx/linux/sunos and windows.

Most(if not all) Python, Ruby, Node.js commands are shared between all platforms.

@aaronjanse
Copy link
Contributor Author

aaronjanse commented Mar 1, 2019 via email

@sbrl
Copy link
Member

sbrl commented Mar 1, 2019

As far as I'm aware, things in the common/ folder should work on all defined platforms. If not, then we currently make a copy of a page in the folders for the platforms it does support. Symbolic links have been suggested before in #787, but I'm unsure how far we got with that. I think there's a bug in the reference node client. It's certainly something we should consider for the client spec in #2706.

@aaronjanse
Copy link
Contributor Author

aaronjanse commented Mar 1, 2019 via email

@agnivade
Copy link
Member

agnivade commented Mar 1, 2019

As far as I'm aware, things in the common/ folder should work on all defined platforms. If not, then we currently make a copy of a page in the folders for the platforms it does support.

Yeah, I thought that too. But @waldyrious had a different thinking. And I think it's easier to just keep a page in common even if it does not work in windows, rather than making copies.

Is there a reason we don't want to use a tag-based system, where the header of a file specifies which operating systems it works on?

It's too late to change the core architecture now. All the clients look into folders for a specific platform. Let us just document the intended functionality and move on.

@sbrl
Copy link
Member

sbrl commented Mar 2, 2019

Hrm. What happened with thee symlink idea? I think they should Just Work™ on Windows, but I don't have a Windows machine to test on.

@aaronjanse
Copy link
Contributor Author

Perhaps each folder has a copy of a given command and a bot reminds contributers if a PR modifies only one of a set of files got a command?

Someone could then decide if it is intentional (i.e. the command should be have differently on different operating systems) or if a commit should be made manually to update the other pages before merging.

@sbrl
Copy link
Member

sbrl commented Mar 6, 2019

Sounds like a good idea, @aaronduino! Maybe a message like this:

Hey! I've detected that there's another copy of the page for this command in {{platform}}.

It may need updating too.

We've actually got a bot that posts messages about linting errors over in https://github.com/tldr-pages/tldr-bot. Would you like to open a PR to add the functionality there?

@aaronjanse
Copy link
Contributor Author

Thanks, I'll open a PR when I get home, unless someone else wants to do so sooner.

@aaronjanse
Copy link
Contributor Author

Thanks, I'll open a PR when I get home, unless someone else wants to do so sooner.

Turns out I didn't end up doing something. I'm busy; if someone else is willing to make the PR, please do.

@sbrl
Copy link
Member

sbrl commented Jun 18, 2019

An update: We now have a client spec that documents some of this, which is worth a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Organization of the pages per language, platform, etc. documentation Issues/PRs modifying the documentation.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants