Skip to content

Latest commit

 

History

History
78 lines (52 loc) · 3.02 KB

File metadata and controls

78 lines (52 loc) · 3.02 KB

Recho Notebook - Contributing

Recho Notebook is open source and released under the ISC license. You are welcome to contribute in different ways: open a pull request, participate in issues and discussions or star this project!

Sharing Examples

All the examples are located in app/examples. The quickest way to add an example is through GitHub's web editor:

  • Go to new file.
  • Enter the filename in the format of [NOTEBOOK-NAME].recho.js.
  • Add the metadata as doc strings at the top of the file.
  • Add the code below the metadata.
  • Click the "Commit changes" button.

The following metadata is required:

  • title - the title of the notebook
  • author - the author of the notebook
  • created - the date of the creation of the notebook
  • github - the GitHub username of the author, for displaying the avatar
  • pull_request - the pull request number of adding this notebook, for commenting on the pull request

The following metadata is optional:

  • thumbnail_start - the line number of the start of the thumbnail code

Here is an example:

/**
 * @title Hello World
 * @author Bairui SU
 * @github pearmini
 * @created 2025-09-15
 * @pull_request 123
 * @thumbnail_start 26
 */

echo("Hello World");

This is a pull request you can refer to.

If you prefer a snapshot thumbnail, place an image file named [NOTEBOOK-NAME].snap.[FORMAT] in public/examples/ and add @snap [NOTEBOOK-NAME].snap.[FORMAT] to the metadata block at the top of your .recho.js file. For example, sin-wave-radios.recho.js now references sin-wave-radios.snap.png.

Editor & Runtime Development

If you want to contribute to the editor or runtime, make sure to add test files in test/js/ and register them in test/js/index.js.

For example, if you add a new test file called hello-world.js with the following content:

export const helloWorld = `echo("Hello World");`;

Then you need to register it in test/js/index.js with the following content:

// test/js/index.js
export {helloWorld} from "./hello-world.js";

Then run npm run dev to open the development server.

test-env

After finishing development, if you want to add this test case to snapshot tests, then register it in test/js/index-tests.js:

// test/js/index.js
export {helloWorld} from "./hello-world.js";

After that, run npm run test to generate the snapshot file for this test case, which is located at test/output/helloWorld.js.

Website Development

If you want to contribute to the website, run npm run app:dev to open the development server. After finishing development, run npm run test to make sure everything works as expected.