-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathconfig.mjs
More file actions
120 lines (92 loc) · 3.5 KB
/
Copy pathconfig.mjs
File metadata and controls
120 lines (92 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/**
* Configuration for the extension documentation generation pipeline
*/
export const config = {
ai: {
provider: 'openai',
model: 'gpt-4o-mini',
temperature: 0.3,
maxTokens: 1000,
},
prompts: {
description: {
system: `You are a technical writer for the @gravity-ui/markdown-editor library — a ProseMirror-based WYSIWYG and markup editor. Write concise, accurate documentation in English.`,
user: `Write a description of the "{name}" extension (2-4 sentences).
Focus on what this extension adds to the editor from a user's perspective.
Do not repeat the extension name as the first word.
Category: {category}
ProseMirror nodes: {nodes}
ProseMirror marks: {marks}
Actions: {actions}
Included in presets: {presets}
Source code:
{sourceCode}
Write ONLY the description text, no markdown headers.`,
},
syntaxGuide: {
system: `You are a technical writer for a markdown editor library. Write clear syntax guides.`,
user: `Write a syntax guide for the "{name}" extension.
Explain the markdown/markup syntax this extension handles:
- Show the syntax patterns with inline code
- Explain how they render
- Note any variations or edge cases
If this is a behavior extension with no markdown syntax, write: "This extension does not define custom markdown syntax."
Metadata:
- Category: {category}
- Input rules: {inputRules}
- Serializer hints: {serializerHints}
Test examples:
{markupExamples}
Source code:
{sourceCode}
Write markdown content without the section header.`,
},
serialization: {
system: `You are a technical writer for a markdown editor library.`,
user: `Describe how the "{name}" extension serializes its content back to markdown.
What markdown output does it produce? Include code examples where helpful.
If the extension doesn't produce markdown output, write: "This extension does not produce markdown output."
Serializer hints from code: {serializerHints}
Nodes: {nodes}
Marks: {marks}
Source code:
{sourceCode}
Write markdown content without the section header.`,
},
useCases: {
system: `You are a technical writer for the @gravity-ui/markdown-editor library.`,
user: `Write 2-4 bullet points describing typical use cases for the "{name}" extension.
When would a developer include this extension in their editor setup?
Category: {category}
Nodes: {nodes}
Marks: {marks}
Presets: {presets}
Write ONLY bullet points in markdown. Each should be one concise sentence.`,
},
examples: {
system: `You are a technical writer creating markdown documentation examples.`,
user: `Provide 2-3 clear markdown examples for the "{name}" extension.
Each example should:
1. Have a brief one-line description
2. Show the markdown syntax in a code block
3. Be practical and realistic
Existing test examples:
{markupExamples}
Serializer hints: {serializerHints}
Input rules: {inputRules}
If this extension has no markdown syntax, write: "This extension does not have markdown syntax examples."
Write in markdown format.`,
},
},
skipEnrichment: ['BaseInputRules', 'BaseKeymap', 'BaseStyles', 'ReactRenderer', 'SharedState'],
categories: {
order: ['markdown', 'yfm', 'additional', 'behavior', 'base'],
labels: {
markdown: 'Markdown',
yfm: 'YFM',
additional: 'Additional',
behavior: 'Behavior',
base: 'Base',
},
},
};