broadfield-dev commited on
Commit
30333e3
Β·
verified Β·
1 Parent(s): f94ab6e

Update schema.md

Browse files
Files changed (1) hide show
  1. schema.md +34 -79
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. The content of each file should follow its \`### File:\` heading.
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 (\`#\`). This is treated as the project title and becomes the "Introduction" component.
56
- 2. The document **must** contain at least one second-level heading (\`##\`). Each \`##\` heading and the text that follows it (until the next \`##\` or the end of the file) will be treated as a selectable "Section" component.
57
-
58
- **Example:**
59
- \`\`\`markdown
60
- # iLearn Social Agent
61
 
62
- This is an autonomous AI agent designed to interact with the \`social_media_app\`. It uses its learning capabilities to decide what to post, who to comment on, and how to behave as a social media user.
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
- ## How to Run
73
 
74
- 1. **Install dependencies:**
75
- \`\`\`bash
76
- pip install -r requirements.txt
77
- \`\`\`
78
 
79
- 2. **Run the agent:**
80
- \`\`\`bash
81
- python ilearn_social_user.py
82
- \`\`\`
83
- \`\`\`
84
 
85
  ---
86
 
87
- ## 3. Changelog Format
88
 
89
- **Purpose:** To parse a standard "Keep a Changelog" formatted file into components for each version.
90
 
91
  **Schema Rules:**
92
- 1. The document **must** contain at least one version heading that follows the pattern: \`## [VersionNumber] - YYYY-MM-DD\`.
93
- - Example: \`## [1.1.0] - 2024-05-21\`
94
- 2. Each version heading and its content (until the next version heading) will be treated as a single selectable "Version" component.
95
- 3. Sub-headings like \`### Added\` or \`### Fixed\` are preserved as part of the version's content.
 
96
 
97
  **Example:**
98
  \`\`\`markdown
99
- # Changelog
100
-
101
- All notable changes to this project will be documented in this file.
 
 
102
 
103
- ## [1.1.0] - 2024-05-21
104
- ### Added
105
- - Intelligent format detection for READMEs and Changelogs.
106
- - Component selection for newly supported formats.
107
 
108
- ### Fixed
109
- - CSS scoping issue where preview styles could affect the main page.
 
 
 
110
 
111
- ## [1.0.0] - 2024-05-20
112
- ### Added
113
- - Initial release with Repo2Markdown parsing.
114
- - PNG and HTML generation.
 
115
  \`\`\`
116
 
117
  ---
118
 
119
- ## 4. Unknown Format
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. This ensures that the tool can still be used as a general-purpose Markdown-to-PNG/HTML converter for any valid Markdown content.
 
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.