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

Improvements to API Docs #7292

Merged
merged 10 commits into from Feb 5, 2024
Merged

Improvements to API Docs #7292

merged 10 commits into from Feb 5, 2024

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Feb 2, 2024

Some small improvements to the API docs as I start to look at the clients.

Closes: #2569
Closes: #6055

Here's how it looks locally:

image

Here's how it looks on Spaces (note that we now use Space ID instead of the ugly replica URL):

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Feb 2, 2024

🪼 branch checks and previews

Name Status URL
Spaces building...
Website building...
Storybook ready! Storybook preview
🦄 Changes detected! Details

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Feb 2, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/app patch
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Improvements to API Docs

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

</div>
<div class="docs-wrap">
<div class="client-doc">
<p>
Use the <a
href="https://gradio.app/docs/#python-client"
Copy link
Member Author

Choose a reason for hiding this comment

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

These links were broken but it was never reported because I don't think anyone realized that they were links in the first place. The styling does not make it very clear its a link.

@@ -183,11 +186,25 @@
</li>
{/each}
</div>

<p class="padded">
1. Install the client if you don't already have it installed.
Copy link
Member Author

Choose a reason for hiding this comment

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

I think explicitly numbering the steps makes it more inviting to users.

@abidlabs abidlabs added the v: patch A change that requires a patch release label Feb 2, 2024
Copy link
Collaborator

@aliabd aliabd left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes @abidlabs lgtm, made one comment

text-decoration: underline;
}

p.padded {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The font sizes are really off:

Screen Shot 2024-02-05 at 11 38 17 AM

The text looks really small. and the code snippets for the libraries are too large with too much padding on the bottom. it's weird.

I suggest adding:

p {
		font-size: var(--text-lg);
	}

and modifying the .library css to be

.library {
		border: 1px solid var(--border-color-accent);
		border-radius: var(--radius-sm);
		background: var(--color-accent-soft);
		padding: var(--size-1);
		color: var(--color-accent);
		font-size: var(--text-md);
	}

looks much better:

Screen Shot 2024-02-05 at 11 45 28 AM

@aliabd
Copy link
Collaborator

aliabd commented Feb 5, 2024

Sorry @abidlabs not sure why you didn't include the spaces screenshot in the description, but noticed an issue (tested here using wheel from latest commit)

Screen Shot 2024-02-05 at 12 10 31 PM

You need to also change {root} to {space_id || root} somewhere in CodeSnippets.svelte

@abidlabs
Copy link
Member Author

abidlabs commented Feb 5, 2024

Ah nice @aliabd thanks for catching both of those issues. Will fix soon

@abidlabs
Copy link
Member Author

abidlabs commented Feb 5, 2024

Thanks again @aliabd!

@abidlabs abidlabs merged commit aa97a5e into main Feb 5, 2024
8 checks passed
@abidlabs abidlabs deleted the api-docs branch February 5, 2024 18:29
@pngwn pngwn mentioned this pull request Feb 5, 2024
freddyaboulton pushed a commit that referenced this pull request Feb 9, 2024
* escape triple quotes when creating space.py for custom components

* Improve API docs

* add changeset

* revert

* fix

* changes

* add changeset

* fixes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v: patch A change that requires a patch release
Projects
None yet
3 participants