29 Commits

Author SHA1 Message Date
Charlie Marsh
1cd80139af Add a guide for using uv with FastAPI (#6401) 2024-08-23 02:09:46 +00:00
Zanie Blue
7742e060d2 Add link to benchmarks in documentation (#6257) 2024-08-20 12:54:46 -04:00
Zanie Blue
ded7300455 Disable collapsible navigation in the documentation (#5674)
Removes the collapsible sections in favor of larger font navigation
headings. I found the bold to be too distracting from the content itself
— it might be okay in the future if the navigation bar is further left.

Before:

<img width="1356" alt="Screenshot 2024-08-16 at 6 03 57 PM"
src="https://github.com/user-attachments/assets/75e49216-dc0d-4d26-a0d8-0283c29f9b81">

After:

<img width="1324" alt="Screenshot 2024-08-16 at 6 05 36 PM"
src="https://github.com/user-attachments/assets/cbce96ce-0969-46c5-80b6-e163481b8bfa">

(No change to the mobile view)

<img width="823" alt="Screenshot 2024-08-16 at 6 05 03 PM"
src="https://github.com/user-attachments/assets/b450e413-d5a4-4d2d-9905-e8eb6ac6f546">
<img width="823" alt="Screenshot 2024-08-16 at 6 05 13 PM"
src="https://github.com/user-attachments/assets/bd251ea0-58d8-456e-bdc8-4e3699061e6c">
2024-08-16 18:09:21 -05:00
Zanie Blue
f28ce546cf Move anchors validation to only the public mkdocs config (#6099)
See https://github.com/astral-sh/uv/pull/6096#issuecomment-2290151150
2024-08-14 19:37:25 -05:00
Mathieu Kniewallner
85be33d719 docs: use stricter validation options (#6096)
## Summary

`mkdocs` supports [validation rules for
links](https://www.mkdocs.org/user-guide/configuration/#validation),
which can be tightened to report more issues than the default
configuration. I used the recommended "maximal strictness" configuration
from the documentation.

Adding the `anchors` rule helped spot 4 errors:
```console
WARNING -  Doc file 'guides/install-python.md' contains a link '../concepts/python-versions.md#python-distributions', but the doc 'concepts/python-versions.md' does not contain an anchor '#python-distributions'.
WARNING -  Doc file 'guides/install-python.md' contains a link '../concepts/python-versions.md#discovery-order', but the doc 'concepts/python-versions.md' does not contain an anchor '#discovery-order'.
WARNING -  Doc file 'guides/projects.md' contains a link '../concepts/projects.md#lock-file', but the doc 'concepts/projects.md' does not contain an anchor '#lock-file'.
WARNING -  Doc file 'pip/environments.md' contains a link '../concepts/python-versions.md#discovery-order', but the doc 'concepts/python-versions.md' does not contain an anchor '#discovery-order'.
```

## Test Plan

Local run of the documentation + `mkdocs build --strict`.
2024-08-14 19:27:22 -05:00
Zanie Blue
d20314038f Move help documentation into dedicated page (#6057) 2024-08-13 11:09:32 -05:00
Zanie Blue
db0b44b88c Move some documents to relevant sections (#5968) 2024-08-09 17:31:10 +00:00
Zanie Blue
f08cd2b9dc Add a guide for publishing packages (#5794)
Closes https://github.com/astral-sh/uv/issues/5793
2024-08-05 16:12:37 -05:00
Zanie Blue
865f9eeef7 Collapse policies section into reference (#5696) 2024-08-05 17:44:26 +00:00
konsti
6e310f2702 Rewrite resolver docs (#5723)
This PR rewrites the resolver concept and adds a resolver internals page
targeted at power users.

The new resolution concept documentation has three parts:
* An introduction for people how never heard of "resolution" before, and
a motivating example what it does. I've also shoved the part about
equally valid resolutions in there.
* Features you commonly use: Non-universal vs. universal resolution,
lowest resolution amd pre-releases.
* Expert features, we don't advertise them, you'll only need them in
complex cases when you already know and i kept them to the reference
points you need in this case: Constraints, overrides and exclude-newer.

I intentionally didn't lay out any detail of the resolution itself, the
idea is that users get a vague sense of "uv has to select fitting
versions", but then they learn the options they have to use and some
common failure points without ever coming near SAT or even graphs.

The resolution internals reference page is targeted at power users who
need to understand what is going on behind the scenes. It assumes ample
prior knowledge and exists to explain the uv-specific behaviors for
someone who already understands dependency resolution conceptually and
has interacted with their dependency tree before. I had a section on the
lockfile but removed it because it found the lockfile to be too
self-documenting.

I haven't touched the readme.

Closes #5603
Closes #5238
Closes #5237

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-03 08:47:11 -05:00
Zanie Blue
44a6dbfa53 Improvements to the documentation (#5718) 2024-08-03 08:41:33 -05:00
Zanie Blue
64c6caa57b Fixup settings reference (#5694)
Fixes #5689
2024-08-01 16:41:26 +00:00
Zanie Blue
0f30c69624 Move settings reference to reference section (#5689)
Joining #5685 in a dedicated reference section
2024-08-01 16:20:30 +00:00
Zanie Blue
f107406727 Generate CLI reference for documentation (#5685)
Loosely based on [Cargo's
format](https://github.com/rust-lang/cargo/blob/master/src/doc/src/commands/cargo-build.md)

<img width="896" alt="Screenshot 2024-08-01 at 9 44 03 AM"
src="https://github.com/user-attachments/assets/7c016bb3-2b54-46af-8ea8-ce82e07a0e30">

Future work includes:

- Grouping options
- Enforcing some sort of specific command ordering
- Showing possible values for enums
- Adding "long_about" to commands for more context
2024-08-01 16:04:16 +00:00
Zanie Blue
ed520580a1 Remove breadcrumbs for navigation (#5676)
Closes https://github.com/astral-sh/uv/issues/5671

These are effectively worthless since it never displays more than one
level.
2024-07-31 17:10:31 -05:00
Zanie Blue
9e4fbd2111 Move pip-compatibility doc into pip interface section (#5670) 2024-07-31 20:30:10 +00:00
eth3lbert
89947681d1 Improve copy of console command examples (#5397)
## Summary

This PR improves the copy of the console command example by:

- Preventing the selection of generic prompts and generic output
- Lazily setting copy content by leveraging intersection observer

Most of the changes are inspired by
https://github.com/opensafely/documentation/pull/1461

Some other useful refs:
- https://github.com/squidfunk/mkdocs-material/issues/3647
-
https://mkdocstrings.github.io/recipes/#prevent-selection-of-prompts-and-output-in-python-code-blocks

Resolves #5355

## Test Plan

- 
  ``` shell-session
  mkdocs serve -f mkdocs.public.yml
  ``` 
- Navigate to http://localhost:8000/uv/first-steps/#viewing-the-version
- Try clicking the copy button
- Try copying by selecting the content

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-07-31 14:52:02 +00:00
Zanie Blue
5830a532ef Add links to documentation footer (#5616) 2024-07-30 12:42:17 -05:00
Zanie Blue
6eb8f85668 Update documentation sections (#5452)
Reframes "the low-level interface" as "the pip interface"
Adds indexes to all sections
Renames "commercial indexes" to "alternative indexes"
2024-07-25 12:37:22 -05:00
Zanie Blue
3581e27cdf Bundle of docs changes (#5426) 2024-07-24 17:10:33 -05:00
Zanie Blue
ac81036aa9 Use logo in documentation (#5421)
Before
<img width="728" alt="Screenshot 2024-07-24 at 3 12 28 PM"
src="https://github.com/user-attachments/assets/2ad83857-a2a5-4c33-9fb2-f2580ccb10af">

After
<img width="728" alt="Screenshot 2024-07-24 at 3 11 07 PM"
src="https://github.com/user-attachments/assets/dd209d37-3761-4b28-8ca9-9bf7546236a8">

Alternatively
<img width="728" alt="Screenshot 2024-07-24 at 3 10 45 PM"
src="https://github.com/user-attachments/assets/88f9cc62-71ec-457c-b946-3168502d46c3">
2024-07-24 15:45:10 -05:00
Zanie Blue
dac696e950 Bundle of documentation changes (#5307)
Following #5239
2024-07-23 13:29:59 -05:00
Zanie Blue
6492f1a897 A bundle of documentation changes (#5239)
I just need to iterate on everything and we're not doing a lot of
reviews anyway.

Closes #5234 
Closes #5191
2024-07-22 17:15:11 +00:00
Zanie Blue
583a6e57f2 Write tools concept doc (#5207) 2024-07-19 14:24:43 -05:00
Zanie Blue
61a81da760 Move integration guide docs and edit Azure integration guide (#5117) 2024-07-18 03:47:32 +00:00
Zanie Blue
177bbaa8c0 Add stubs for the project documentation (#5135)
@ibraheemdev is going to do some work on these, I just sketched out some
parts to try to understand how things will fit together.
2024-07-16 17:02:54 -05:00
Zanie Blue
21cda3e079 Separate the TOC from the navigation bar (#5128)
Starting a discussion.

I find the navigation bar too long and verbose, it's overwhelming. I
think we either need to either:

- Limit the depth of the navigation bar (i.e. via `toc_depth: 2`)
- Move the table of contents out of the navigation bar over to the right
side

I prefer the second, though I think we ought to do some styling to
improve the aesthetics.
2024-07-16 16:11:35 -05:00
Charlie Marsh
545bbf9286 Add settings.md to docs (#5091)
## Summary

It's kinda messed up: the depths are off, and the titles are incorrectly
uppercased, but I'll fix those tomorrow.

![Screenshot 2024-07-15 at 10 38
50 PM](https://github.com/user-attachments/assets/3aabae67-4d6b-40e1-9523-2d4d1b7006b4)
2024-07-16 02:46:21 +00:00
Charlie Marsh
e61a221fef Migrate from MdBook to MkDocs (#5062)
## Summary

We want to have consistency between the Ruff and uv documentation for
the upcoming release. We don't love the Ruff docs, but we'd rather have
consistency and then work towards improving them both, rather than have
two very-different documentation sites that both have weaknesses.

The setup here is simpler than in Ruff as: (1) we don't yet generate any
docs from Rust and (2) we don't try to reuse the README in the uv
documentation (which adds a lot of complexity in Ruff). So the change
here is mostly a 1-to-1 port to MkDocs.

## Test Plan

![Screenshot 2024-07-14 at 9 49
15 PM](https://github.com/user-attachments/assets/8bfb5b06-08ff-4329-b368-d9087b78996e)
2024-07-15 22:22:07 +00:00