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

Feat/last changes #120

Merged
merged 4 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/install-mdbook/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ runs:
run: cargo install mdbook --locked --version 0.4.28
shell: bash

- name: Install mdbook-i18n-helpers
run: cargo install mdbook-i18n-helpers --locked --version 0.1.0
- name: Install mdbook-last-changed
run: cargo install mdbook-last-changed --locked --version 0.1.4
shell: bash
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Starknet by Example is a collection of examples of how to use the [Cairo](https:
1. Clone this repository.
2. Rust related packages:
- Install toolchain providing `cargo` using [rustup](https://rustup.rs/).
- Install [mdBook](https://rust-lang.github.io/mdBook/guide/installation.html).
- Install [mdBook](https://rust-lang.github.io/mdBook/guide/installation.html) and the required extension with `cargo install mdbook mdbook-last-changed`.
3. Install `scarb` using [asdf](https://asdf-vm.com/) with `asdf install`. Alternatively, you can install `scarb` manually by following the instructions [here](https://docs.swmansion.com/scarb/).

### Local development
Expand Down
7 changes: 6 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ extra-watch-dirs = ["listings"]
[preprocessor.gettext]
after = ["links"]

[preprocessor.last-changed]
command = "mdbook-last-changed"
renderer = ["html"]

[output.html]
git-repository-url = "https://github.com/NethermindEth/StarknetByExample/"
edit-url-template = "https://github.com/NethermindEth/StarknetByExample/edit/main/{path}"
playground.runnable = false
fold.enable = true
fold.level = 2
fold.level = 2
additional-css = ["theme/css/last-changed.css"]
1 change: 1 addition & 0 deletions listings/ch00-getting-started/storage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
6 changes: 6 additions & 0 deletions listings/ch00-getting-started/storage/Scarb.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "storage"
version = "0.1.0"
8 changes: 8 additions & 0 deletions listings/ch00-getting-started/storage/Scarb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "storage"
version = "0.1.0"

[dependencies]
starknet = ">=2.3.0"

[[target.starknet-contract]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"sierra_program": [
"0x1",
"0x3",
"0x0",
"0x2",
"0x3",
"0x0",
"0x1",
"0xff",
"0x0",
"0x4",
"0x0"
],
"sierra_program_debug_info": {
"type_names": [],
"libfunc_names": [],
"user_func_names": []
},
"contract_class_version": "0.1.0",
"entry_points_by_type": {
"EXTERNAL": [],
"L1_HANDLER": [],
"CONSTRUCTOR": []
},
"abi": [
{
"type": "event",
"name": "storage::minimal_contract::MinimalContract::Event",
"kind": "enum",
"variants": []
}
]
}
9 changes: 9 additions & 0 deletions listings/ch00-getting-started/storage/src/contract.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#[starknet::contract]
mod Contract {
#[storage]
struct Storage {
a: u128,
b: u8,
c: u256
}
}
2 changes: 2 additions & 0 deletions listings/ch00-getting-started/storage/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod minimal_contract;
mod contract;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[starknet::contract]
mod Contract {
#[storage]
struct Storage {}
}
5 changes: 5 additions & 0 deletions theme/css/last-changed.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
footer {
font-size: 0.8em;
text-align: right;
padding: 10px 0;
}