Giter Club home page Giter Club logo

gno-by-example's Introduction

⚛️ Gno By Example ⚛️

Netlify Status

Overview

Gno By Example is a community-dedicated web app that showcases the fundamentals of Gnolang, the Smart Contract language used on Gno.land.

Contributing

The base application is built with React and utilizes the Chakra UI framework. You will need Node v20+ to run it locally.

As a community-driven project, users are welcome to contribute by creating new tutorials or modifying existing ones.

All tutorials are located within the ./src/tutorials/gno.land/gbe subdirectory in their respective section folders. Tutorials are automatically generated from corresponding .md files, with each tutorial having its own subdirectory.

Banner

Generating tutorials

After making modifications to tutorial files (.md or other resources), it is necessary to regenerate the global list of tutorials by running the following command:

yarn generate

This command executes the tutorial route generation script, ensuring that all tutorials are up-to-date and ready for dynamic display. Make sure to run this command from the repository root.

Markdown format

Tutorials can be written using Markdown syntax.

Metadata header

A markdown header with some specific metadata is mandatory. This makes it possible for the tutorial generator script to correctly parse and organize examples. title and section values have to be set as part of the metadata at the top of the markdown file:

---
title: Example Title
section: Example Section
---

Note: The section field in the metadata header will ultimately decide under which section the tutorial is generated in.

Code snippets

In Gno By Example, there is a special feature that allows referencing entire external files or specific line numbers from those files, outside of the Markdown files themselves.

To embed the entire content of a specific file inside a code segment, use the following syntax:

```go file=./myFile.gno
```

To embed specific line numbers from an external file inside a code segment, use the following syntax:

```go file=./myFile.gno#L1-L2
```

The above syntax will embed the content of the first two lines (inclusive) from the ./myFile.gno file.

If your sample code relies on another code, you can define the dependencies. Each dependency code will be shown in a separate tab. A typical scenario occurs when your sample code is a test file. In order for your test file to be executable, you need to include the actual implementation as a dependency.

To define dependencies, use the following syntax:

```go file=./myFile_test.gno depends_on_file=./myFile.gno,./myOtherFile.gno
```

gno-by-example's People

Contributors

dependabot[bot] avatar zivkovicmilos avatar ajnavarro avatar ilgooz avatar albttx avatar leohhhn avatar moul avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.