Skip to content

Commit

Permalink
Rollup merge of rust-lang#97972 - hamza1311:patch-1, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Update #[doc(html_playground_url)] documentation to mention what the request will be

The [documentation for `#![doc(html_playground_url = "_")]`](https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#html_playground_url) specifies that a request will be made to the given URL but does specify what the contents of the request will be. This PR updates the documentation to include the query parameters through which the code is provided to the playground.
  • Loading branch information
Dylan-DPC authored Jun 11, 2022
2 parents dfbedf5 + 74d210e commit 1f68d5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/doc/rustdoc/src/write-documentation/the-doc-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ on your documentation examples make requests to.
#![doc(html_playground_url = "https://playground.example.com/")]
```

Now, when you press "run", the button will make a request to this domain.
Now, when you press "run", the button will make a request to this domain. The request
URL will contain 2 query parameters: `code` and `edition` for the code in the documentation
and the Rust edition respectively.

If you don't use this attribute, there will be no run buttons.

Expand Down

0 comments on commit 1f68d5f

Please sign in to comment.