Spaces:
Running
Running
Update schema.md
Browse files
schema.md
CHANGED
@@ -11,39 +11,7 @@ This document outlines the specific structures the Intelligent Markdown Converte
|
|
11 |
**Schema Rules:**
|
12 |
1. The document **must** contain a second-level heading exactly named \`## File Structure\`.
|
13 |
2. The document **must** contain at least one file block, denoted by a third-level heading starting with \`### File:\`.
|
14 |
-
3.
|
15 |
-
4. For proper syntax highlighting, code files should have their content wrapped in fenced code blocks (e.g., \`\`\`python ... \`\`\`).
|
16 |
-
|
17 |
-
**Example:**
|
18 |
-
\`\`\`markdown
|
19 |
-
# My Project
|
20 |
-
|
21 |
-
This is a sample project.
|
22 |
-
|
23 |
-
## File Structure
|
24 |
-
\`\`\`
|
25 |
-
π Root
|
26 |
-
π app.py
|
27 |
-
π README.md
|
28 |
-
\`\`\`
|
29 |
-
|
30 |
-
Below are the contents of all files in the space:
|
31 |
-
|
32 |
-
### File: README.md
|
33 |
-
\`\`\`md
|
34 |
-
# My Project's README
|
35 |
-
This is the content of the readme file.
|
36 |
-
\`\`\`
|
37 |
-
|
38 |
-
### File: app.py
|
39 |
-
\`\`\`python
|
40 |
-
def main():
|
41 |
-
print("Hello, World!")
|
42 |
-
|
43 |
-
if __name__ == "__main__":
|
44 |
-
main()
|
45 |
-
\`\`\`
|
46 |
-
\`\`\`
|
47 |
|
48 |
---
|
49 |
|
@@ -52,70 +20,57 @@ if __name__ == "__main__":
|
|
52 |
**Purpose:** To parse a typical software project \`README.md\` file into its major sections.
|
53 |
|
54 |
**Schema Rules:**
|
55 |
-
1. The document **must** start with a top-level heading (\`#\`).
|
56 |
-
2. The document **must** contain at least one second-level heading (\`##\`). Each \`##\` heading and
|
57 |
-
|
58 |
-
**Example:**
|
59 |
-
\`\`\`markdown
|
60 |
-
# iLearn Social Agent
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
## How It Works
|
65 |
-
|
66 |
-
This agent runs in a continuous loop, performing the following actions:
|
67 |
-
|
68 |
-
1. **Perceive**: It "looks" at the social media feed.
|
69 |
-
2. **Decide**: It uses an LLM to analyze the current feed.
|
70 |
-
3. **Act**: It formulates a plan to achieve its goal.
|
71 |
|
72 |
-
##
|
73 |
|
74 |
-
|
75 |
-
\`\`\`bash
|
76 |
-
pip install -r requirements.txt
|
77 |
-
\`\`\`
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
\`\`\`
|
83 |
-
\`\`\`
|
84 |
|
85 |
---
|
86 |
|
87 |
-
##
|
88 |
|
89 |
-
**Purpose:** To
|
90 |
|
91 |
**Schema Rules:**
|
92 |
-
1. The document
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
96 |
|
97 |
**Example:**
|
98 |
\`\`\`markdown
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
|
|
102 |
|
103 |
-
|
104 |
-
### Added
|
105 |
-
- Intelligent format detection for READMEs and Changelogs.
|
106 |
-
- Component selection for newly supported formats.
|
107 |
|
108 |
-
###
|
109 |
-
|
|
|
|
|
|
|
110 |
|
111 |
-
##
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
115 |
\`\`\`
|
116 |
|
117 |
---
|
118 |
|
119 |
-
##
|
120 |
|
121 |
-
If your document does not match any of the schemas above, it will be classified as **"Unknown"**. The entire document will be treated as a single component and will be rendered as-is.
|
|
|
11 |
**Schema Rules:**
|
12 |
1. The document **must** contain a second-level heading exactly named \`## File Structure\`.
|
13 |
2. The document **must** contain at least one file block, denoted by a third-level heading starting with \`### File:\`.
|
14 |
+
3. For proper syntax highlighting, code files should have their content wrapped in fenced code blocks (e.g., \`\`\`python ... \`\`\`).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
---
|
17 |
|
|
|
20 |
**Purpose:** To parse a typical software project \`README.md\` file into its major sections.
|
21 |
|
22 |
**Schema Rules:**
|
23 |
+
1. The document **must** start with a top-level heading (\`#\`).
|
24 |
+
2. The document **must** contain at least one second-level heading (\`##\`). Each \`##\` heading and its content becomes a "Section" component.
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
+
## 3. Changelog Format
|
29 |
|
30 |
+
**Purpose:** To parse a standard "Keep a Changelog" formatted file into components for each version.
|
|
|
|
|
|
|
31 |
|
32 |
+
**Schema Rules:**
|
33 |
+
1. The document **must** contain at least one version heading that follows the pattern: \`## [VersionNumber] - YYYY-MM-DD\`.
|
34 |
+
2. Each version heading and its content becomes a "Version" component.
|
|
|
|
|
35 |
|
36 |
---
|
37 |
|
38 |
+
## 4. Agent Action Format
|
39 |
|
40 |
+
**Purpose:** To describe a series of programmatic actions and file manipulations for an agent to take on a Hugging Face Space.
|
41 |
|
42 |
**Schema Rules:**
|
43 |
+
1. The document is detected by the presence of a \`### HF_ACTION:\` command or the specific header text "File and Code Formatting:".
|
44 |
+
2. **File definitions** use the format \`### File: path/to/filename.ext\`, followed by a fenced code block or a binary file marker. These become "File" components.
|
45 |
+
3. **File structure definitions** use the heading \`## File Structure\`, followed by a fenced code block. This becomes a "Structure" component.
|
46 |
+
4. **Agent commands** are specified on a single line starting with \`### HF_ACTION: COMMAND arguments...\`. Each command becomes an "Action" component.
|
47 |
+
5. All other text is grouped into an "Instructions & Rules" component.
|
48 |
|
49 |
**Example:**
|
50 |
\`\`\`markdown
|
51 |
+
**File and Code Formatting:**
|
52 |
+
When you provide NEW code...
|
53 |
+
...
|
54 |
+
**Hugging Face Space Actions:**
|
55 |
+
...
|
56 |
|
57 |
+
### HF_ACTION: DELETE_FILE old_app.py
|
|
|
|
|
|
|
58 |
|
59 |
+
### File: new_app.py (A new application file)
|
60 |
+
\`\`\`python
|
61 |
+
# The new code for the application
|
62 |
+
print("This is the new app.")
|
63 |
+
\`\`\`
|
64 |
|
65 |
+
## File Structure
|
66 |
+
\`\`\`
|
67 |
+
π Root
|
68 |
+
π new_app.py
|
69 |
+
\`\`\`
|
70 |
\`\`\`
|
71 |
|
72 |
---
|
73 |
|
74 |
+
## 5. Unknown Format
|
75 |
|
76 |
+
If your document does not match any of the schemas above, it will be classified as **"Unknown"**. The entire document will be treated as a single component and will be rendered as-is.
|