Create schema.md
Browse files
schema.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Supported Format Schemas
|
| 2 |
+
|
| 3 |
+
This document outlines the specific structures the Intelligent Markdown Converter looks for to detect and parse different types of documents into selectable components.
|
| 4 |
+
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
## 1. Repo2Markdown Format
|
| 8 |
+
|
| 9 |
+
**Purpose:** To represent a project's directory structure and the full contents of its files in a single document.
|
| 10 |
+
|
| 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 |
+
|
| 50 |
+
## 2. Standard README Format
|
| 51 |
+
|
| 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.
|