Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): use variables for docs.rs links #1098

Merged
merged 31 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
06c95f3
chore(docs): use variables for docs.rs links
Br1ght0ne Aug 21, 2023
4d38507
fix(ci): add mdbook-variables to gh-pages workflow
Br1ght0ne Aug 21, 2023
f770242
docs: mention mdbook-variables in README.md
Br1ght0ne Aug 21, 2023
f3845e5
docs: use fuels_types name (with underscore)
Br1ght0ne Aug 22, 2023
0971a18
docs: shorten fuels version to just MAJOR.MINOR
Br1ght0ne Aug 22, 2023
151a511
docs: replace fuels version in getting-started.md
Br1ght0ne Aug 22, 2023
9518df9
scripts: add version replacer script
Br1ght0ne Aug 31, 2023
91b8e45
docs: remove mdbook-variables mentions
Br1ght0ne Aug 31, 2023
0b70126
Merge branch 'master' into oleksii/mdbook-versions
Br1ght0ne Aug 31, 2023
d8d9092
change to test branch of docs action
Br1ght0ne Aug 31, 2023
7479a7b
ci: add pre-command input to docs.yml
Br1ght0ne Aug 31, 2023
9f6277b
count replacements, overwrite files on change only
Br1ght0ne Sep 1, 2023
5ccdbee
add unit tests
Br1ght0ne Sep 1, 2023
40b16b0
normalize test code
Br1ght0ne Sep 1, 2023
df719e5
Use master branch of docs workflow
Br1ght0ne Sep 1, 2023
8829afe
Merge branch 'master' into oleksii/mdbook-versions
Br1ght0ne Sep 1, 2023
331f45a
Merge branch 'master' into oleksii/mdbook-versions
Br1ght0ne Sep 5, 2023
4660c62
Merge branch 'master' into oleksii/mdbook-versions
hal3e Sep 6, 2023
664422b
Apply suggestions from code review
Br1ght0ne Sep 7, 2023
9a306f3
use 0 instead of None for "no replacements"
Br1ght0ne Sep 7, 2023
4c7f606
cargo fmt
Br1ght0ne Sep 7, 2023
53ebf5c
Remove `external-versions` metadata table
Br1ght0ne Sep 7, 2023
2beb80f
Merge branch 'master' into oleksii/mdbook-versions
Br1ght0ne Sep 9, 2023
6a6484d
Merge branch 'master' into oleksii/mdbook-versions
Br1ght0ne Sep 25, 2023
718e50c
Merge branch 'master' into oleksii/mdbook-versions
Br1ght0ne Sep 27, 2023
44f7603
remove unused serde_json dependency
Br1ght0ne Sep 27, 2023
a0960fc
Merge branch 'master' into oleksii/mdbook-versions
Br1ght0ne Sep 27, 2023
da941b2
Merge branch 'master' into oleksii/mdbook-versions
Br1ght0ne Sep 28, 2023
3a3229a
Merge branch 'master' into oleksii/mdbook-versions
hal3e Sep 29, 2023
0a7c9cb
Merge branch 'master' into oleksii/mdbook-versions
Br1ght0ne Oct 4, 2023
f9d8a2b
Merge branch 'master' into oleksii/mdbook-versions
hal3e Oct 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
with:
mdbook-version: "0.4.15"

- name: Install mdbook-variables preprocessor
uses: baptiste0928/cargo-install@v2
with:
crate: mdbook-variables
version: "0.2.2"

- run: mdbook build docs

