CosmWasm / docs

https://cosmwasm-docs.vercel.app
Apache License 2.0
6 stars 3 forks source link

Possibility to highlight relevant code parts #98

Closed hashedone closed 1 month ago

hashedone commented 1 month ago

Can we add a possibility in the code examples to highlight relevant lines? The best would probably be to dim most of the code and only make normal coloring for the relevant parts for the reader to focus on them, but any solution that moves attention to only relevant lines of the holistic example would most likely work. @abefernan ideas?

abefernan commented 1 month ago

You can highlight individual lines or ranges like this (first line):

```rust {2, 5-7, 9}
#[cfg_attr(not(feature = "library"), sylvia::entry_points)]
#[contract]
impl CounterContract {
    pub const fn new() -> Self {
        Self {
            count: Item::new("count"),
        }
    }
···

Will render this:

image