Aller au contenu
The image is a small, flat, and simple digital illustration. At the center, there is an open notebook displaying basic code snippets and a vertical line of chat bubbles. Beside it lies a sheet of paper featuring a large hash symbol and thick lines, referencing Markdown formatting. Above them, three minimalist emoji-like symbols—a seedling, a sunflower, and a sun—appear in a row. The color palette is limited to five solid colors, and the background is a single, plain color. There are no people, text, shadows, gradients, or realistic details. The overall style is geometric and 8-bit.

Bloc-notes

AI generated translation.

Le Bloc-notes Markdown de GenAIScript est actuellement utilisé pour rédiger la documentation de GenAIScript.

Screenshot of a Visual Studio Code notebook interface showing an interactive code execution. The text at the top says "Let's start with a simple hello world program." Below is a code cell with the prompt "$ Say "hello!" in emojis" which has been executed in 1.3 seconds, indicated by a checkmark and the time. There are two outputs: one labeled 'user' with the text "Say "hello!" in emojis" and another labeled 'assistant' with a waving hand emoji followed by an exclamation mark.

Il permet d’exécuter des extraits de script et d’afficher le résultat directement en ligne dans le markdown, comme ceci :

$`Write a 3 emoji story.`
👤 utilisateur
Write a 3 emoji story.
🤖 assistant
🌱 🌻 🌞

La première étape consiste à ouvrir le fichier markdown afin de le modifier à l’aide du bloc-notes GenAIScript.

  1. Dans Visual Studio Code, faites un clic droit sur un fichier Markdown (.md) ou MDX (.mdx)
  2. Sélectionnez Ouvrir avec…
  3. Sélectionnez Bloc-notes Markdown GenAIScript

Vous pouvez exécuter n’importe quelle cellule JavaScript en cliquant sur le bouton Exécuter la cellule ou en appuyant sur Shift+Entrée. Cela exécutera le code comme s’il s’agissait d’un script GenAIScript dans l’espace de travail.

$`Write a one sentence poem.`
👤 utilisateur
Write a one sentence poem.
🤖 assistant
In the still of the night, the stars whisper secrets to the dreaming earth.

Vous pouvez fournir des paramètres de configuration globaux dans le front matter. Le front matter commence et se termine par trois tirets --- et se trouve en haut du fichier markdown.

---
title: My genai notebook
genaiscript:
model: openai:gpt-4.1
...
---

Vous pouvez spécifier les métadonnées de configuration du modèle LLM depuis script.

---
genaiscript:
provider: openai
model: openai:gpt-4.1
temperature: 0
---

Vous pouvez spécifier les fichiers à inclure dans le bloc-notes, soit en tant qu’entrée unique, soit en tant que tableau. Les glob patterns sont pris en charge. Les fichiers sont relatifs à la racine de l’espace de travail.

---
genaiscript:
files: src/samples/*.md
---

La variable env.files est disponible pour référencer les fichiers dans le bloc-notes.

def("FILE", env.files)
$`Summarize FILE using exclusively emojis.`
👤 utilisateur
FILE:
```md file="src/samples/markdown.md"
---
title: What is Markdown? - Understanding Markdown Syntax
description: Learn about Markdown, a lightweight markup language for formatting plain text, its syntax, and how it differs from WYSIWYG editors.
keywords: Markdown, markup language, formatting, plain text, syntax
sidebar: mydoc_sidebar
---
What is Markdown?
Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents. Created by John Gruber in 2004, Markdown is now one of the world’s most popular markup languages.
Using Markdown is different than using a WYSIWYG editor. In an application like Microsoft Word, you click buttons to format words and phrases, and the changes are visible immediately. Markdown isn’t like that. When you create a Markdown-formatted file, you add Markdown syntax to the text to indicate which words and phrases should look different.
For example, to denote a heading, you add a number sign before it (e.g., # Heading One). Or to make a phrase bold, you add two asterisks before and after it (e.g., **this text is bold**). It may take a while to get used to seeing Markdown syntax in your text, especially if you’re accustomed to WYSIWYG applications. The screenshot below shows a Markdown file displayed in the Visual Studio Code text editor....
```
Summarize FILE using exclusively emojis.
🤖 assistant
📝 Markdown is a lightweight markup language created by John Gruber in 2004. It allows users to add formatting to plaintext documents using simple syntax. Unlike WYSIWYG editors, Markdown requires users to add specific symbols to indicate formatting, such as using # for headings and \*\* for bold text. Despite the initial adjustment period, Markdown has become one of the most popular markup languages in the world.