-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Add a test for rendering the markdown with linked type in th…
…e signature. Reviewed By: JakobDegen Differential Revision: D65180323 fbshipit-source-id: 99d314b375493d517d055c9972cd32ad2a70b713
- Loading branch information
1 parent
033a352
commit cc11a3f
Showing
8 changed files
with
204 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,14 @@ | |
|
||
# submod | ||
|
||
## new\_obj | ||
|
||
```python | ||
def new_obj() -> obj | ||
``` | ||
|
||
--- | ||
|
||
## notypes | ||
|
||
```python | ||
|
23 changes: 23 additions & 0 deletions
23
starlark/src/docs/tests/golden/multipage_linked_type/Magic.golden.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# @generated | ||
# To regenerate, run: | ||
# ``` | ||
# STARLARK_RUST_REGENERATE_GOLDEN_TESTS=1 cargo test -p starlark --lib | ||
# ``` | ||
|
||
# Magic | ||
|
||
<pre class="language-python"><code>def Magic(a1: int, a2: int = ..., step: int = 1, /) -> str</code></pre> | ||
|
||
A function with only positional arguments. | ||
|
||
And a slightly longer description. With some example code: | ||
|
||
```python | ||
Magic(1) | ||
``` | ||
|
||
And some assertions: | ||
|
||
```rust | ||
1 == 1 | ||
``` |
52 changes: 52 additions & 0 deletions
52
starlark/src/docs/tests/golden/multipage_linked_type/Obj.golden.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# @generated | ||
# To regenerate, run: | ||
# ``` | ||
# STARLARK_RUST_REGENERATE_GOLDEN_TESTS=1 cargo test -p starlark --lib | ||
# ``` | ||
|
||
# Obj | ||
|
||
These are where the module docs go | ||
|
||
## Obj.\_\_exported\_\_ | ||
|
||
<pre class="language-python"><code>def Obj.__exported__() -> None</code></pre> | ||
|
||
Needs to be escaped when rendered in markdown. | ||
|
||
--- | ||
|
||
## Obj.attr1 | ||
|
||
<pre class="language-python"><code>Obj.attr1: str</code></pre> | ||
|
||
Docs for attr1 | ||
|
||
--- | ||
|
||
## Obj.attr2 | ||
|
||
<pre class="language-python"><code>Obj.attr2: str</code></pre> | ||
|
||
--- | ||
|
||
## Obj.func1 | ||
|
||
<pre class="language-python"><code>def Obj.func1(foo: str) -> str</code></pre> | ||
|
||
Docs for func1 | ||
|
||
#### Parameters | ||
|
||
* `foo`: Docs for foo | ||
|
||
|
||
#### Returns | ||
|
||
The string 'func1' | ||
|
||
--- | ||
|
||
## Obj.func2 | ||
|
||
<pre class="language-python"><code>def Obj.func2() -> str</code></pre> |
56 changes: 56 additions & 0 deletions
56
starlark/src/docs/tests/golden/multipage_linked_type/globals.golden.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# @generated | ||
# To regenerate, run: | ||
# ``` | ||
# STARLARK_RUST_REGENERATE_GOLDEN_TESTS=1 cargo test -p starlark --lib | ||
# ``` | ||
|
||
# globals | ||
|
||
## MAGIC | ||
|
||
<pre class="language-python"><code>MAGIC: int</code></pre> | ||
|
||
--- | ||
|
||
## func1 | ||
|
||
<pre class="language-python"><code>def func1(foo: str) -> str</code></pre> | ||
|
||
Docs for func1 | ||
|
||
#### Parameters | ||
|
||
* `foo`: Docs for foo | ||
|
||
|
||
#### Returns | ||
|
||
The string 'func1' | ||
|
||
--- | ||
|
||
## func2 | ||
|
||
<pre class="language-python"><code>def func2() -> str</code></pre> | ||
|
||
--- | ||
|
||
## pos\_either\_named | ||
|
||
<pre class="language-python"><code>def pos_either_named( | ||
a: int, | ||
/, | ||
b: int, | ||
*, | ||
c: int, | ||
) -> <a href="/path/to/Magic">magic</a></code></pre> | ||
|
||
--- | ||
|
||
## with\_defaults | ||
|
||
<pre class="language-python"><code>def with_defaults( | ||
explicit_default: list[str] = [], | ||
hidden_default: list[str] = ..., | ||
string_default: str = "my_default", | ||
) -> None</code></pre> |
29 changes: 29 additions & 0 deletions
29
starlark/src/docs/tests/golden/multipage_linked_type/submod.golden.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# @generated | ||
# To regenerate, run: | ||
# ``` | ||
# STARLARK_RUST_REGENERATE_GOLDEN_TESTS=1 cargo test -p starlark --lib | ||
# ``` | ||
|
||
# submod | ||
|
||
## new\_obj | ||
|
||
<pre class="language-python"><code>def new_obj() -> <a href="/path/to/Obj">obj</a></code></pre> | ||
|
||
--- | ||
|
||
## notypes | ||
|
||
<pre class="language-python"><code>def notypes(a)</code></pre> | ||
|
||
--- | ||
|
||
## starlark\_args | ||
|
||
<pre class="language-python"><code>def starlark_args(*args: str) -> None</code></pre> | ||
|
||
--- | ||
|
||
## starlark\_kwargs | ||
|
||
<pre class="language-python"><code>def starlark_kwargs(**kwargs: int) -> None</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters