Skip to content

Commit 0c65e9c

Browse files
Add a link to migrating docs to home (#1389)
### What Add a link to migrating docs to the home page in the docs, and update other parts of the home page docs. <img width="738" alt="Screenshot 2024-11-06 at 10 47 05 PM" src="https://github.com/user-attachments/assets/77176926-385d-419a-ae24-c229a6ca35e9"> ### Why So that the migrating docs are easily discovered by anyone browsing the Rust docs. To make it current.
1 parent 8e7e0dd commit 0c65e9c

File tree

3 files changed

+37
-19
lines changed

3 files changed

+37
-19
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ build-fuzz:
2727

2828
readme:
2929
cd soroban-sdk \
30-
&& cargo +nightly rustdoc -- -Zunstable-options -wjson \
30+
&& cargo +nightly rustdoc --features testutils -- -Zunstable-options -wjson \
3131
&& cat ../target/doc/soroban_sdk.json \
3232
| jq -r '.index[.root|tostring].docs' \
3333
> README.md

soroban-sdk/README.md

+18-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
Soroban SDK supports writing programs for the Soroban smart contract
2-
platform.
1+
Soroban SDK supports writing smart contracts for the Wasm-powered [Soroban] smart contract
2+
runtime, deployed on [Stellar].
33

44
### Docs
55

6-
See [soroban.stellar.org](https://soroban.stellar.org) for documentation.
6+
See [developers.stellar.org] for documentation about building smart contracts for [Stellar].
7+
8+
[developers.stellar.org]: https://developers.stellar.org
9+
[Stellar]: https://stellar.org
10+
[Soroban]: https://stellar.org/soroban
11+
12+
### Migrating Major Versions
13+
14+
See [_migrating] for a summary of how to migrate from one major version to another.
715

816
### Examples
917

1018
```rust
1119
use soroban_sdk::{contract, contractimpl, vec, symbol_short, BytesN, Env, Symbol, Vec};
1220

1321
#[contract]
14-
pub struct HelloContract;
22+
pub struct Contract;
1523

1624
#[contractimpl]
17-
impl HelloContract {
25+
impl Contract {
1826
pub fn hello(env: Env, to: Symbol) -> Vec<Symbol> {
1927
vec![&env, symbol_short!("Hello"), to]
2028
}
@@ -26,8 +34,8 @@ fn test() {
2634
# #[cfg(feature = "testutils")]
2735
# fn main() {
2836
let env = Env::default();
29-
let contract_id = env.register(HelloContract, ());
30-
let client = HelloContractClient::new(&env, &contract_id);
37+
let contract_id = env.register(Contract, ());
38+
let client = ContractClient::new(&env, &contract_id);
3139

3240
let words = client.hello(&symbol_short!("Dev"));
3341

@@ -37,5 +45,6 @@ fn test() {
3745
# fn main() { }
3846
```
3947

40-
More examples are available at <https://soroban.stellar.org/docs/category/basic-tutorials>
41-
and <https://soroban.stellar.org/docs/category/advanced-tutorials>.
48+
More examples are available at:
49+
- <https://developers.stellar.org/docs/build/smart-contracts/example-contracts>
50+
- <https://developers.stellar.org/docs/build/guides>

soroban-sdk/src/lib.rs

+18-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
//! Soroban SDK supports writing programs for the Soroban smart contract
2-
//! platform.
1+
//! Soroban SDK supports writing smart contracts for the Wasm-powered [Soroban] smart contract
2+
//! runtime, deployed on [Stellar].
33
//!
44
//! ### Docs
55
//!
6-
//! See [soroban.stellar.org](https://soroban.stellar.org) for documentation.
6+
//! See [developers.stellar.org] for documentation about building smart contracts for [Stellar].
7+
//!
8+
//! [developers.stellar.org]: https://developers.stellar.org
9+
//! [Stellar]: https://stellar.org
10+
//! [Soroban]: https://stellar.org/soroban
11+
//!
12+
//! ### Migrating Major Versions
13+
//!
14+
//! See [_migrating] for a summary of how to migrate from one major version to another.
715
//!
816
//! ### Examples
917
//!
1018
//! ```rust
1119
//! use soroban_sdk::{contract, contractimpl, vec, symbol_short, BytesN, Env, Symbol, Vec};
1220
//!
1321
//! #[contract]
14-
//! pub struct HelloContract;
22+
//! pub struct Contract;
1523
//!
1624
//! #[contractimpl]
17-
//! impl HelloContract {
25+
//! impl Contract {
1826
//! pub fn hello(env: Env, to: Symbol) -> Vec<Symbol> {
1927
//! vec![&env, symbol_short!("Hello"), to]
2028
//! }
@@ -26,8 +34,8 @@
2634
//! # #[cfg(feature = "testutils")]
2735
//! # fn main() {
2836
//! let env = Env::default();
29-
//! let contract_id = env.register(HelloContract, ());
30-
//! let client = HelloContractClient::new(&env, &contract_id);
37+
//! let contract_id = env.register(Contract, ());
38+
//! let client = ContractClient::new(&env, &contract_id);
3139
//!
3240
//! let words = client.hello(&symbol_short!("Dev"));
3341
//!
@@ -37,8 +45,9 @@
3745
//! # fn main() { }
3846
//! ```
3947
//!
40-
//! More examples are available at <https://soroban.stellar.org/docs/category/basic-tutorials>
41-
//! and <https://soroban.stellar.org/docs/category/advanced-tutorials>.
48+
//! More examples are available at:
49+
//! - <https://developers.stellar.org/docs/build/smart-contracts/example-contracts>
50+
//! - <https://developers.stellar.org/docs/build/guides>
4251
4352
#![cfg_attr(target_family = "wasm", no_std)]
4453
#![cfg_attr(feature = "docs", feature(doc_cfg))]

0 commit comments

Comments
 (0)