- name: Deploy master
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ In order to make the SDK for Fuel feel familiar with those coming from the [ethe
Install `mdbook` by running:

```shell
cargo install mdbook
cargo install mdbook mdbook-variables
```

Next, navigate to the `docs` folder and run the command below to start a local server and open a new tab in you browser.
Expand Down
4 changes: 4 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ git-repository-url = "https://github.com/FuelLabs/fuels-rs"

[rust]
edition = "2021"

[preprocessor.variables.variables.versions]
fuels = "0.46.0"
types = "0.35.3"
Br1ght0ne marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion docs/src/calling-contracts/call-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The parameters for a contract call are:
3. Gas forwarded
<!-- call_params:example:end -->

You can use these to forward coins to a contract. You can configure these parameters by creating an instance of [`CallParameters`](https://docs.rs/fuels/latest/fuels/programs/contract/struct.CallParameters.html) and passing it to a chain method called `call_params`.
You can use these to forward coins to a contract. You can configure these parameters by creating an instance of [`CallParameters`](https://docs.rs/fuels/{{versions.fuels}}/fuels/programs/contract/struct.CallParameters.html) and passing it to a chain method called `call_params`.
<!-- use_call_params:example:end -->

For instance, suppose the following contract that uses Sway's `msg_amount()` to return the amount sent in that transaction.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/connecting/querying.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Querying the blockchain

Once you set up a provider, you can interact with the Fuel blockchain. Here are a few examples of what you can do with a provider; for a more in-depth overview of the API, check the [official provider API documentation](https://docs.rs/fuels/latest/fuels/accounts/provider/struct.Provider.html).
Once you set up a provider, you can interact with the Fuel blockchain. Here are a few examples of what you can do with a provider; for a more in-depth overview of the API, check the [official provider API documentation](https://docs.rs/fuels/{{versions.fuels}}/fuels/accounts/provider/struct.Provider.html).

- [Set up](#set-up)
- [Get all coins from an address](#get-all-coins-from-an-address)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# API Reference

For a more in-depth look at the APIs provided by the Fuel Rust SDK, head over to the [official documentation](https://docs.rs/fuels/latest/fuels/). In the actual Rust docs, you can see the most up-to-date information about the API, which is synced with the code as it changes.
For a more in-depth look at the APIs provided by the Fuel Rust SDK, head over to the [official documentation](https://docs.rs/fuels/{{versions.fuels}}/fuels/). In the actual Rust docs, you can see the most up-to-date information about the API, which is synced with the code as it changes.
2 changes: 1 addition & 1 deletion docs/src/types/address.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Address

Like `Bytes32`, `Address` is a wrapper on `[u8; 32]` with similar methods and implements the same traits (see [fuel-types documentation](https://docs.rs/fuel-types/latest/fuel_types/struct.Address.html)).
Like `Bytes32`, `Address` is a wrapper on `[u8; 32]` with similar methods and implements the same traits (see [fuel-types documentation](https://docs.rs/fuel-types/{{versions.types}}/fuel_types/struct.Address.html)).

These are the main ways of creating an `Address`:

Expand Down
2 changes: 1 addition & 1 deletion docs/src/types/asset-id.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AssetId

Like `Bytes32`, `AssetId` is a wrapper on `[u8; 32]` with similar methods and implements the same traits (see [fuel-types documentation](https://docs.rs/fuel-types/latest/fuel_types/struct.AssetId.html)).
Like `Bytes32`, `AssetId` is a wrapper on `[u8; 32]` with similar methods and implements the same traits (see [fuel-types documentation](https://docs.rs/fuel-types/{{versions.types}}/fuel_types/struct.AssetId.html)).

These are the main ways of creating an `AssetId`:

Expand Down
2 changes: 1 addition & 1 deletion docs/src/types/bytes32.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ These are the main ways of creating a `Bytes32`:
{{#include ../../../examples/types/src/lib.rs:bytes32_format}}
```

For a full list of implemented methods and traits, see the [fuel-types documentation](https://docs.rs/fuel-types/latest/fuel_types/struct.Bytes32.html).
For a full list of implemented methods and traits, see the [fuel-types documentation](https://docs.rs/fuel-types/{{versions.types}}/fuel_types/struct.Bytes32.html).

> **Note:** In Fuel, there's a special type called `b256`, which is similar to `Bytes32`; also used to represent hashes, and it holds a 256-bit value. In Rust, through the SDK, this is represented as `Bits256(value)` where `value` is a `[u8; 32]`. If your contract method takes a `b256` as input, all you need to do is pass a `Bits256([u8; 32])` when calling it from the SDK.
2 changes: 1 addition & 1 deletion docs/src/types/contract-id.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ContractId

Like `Bytes32`, `ContractId` is a wrapper on `[u8; 32]` with similar methods and implements the same traits (see [fuel-types documentation](https://docs.rs/fuel-types/latest/fuel_types/struct.ContractId.html)).
Like `Bytes32`, `ContractId` is a wrapper on `[u8; 32]` with similar methods and implements the same traits (see [fuel-types documentation](https://docs.rs/fuel-types/{{versions.types}}/fuel_types/struct.ContractId.html)).

These are the main ways of creating a `ContractId`:

Expand Down