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

Docs Revamp: new "Repositories" page for hub-docs #92

Merged
merged 13 commits into from
Apr 18, 2022

Conversation

NimaBoscarino
Copy link
Contributor

This is part of the process of revamping the documentation (#62) + Docs Proposal

This PR contains the first version of the "Repositories" documentation for the Hugging Face Hub, which aims to give readers a introduction to how repos are used in the Hub (for models, datasets, and Spaces) and shows how to get started with cloning, committing, pushing, and more. In-depth git tutorials are offloaded to third-party content. Information in this doc is split into "Getting started", "Best practices", and "Next steps", each covering increasingly complex or niche features.

Note that at the moment everything is contained within a single page, but I think this is a prime candidate for nested pages. Since (as far as I know) Moon Landing doesn't support nested pages for these docs yet, I was thinking that this could start as a single page, then nesting pages could be implemented in Moon Landing, and then this page could be split (probably with each Heading 2 being a separate page). Or the Heading-level split could actually be handled by Moon Landing!

Also note that links to non-existing sections are marked as TODO, and will be patched in a future PR before the revamp release.

@NimaBoscarino NimaBoscarino changed the base branch from main to docs-revamp April 7, 2022 22:03
@NimaBoscarino NimaBoscarino changed the title Docs Revamp: new "Main" page for hub-docs Docs Revamp: new "Repositories" page for hub-docs Apr 7, 2022
@osanseviero
Copy link
Contributor

Note that at the moment everything is contained within a single page, but I think this is a prime candidate for nested pages. Since (as far as I know) Moon Landing doesn't support nested pages for these docs yet, I was thinking that this could start as a single page, then nesting pages could be implemented in Moon Landing, and then this page could be split (probably with each Heading 2 being a separate page). Or the Heading-level split could actually be handled by Moon Landing!

What we could do for now while developing is:

  • in /repositories.md, just have something like a Table of Contents. In a follow up PR, from moon landing most likely, we can do some fancy design for it.
  • and then have a different .md for each of the pages. This won't be in the sections.yml but it will be linked from repositories, so it should be fine. They would still render.

cc @gary149 about this since we'll have to change some UX code for the docs as we were discussing

@julien-c
Copy link
Member

julien-c commented Apr 8, 2022

in my opinion you can already split into nested pages.

the changes required in moon-landing to support this should be super simple, i can do it early next week at the same time (or before) we merge this

Copy link
Contributor

@osanseviero osanseviero left a comment

Choose a reason for hiding this comment

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

This is awesome content, thank you! 🚀 🚀 🚀

Comment on lines 21 to 26
To be able to push your code to the Hub, you'll need to authenticate somehow. The easiest way to do this is by installing the [`huggingface_hub` CLI](https://huggingface.co/docs/huggingface_hub/index) and running the login command:

```bash
python -m pip install huggingface_hub
huggingface-cli login
```
Copy link
Contributor

Choose a reason for hiding this comment

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

This will only be required for people that want to do things locally 🤔

For the requirements, instead of having a global "requirements" section, I was wondering if they should be the step 0 for each of the subpages. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The subpages that I'm splitting this into are Getting Started, Best Practices, and Next Steps. Would I put this in all 3 sections? I figure that if someone's looking at doing something in the "Best Practices", they would look in "Getting Started" to make sure they'd have the requirements all set.

Or do you think the subpages should be even more granular? e.g. Getting Started > Creating a repo, Getting Started > Cloning repos, etc.

### How to use branches

To effectively use Git repos collaboratively and to work on features without releasing premature code you can use **branches**. Branches allow you to separate your "work in progress" code from your "production-ready" code, with the additional benefit of letting multiple people work on a project without frequently conflicting with each others' contributions. To learn about Git branching, you can try out the [Learn Git Branching interactive tutorial](https://learngitbranching.js.org/).

Copy link
Contributor

Choose a reason for hiding this comment

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

Would be cool to have an image here. Maybe @Bibi-O or @gary149 can help creating an illustration for branches.

Splitting a large paragraph into two for easier legibility.

Co-authored-by: Omar Sanseviero <[email protected]>
Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Good intro to repositories! 👍

@NimaBoscarino
Copy link
Contributor Author

To handle nested pages for the moment I did it with @osanseviero's suggestion of having a table of contents and linking to the pages. I also put the pages into a repositories directory for the moment, but I can adjust it to whichever format would work best for moon-landing, @julien-c ! Any thoughts?

Also, I've applied almost all the feedback (except for moving the images, WIP), so I think this is ready for another round of reviews 😄

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

The new imgs with the lfs icon look nice! Just a few more minor nits, but otherwise looks good to me 👍

Copy link
Contributor

@osanseviero osanseviero left a comment

Choose a reason for hiding this comment

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

This looks great to me! Thanks for the PR! 🚀 🚀

Feel free to merge once all comments are addressed. In terms of format, we can always do follow-up PRs to modify once the design decisions are final


<h1>Best practices with repositories</h1>

Here are some additional best practices to help you get the most out of your repository.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add a section named "Handling multiple experiments" with a large TODO? (I can help with that in a follow-up PR from my side)

I think we can add things from huggingface/huggingface_hub#769 and specially from #53

- Other users who visit the URL of your private repo will receive a `404 - Repo not found` error.
- Other users will not be able to clone your repo.

## Security for repositories
Copy link
Contributor

Choose a reason for hiding this comment

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

Not 100% sure if this is important for the best practices doc. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm down to remove it, personally! People can always refer to the security docs for info about this stuff.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I agree

@@ -0,0 +1,27 @@
---
title: Getting Started with Repositories
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice section!


### Duplicating without Git history

In many scenarios, if you want your own copy of a particular codebase you might not be concerned about the previous Git history. In this case, you can quickly duplicate a repo with the handy [Repo Duplicator](https://huggingface.co/spaces/osanseviero/repo_duplicator)! You'll have to create a User Access Token, which you can read more about in the [security documentation](TODO).
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!



## How to programmatically manage repositories

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice reference to huggingface_hub

Add TODO for handling multiple experiments
@NimaBoscarino NimaBoscarino merged commit 239527a into docs-revamp Apr 18, 2022
@NimaBoscarino NimaBoscarino deleted the revamp/repositories branch April 18, 2022 17:30
NimaBoscarino added a commit that referenced this pull request Apr 18, 2022
Add a "Repositories" page with several subpages, outlining how repos
are used on the hub, and best practices for creating and maintaining them.

Some content remains WIP.

Co-authored-by: Omar Sanseviero <[email protected]>
Co-authored-by: Steven Liu <[email protected]>
osanseviero added a commit that referenced this pull request Apr 22, 2022
Add a "Repositories" page with several subpages, outlining how repos
are used on the hub, and best practices for creating and maintaining them.

Some content remains WIP.

Co-authored-by: Omar Sanseviero <[email protected]>
Co-authored-by: Steven Liu <[email protected]>
NimaBoscarino added a commit that referenced this pull request May 11, 2022
Add a "Repositories" page with several subpages, outlining how repos
are used on the hub, and best practices for creating and maintaining them.

Some content remains WIP.

Co-authored-by: Omar Sanseviero <[email protected]>
Co-authored-by: Steven Liu <[email protected]>
NimaBoscarino added a commit that referenced this pull request May 15, 2022
Add a "Repositories" page with several subpages, outlining how repos
are used on the hub, and best practices for creating and maintaining them.

Some content remains WIP.

Co-authored-by: Omar Sanseviero <[email protected]>
Co-authored-by: Steven Liu <[email protected]>
NimaBoscarino added a commit that referenced this pull request May 20, 2022
Add a "Repositories" page with several subpages, outlining how repos
are used on the hub, and best practices for creating and maintaining them.

Some content remains WIP.

Co-authored-by: Omar Sanseviero <[email protected]>
Co-authored-by: Steven Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants