Skip to content

Commit 733ee09

Browse files
authored
docs: Auto-document features on docs.rs + improved wording for the top-level documentation (#1386)
* docs: Auto-document features on docs.rs + improved wording for the top-level documentation
1 parent 04515b4 commit 733ee09

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

near-sdk/src/lib.rs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,32 @@
5252
//! }
5353
//! ```
5454
//!
55-
//! ### Compiling to WASM
55+
//! ### Cargo NEAR Extension
56+
//!
57+
//! [`cargo-near`](https://github.com/near/cargo-near) is a handy command line
58+
//! extension to `cargo`, which guides you through the common tasks of
59+
//! creating, building, and deploying smart contracts.
60+
//!
61+
//! Follow the [installation instructions](https://github.com/near/cargo-near?tab=readme-ov-file#installation) on cargo-near README.
62+
//!
63+
//! Or compile it and install it from the source code:
5664
//!
57-
//! Install `cargo-near` in case if you don't have it:
5865
//! ```bash
5966
//! cargo install --locked cargo-near
6067
//! ```
6168
//!
62-
//! More installation methods on [cargo-near](https://github.com/near/cargo-near)
69+
//! ### Create New NEAR Smart Contract
6370
//!
64-
//! Builds a NEAR smart contract along with its [ABI](https://github.com/near/abi) (while in the directory containing contract's Cargo.toml):
71+
//! `cargo-near` can be used to start a new project with an example smart contract, unit tests,
72+
//! integration tests, and continuous integration preconfigured for you.
73+
//!
74+
//! ```bash
75+
//! cargo near new
76+
//! ```
77+
//!
78+
//! ### Compiling to WASM
79+
//!
80+
//! `cargo-near` builds a NEAR smart contract along with its [ABI](https://github.com/near/abi) (while in the directory containing contract's Cargo.toml):
6581
//!
6682
//! ```bash
6783
//! cargo near build
@@ -97,8 +113,10 @@
97113
//! ```bash
98114
//! cargo test
99115
//! ```
100-
//* Clippy is giving false positive warnings for this in 1.57 version. Remove this if fixed.
101-
//* https://github.com/rust-lang/rust-clippy/issues/8091
116+
117+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
118+
// Clippy is giving false positive warnings for this in 1.57 version. Remove this if fixed.
119+
// https://github.com/rust-lang/rust-clippy/issues/8091
102120
#![allow(clippy::redundant_closure)]
103121
// We want to enable all clippy lints, but some of them generate false positives.
104122
#![allow(clippy::missing_const_for_fn, clippy::redundant_pub_crate)]

0 commit comments

Comments
 (0)