-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
359 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[book] | ||
authors = ["<unknown>"] | ||
language = "en" | ||
multilingual = false | ||
src = "src" | ||
title = "hello_world - Cairo" | ||
|
||
[output.html] | ||
no-section-label = true | ||
|
||
[output.html.playground] | ||
runnable = false | ||
|
||
[output.html.fold] | ||
enable = true | ||
level = 0 |
46 changes: 46 additions & 0 deletions
46
extensions/scarb-doc/tests/data/hello_world/src/SUMMARY.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,46 @@ | ||
# Summary | ||
|
||
# Modules | ||
|
||
- [hello_world](./hello_world.md) | ||
|
||
- [tests](./hello_world-tests.md) | ||
|
||
# Constants | ||
|
||
- [FOO](./hello_world-FOO.md) | ||
|
||
# Free functions | ||
|
||
- [main](./hello_world-main.md) | ||
|
||
- [fib](./hello_world-fib.md) | ||
|
||
- [it_works](./hello_world-tests-it_works.md) | ||
|
||
# Structs | ||
|
||
- [Circle](./hello_world-Circle.md) | ||
|
||
# Enums | ||
|
||
- [Color](./hello_world-Color.md) | ||
|
||
# Type Aliases | ||
|
||
- [Pair](./hello_world-Pair.md) | ||
|
||
# Traits | ||
|
||
- [Shape](./hello_world-Shape.md) | ||
|
||
# Impls | ||
|
||
- [CircleShape](./hello_world-CircleShape.md) | ||
|
||
- [CircleDrop](./hello_world-CircleDrop.md) | ||
|
||
- [CircleSerde](./hello_world-CircleSerde.md) | ||
|
||
- [CirclePartialEq](./hello_world-CirclePartialEq.md) | ||
|
16 changes: 16 additions & 0 deletions
16
extensions/scarb-doc/tests/data/hello_world/src/hello_world-Circle.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,16 @@ | ||
# Circle | ||
|
||
Circle struct with radius field | ||
|
||
|
||
Fully qualified path: `hello_world::Circle` | ||
|
||
## Members | ||
|
||
### radius | ||
|
||
Radius of the circle | ||
|
||
Fully qualified path: `hello_world::Circle::radius` | ||
|
||
|
8 changes: 8 additions & 0 deletions
8
extensions/scarb-doc/tests/data/hello_world/src/hello_world-CircleDrop.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,8 @@ | ||
# CircleDrop | ||
|
||
Fully qualified path: `hello_world::CircleDrop` | ||
|
||
```rust | ||
impl CircleDrop of core::traits::Drop<Circle>; | ||
``` | ||
|
19 changes: 19 additions & 0 deletions
19
extensions/scarb-doc/tests/data/hello_world/src/hello_world-CirclePartialEq.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,19 @@ | ||
# CirclePartialEq | ||
|
||
Fully qualified path: `hello_world::CirclePartialEq` | ||
|
||
```rust | ||
impl CirclePartialEq of core::traits::PartialEq<Circle> | ||
``` | ||
|
||
## Impl Functions | ||
|
||
### eq | ||
|
||
Fully qualified path: `hello_world::CirclePartialEq::eq` | ||
|
||
```rust | ||
fn eq(lhs: @Circle, rhs: @Circle) -> bool | ||
``` | ||
|
||
|
28 changes: 28 additions & 0 deletions
28
extensions/scarb-doc/tests/data/hello_world/src/hello_world-CircleSerde.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,28 @@ | ||
# CircleSerde | ||
|
||
Fully qualified path: `hello_world::CircleSerde` | ||
|
||
```rust | ||
impl CircleSerde of core::serde::Serde<Circle> | ||
``` | ||
|
||
## Impl Functions | ||
|
||
### serialize | ||
|
||
Fully qualified path: `hello_world::CircleSerde::serialize` | ||
|
||
```rust | ||
fn serialize(self: @Circle, ref output: core::array::Array<felt252>) | ||
``` | ||
|
||
|
||
### deserialize | ||
|
||
Fully qualified path: `hello_world::CircleSerde::deserialize` | ||
|
||
```rust | ||
fn deserialize(ref serialized: core::array::Span<felt252>) -> core::option::Option<Circle> | ||
``` | ||
|
||
|
53 changes: 53 additions & 0 deletions
53
extensions/scarb-doc/tests/data/hello_world/src/hello_world-CircleShape.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,53 @@ | ||
# CircleShape | ||
|
||
Implementation of the Shape trait for Circle | ||
|
||
|
||
Fully qualified path: `hello_world::CircleShape` | ||
|
||
```rust | ||
impl CircleShape of Shape<Circle> | ||
``` | ||
|
||
## Impl Constants | ||
|
||
### SHAPE_CONST | ||
|
||
Shape constant | ||
|
||
|
||
Fully qualified path: `hello_world::CircleShape::SHAPE_CONST` | ||
|
||
```rust | ||
const SHAPE_CONST: felt252 = 'xyz'; | ||
``` | ||
|
||
|
||
## Impl Functions | ||
|
||
### area | ||
|
||
Implementation of the area method for Circle | ||
|
||
|
||
Fully qualified path: `hello_world::CircleShape::area` | ||
|
||
```rust | ||
fn area(self: Circle) -> u32 | ||
``` | ||
|
||
|
||
## Impl Types | ||
|
||
### ShapePair | ||
|
||
Type alias for a pair of circles | ||
|
||
|
||
Fully qualified path: `hello_world::CircleShape::ShapePair` | ||
|
||
```rust | ||
type ShapePair = (Circle, Circle); | ||
``` | ||
|
||
|
30 changes: 30 additions & 0 deletions
30
extensions/scarb-doc/tests/data/hello_world/src/hello_world-Color.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,30 @@ | ||
# Color | ||
|
||
Color enum with Red, Green, and Blue variants | ||
|
||
|
||
Fully qualified path: `hello_world::Color` | ||
|
||
## Variants | ||
|
||
### Red | ||
|
||
Red color | ||
|
||
Fully qualified path: `hello_world::Color::Red` | ||
|
||
|
||
### Green | ||
|
||
Green color | ||
|
||
Fully qualified path: `hello_world::Color::Green` | ||
|
||
|
||
### Blue | ||
|
||
Blue color | ||
|
||
Fully qualified path: `hello_world::Color::Blue` | ||
|
||
|
11 changes: 11 additions & 0 deletions
11
extensions/scarb-doc/tests/data/hello_world/src/hello_world-FOO.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,11 @@ | ||
# FOO | ||
|
||
FOO constant with value 42 | ||
|
||
|
||
Fully qualified path: `hello_world::FOO` | ||
|
||
```rust | ||
const FOO: u32 = 42; | ||
``` | ||
|
11 changes: 11 additions & 0 deletions
11
extensions/scarb-doc/tests/data/hello_world/src/hello_world-Pair.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,11 @@ | ||
# Pair | ||
|
||
Pair type alias for a tuple of two u32 values | ||
|
||
|
||
Fully qualified path: `hello_world::Pair` | ||
|
||
```rust | ||
type Pair = (u32, u32); | ||
``` | ||
|
45 changes: 45 additions & 0 deletions
45
extensions/scarb-doc/tests/data/hello_world/src/hello_world-Shape.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,45 @@ | ||
# Shape | ||
|
||
Shape trait for objects that have an area | ||
|
||
|
||
Fully qualified path: `hello_world::Shape` | ||
|
||
```rust | ||
trait Shape<T> | ||
``` | ||
|
||
## Trait Constants | ||
|
||
### SHAPE_CONST | ||
|
||
Constant for the shape type | ||
|
||
|
||
Fully qualified path: `hello_world::Shape::SHAPE_CONST` | ||
|
||
|
||
## Trait Functions | ||
|
||
### area | ||
|
||
Calculate the area of the shape | ||
|
||
|
||
Fully qualified path: `Shape::area` | ||
|
||
```rust | ||
fn area(self: T) -> u32 | ||
``` | ||
|
||
|
||
## Trait Types | ||
|
||
### ShapePair | ||
|
||
Type alias for a pair of shapes | ||
|
||
|
||
Fully qualified path: `hello_world::Shape::ShapePair` | ||
|
||
|
14 changes: 14 additions & 0 deletions
14
extensions/scarb-doc/tests/data/hello_world/src/hello_world-fib.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,14 @@ | ||
# fib | ||
|
||
Calculate the nth Fibonacci number | ||
|
||
# Arguments | ||
* `n` - The index of the Fibonacci number to calculate | ||
|
||
|
||
Fully qualified path: `hello_world::fib` | ||
|
||
```rust | ||
fn fib(mut n: u32) -> u32 | ||
``` | ||
|
12 changes: 12 additions & 0 deletions
12
extensions/scarb-doc/tests/data/hello_world/src/hello_world-main.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,12 @@ | ||
# main | ||
|
||
Fibonacci sequence calculator | ||
Main function that calculates the 16th Fibonacci number | ||
|
||
|
||
Fully qualified path: `hello_world::main` | ||
|
||
```rust | ||
fn main() -> u32 | ||
``` | ||
|
12 changes: 12 additions & 0 deletions
12
extensions/scarb-doc/tests/data/hello_world/src/hello_world.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,12 @@ | ||
# it_works | ||
|
||
Really | ||
works. | ||
|
||
|
||
Fully qualified path: `hello_world::tests::it_works` | ||
|
||
```rust | ||
fn it_works() | ||
``` | ||
|
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