# markdown2code
```bash
_ _ ___ _
| | | | |__ \ | |
_ __ ___ __ _ _ __| | ____| | _____ ___ __ ) |___ ___ __| | ___
| '_ ` _ \ / _` | '__| |/ / _` |/ _ \ \ /\ / / '_ \ / // __/ _ \ / _` |/ _ \
| | | | | | (_| | | | < (_| | (_) \ V V /| | | |/ /| (_| (_) | (_| | __/
|_| |_| |_|\__,_|_| |_|\_\__,_|\___/ \_/\_/ |_| |_|____\___\___/ \__,_|\___|
```
Convert markdown files into organized project structures with code files. This tool is particularly useful for converting code snippets from AI chat conversations (like ChatGPT, Claude, etc.) into actual project files.
## Features
- Extracts code blocks from markdown files
- Automatically detects programming languages
- Creates directory structures based on markdown content
- Supports filename detection from comments
- Handles multiple programming languages
- Maintains file permissions (executable for shell scripts)
- Preview mode to check files before creation
- File conflict detection and handling
- Configuration system with YAML support
- Verbose logging options
- Web interface for browser-based conversion
## Installation
```bash
pip install markdown2code
```
## Quick Start
```bash
# Convert markdown to code
markdown2code convert input.md
# Preview files to be created
markdown2code convert input.md --preview
# Specify output directory
markdown2code convert input.md --output ./my-project
# Force overwrite existing files
markdown2code convert input.md --force
# Enable verbose logging
markdown2code convert input.md --verbose
# Use custom configuration
markdown2code convert input.md --config my-config.yml
# Create default configuration
markdown2code --create-config
# Start web interface
markdown2code server --port 5000
```
## Configuration
### Default Configuration
Create a default configuration file:
```bash
markdown2code --create-config
```
This creates `.markdown2code.yml` with default settings:
```yaml
file_patterns:
javascript: ['script.js', 'index.js', 'main.js']
python: ['script.py', 'main.py', 'app.py']
# ... more patterns
logging:
level: INFO
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
output:
colored: false
verbose: false
```
### Custom Configuration
Create a custom configuration file:
```yaml
# .markdown2code.yml
file_patterns:
python:
- main.py
- app.py
- script.py
javascript:
- index.js
- app.js
- client.js
logging:
level: DEBUG
format: '%(levelname)s: %(message)s'
output:
colored: true
verbose: true
```
### File Patterns
Default file patterns for common languages:
- JavaScript: script.js, index.js, main.js
- Python: script.py, main.py, app.py
- HTML: index.html, main.html, app.html
- CSS: styles.css, main.css, app.css
- And many more...
## Command Line Options
### Convert Command
```bash
markdown2code convert [options] input.md
Options:
--output, -o DIR Output directory (default: current)
--preview, -p Preview files without creating
--force, -f Force overwrite existing files
--backup, -b Create Git backup before conversion
--restore, -r Restore from last backup
--verbose, -v Enable verbose output
--config, -c FILE Use custom configuration file
--create-config Create default configuration file
--version Show version number
--help Show this help message
```
### Server Command
```bash
markdown2code server [options]
Options:
--host HOST Host to bind to (default: localhost)
--port PORT Port to listen on (default: 5000)
--output DIR Output directory for converted files (default: uploads)
```
## Web Interface
markdown2code provides a web-based interface for converting markdown to code files through your browser.
### Starting the Web Server
```bash
# Start with default settings (localhost:5000)
markdown2code server
# Use custom host and port
markdown2code server --host 0.0.0.0 --port 8000
# Specify output directory
markdown2code server --output ./my-projects
```
### Using the Web Interface
1. Start the server using one of the commands above
2. Open your browser and navigate to the server URL (e.g., http://localhost:5000)
3. Choose one of two options:
- Enter markdown content directly in the text area
- Upload a markdown file
4. Click "Convert" to process your markdown
5. View the conversion results, including:
- List of created files
- Directory structure
- Any conversion messages or errors
### Features
- Direct markdown content input
- File upload support
- Automatic project.md creation
- Real-time conversion feedback
- Error handling and display
- Clean, responsive UI
- Configurable output directory
### Example Usage
1. Start the server with a custom output directory:
```bash
markdown2code server --output ./projects
```
2. Open http://localhost:5000 in your browser
3. Enter or upload your markdown content
4. After conversion, your files will be created in the specified output directory:
```
projects/
├── project.md # Your original markdown
├── src/ # Generated source files
│ ├── main.py
│ └── utils.py
└── ... # Other generated files
```
## Backup and Restore
### Backup and Restore
#### Creating Backups
The --backup flag creates a Git backup before making any changes:
```bash
# Preview with backup information
markdown2code convert input.md --preview --backup
# Convert with automatic backup
markdown2code convert input.md --backup
# Force overwrite with backup
markdown2code convert input.md --force --backup
```
Example output with --backup:
```
Creating backup before proceeding...
Created backup in branch: backup_20240109_123456
Backed up files:
- src/main.py
- tests/test_main.py
Files to be created:
Directory: ./src (will be created)
File: ./src/main.py (exists)
File: ./src/utils.py (will be created)
Note: Original state backed up in branch: backup_20240109_123456
Project structure created successfully!
```
#### Quick Restore
Use the --restore flag to quickly restore from the most recent backup:
```bash
# Restore from last backup
markdown2code convert input.md --restore
```
Example restore output:
```
Restored 3 files from last backup: backup_20240109_123456
Restored files:
- src/main.py
- src/utils.py
- tests/test_main.py
```
#### Manual Backup Management
For more control over backups:
```bash
# List all backups (newest first)
markdown2code backup list
# Show backup details
markdown2code backup info backup_20240109_123456
# Restore specific backup
markdown2code backup restore backup_20240109_123456
# Delete old backup
markdown2code backup delete backup_20240109_123456
```
## Troubleshooting
### Backup and Restore Issues
1. Quick Restore Fails
```bash
# Check available backups
markdown2code backup list
# Try manual restore if needed
markdown2code backup restore BACKUP_NAME
```
2. No Backups Found
```bash
# Check if directory is a git repository
git status
# Initialize if needed
git init
# Create initial backup
markdown2code convert input.md --backup
```
3. Restore Conflicts
```bash
# Preview changes first
markdown2code convert input.md --preview --restore
# Force restore if needed
markdown2code convert input.md --force --restore
```
### Best Practices
1. Create descriptive backup messages:
```bash
markdown2code backup create --message "Added new API endpoints"
```
2. Backup before major changes:
```bash
markdown2code backup create --message "Pre-refactor backup"
```
3. Regular backups of specific files:
```bash
markdown2code backup create --files src/* --message "Source code backup"
```
4. Check backup status:
```bash
markdown2code backup list
markdown2code backup info BACKUP_NAME
```
### Backup Issues
1. Restore Fails
```bash
# Check if working directory is clean
git status
# Force clean working directory
git reset --hard
git clean -fd
# Try restore again
markdown2code backup restore BACKUP_NAME
```
2. Backup Creation Fails
```bash
# Check if git is initialized
git status
# Initialize if needed
git init
# Try backup again
markdown2code backup create
```
3. Backup Conflicts
```bash
# List all backups
markdown2code backup list
# Check specific backup
markdown2code backup info BACKUP_NAME
# Delete problematic backup if needed
markdown2code backup delete BACKUP_NAME
```
2. Run tests:
```bash
pytest
pytest --cov=markdown2code
```
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development guidelines.
## Troubleshooting
### Common Issues
1. File Conflicts
```bash
# Use preview to check conflicts
markdown2code input.md --preview
# Force overwrite if needed
markdown2code input.md --force
```
2. Configuration Issues
```bash
# Create fresh configuration
markdown2code --create-config
# Use verbose logging
markdown2code input.md --verbose
```
3. Permission Issues
```bash
# Check file permissions
ls -l output_dir
# Fix shell script permissions
chmod +x output_dir/*.sh
```
## License
This project is licensed under the Apache License - see the [LICENSE](LICENSE) file for details.
## AI Chat Example
Here's an example of converting an AI chat into a working project:
1. Save this AI chat conversation as `chat.md`:
````markdown
# React Todo App Development Chat
Project structure suggested by AI:
```markdown
todo-app/
├── public/
│ └── index.html
├── src/
│ ├── components/
│ │ ├── TodoList.js
│ │ └── TodoItem.js
│ ├── App.js
│ └── index.js
└── package.json
```
The AI suggested this HTML:
```html
# public/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Todo App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
```
...
````
[chat.md](chat.md)
2. Convert the chat to a project:
3. Preview what will be created
```bash
markdown2code chat.md --preview --output todo-app
```
Output:
```bash
Preview of files to be created:
Directories:
- todo-app/todo-app (will be created)
- todo-app/public (will be created)
- todo-app/src (will be created)
- todo-app/components (will be created)
Files:
- todo-app/README.md (will be created)
- todo-app/public/index.html (will be created)
- todo-app/src/App.js (will be created)
- todo-app/src/components/TodoList.js (will be created)
- todo-app/src/components/TodoItem.js (will be created)
- todo-app/src/index.js (will be created)
- todo-app/package.json (will be created)
```
# Create the project
```bash
markdown2code chat.md --output todo-app
```
```
2024-11-20 16:10:55,512 - markdown2code.converter - INFO -
Files to be created:
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - Directory: todo-app/todo-app (will be created)
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - Directory: todo-app/public (will be created)
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - Directory: todo-app/src (will be created)
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - Directory: todo-app/components (will be created)
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/README.md (will be created)
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/public/index.html (will be created)
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/src/App.js (will be created)
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/src/components/TodoList.js (will be created)
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/src/components/TodoItem.js (will be created)
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/src/index.js (will be created)
2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/package.json (will be created)
2024-11-20 16:10:55,514 - markdown2code.converter - INFO - Creating file: todo-app/README.md
2024-11-20 16:10:55,514 - markdown2code.converter - INFO - Creating file: todo-app/public/index.html
2024-11-20 16:10:55,515 - markdown2code.converter - INFO - Creating file: todo-app/src/App.js
2024-11-20 16:10:55,515 - markdown2code.converter - INFO - Creating file: todo-app/src/components/TodoList.js
2024-11-20 16:10:55,515 - markdown2code.converter - INFO - Creating file: todo-app/src/components/TodoItem.js
2024-11-20 16:10:55,516 - markdown2code.converter - INFO - Creating file: todo-app/src/index.js
2024-11-20 16:10:55,516 - markdown2code.converter - INFO - Creating file: todo-app/package.json
2024-11-20 16:10:55,516 - markdown2code.converter - INFO -
Created files:
2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - README.md
2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - package.json
2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - public/index.html
2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - src/App.js
2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - src/components/TodoItem.js
2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - src/components/TodoList.js
2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - src/index.js
2024-11-20 16:10:55,516 - markdown2code.converter - INFO -
Project structure created successfully!
```
3. Run the project:
```bash
cd todo-app
npm install
npm start
```
```bash
pip install -e . && python -m markdown2code server --host localhost --port 5000
python -m markdown2code server --host localhost --port 5000
markdown2code server --host localhost --port 5001 --output test_output
markdown2code server --host localhost --port 5000
```
## TESTS
```bash
python -m markdown2code convert test_python_files.txt --output test_output
```
Output
```bash
2024-11-20 20:28:04,455 - markdown2code.converter - INFO - Creating file: test_output/tests/conftest.py
2024-11-20 20:28:04,455 - markdown2code.converter - INFO - Creating file: test_output/tests/test_api.py
2024-11-20 20:28:04,455 - markdown2code.converter - INFO -
Created files:
2024-11-20 20:28:04,455 - markdown2code.converter - INFO - - tests/conftest.py
2024-11-20 20:28:04,455 - markdown2code.converter - INFO - - tests/test_api.py
2024-11-20 20:28:04,455 - markdown2code.converter - INFO -
Project structure created successfully!
```
Raw data
{
"_id": null,
"home_page": "https://github.com/plain-mark/markdown2code",
"name": "markdown2code",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "markdown, code generation, project structure, development tools",
"author": "Tom Sapletta",
"author_email": "info@softreck.dev",
"download_url": "https://files.pythonhosted.org/packages/62/ec/1f453abca8c50e4897135cb6733916ab1c6b86dc0db75ad7d966e844ef97/markdown2code-2.8.0.tar.gz",
"platform": null,
"description": "# markdown2code\n```bash\n _ _ ___ _ \n | | | | |__ \\ | | \n _ __ ___ __ _ _ __| | ____| | _____ ___ __ ) |___ ___ __| | ___ \n | '_ ` _ \\ / _` | '__| |/ / _` |/ _ \\ \\ /\\ / / '_ \\ / // __/ _ \\ / _` |/ _ \\\n | | | | | | (_| | | | < (_| | (_) \\ V V /| | | |/ /| (_| (_) | (_| | __/\n |_| |_| |_|\\__,_|_| |_|\\_\\__,_|\\___/ \\_/\\_/ |_| |_|____\\___\\___/ \\__,_|\\___|\n``` \n\nConvert markdown files into organized project structures with code files. This tool is particularly useful for converting code snippets from AI chat conversations (like ChatGPT, Claude, etc.) into actual project files.\n\n## Features\n\n- Extracts code blocks from markdown files\n- Automatically detects programming languages\n- Creates directory structures based on markdown content\n- Supports filename detection from comments\n- Handles multiple programming languages\n- Maintains file permissions (executable for shell scripts)\n- Preview mode to check files before creation\n- File conflict detection and handling\n- Configuration system with YAML support\n- Verbose logging options\n- Web interface for browser-based conversion\n\n## Installation\n\n```bash\npip install markdown2code\n```\n\n## Quick Start\n\n```bash\n# Convert markdown to code\nmarkdown2code convert input.md\n\n# Preview files to be created\nmarkdown2code convert input.md --preview\n\n# Specify output directory\nmarkdown2code convert input.md --output ./my-project\n\n# Force overwrite existing files\nmarkdown2code convert input.md --force\n\n# Enable verbose logging\nmarkdown2code convert input.md --verbose\n\n# Use custom configuration\nmarkdown2code convert input.md --config my-config.yml\n\n# Create default configuration\nmarkdown2code --create-config\n\n# Start web interface\nmarkdown2code server --port 5000\n```\n\n## Configuration\n\n### Default Configuration\n\nCreate a default configuration file:\n```bash\nmarkdown2code --create-config\n```\n\nThis creates `.markdown2code.yml` with default settings:\n```yaml\nfile_patterns:\n javascript: ['script.js', 'index.js', 'main.js']\n python: ['script.py', 'main.py', 'app.py']\n # ... more patterns\n\nlogging:\n level: INFO\n format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'\n\noutput:\n colored: false\n verbose: false\n```\n\n### Custom Configuration\n\nCreate a custom configuration file:\n```yaml\n# .markdown2code.yml\nfile_patterns:\n python:\n - main.py\n - app.py\n - script.py\n javascript:\n - index.js\n - app.js\n - client.js\n\nlogging:\n level: DEBUG\n format: '%(levelname)s: %(message)s'\n\noutput:\n colored: true\n verbose: true\n```\n\n### File Patterns\n\nDefault file patterns for common languages:\n- JavaScript: script.js, index.js, main.js\n- Python: script.py, main.py, app.py\n- HTML: index.html, main.html, app.html\n- CSS: styles.css, main.css, app.css\n- And many more...\n\n## Command Line Options\n\n### Convert Command\n```bash\nmarkdown2code convert [options] input.md\n\nOptions:\n --output, -o DIR Output directory (default: current)\n --preview, -p Preview files without creating\n --force, -f Force overwrite existing files\n --backup, -b Create Git backup before conversion\n --restore, -r Restore from last backup\n --verbose, -v Enable verbose output\n --config, -c FILE Use custom configuration file\n --create-config Create default configuration file\n --version Show version number\n --help Show this help message\n```\n\n### Server Command\n```bash\nmarkdown2code server [options]\n\nOptions:\n --host HOST Host to bind to (default: localhost)\n --port PORT Port to listen on (default: 5000)\n --output DIR Output directory for converted files (default: uploads)\n```\n\n## Web Interface\n\nmarkdown2code provides a web-based interface for converting markdown to code files through your browser.\n\n### Starting the Web Server\n\n```bash\n# Start with default settings (localhost:5000)\nmarkdown2code server\n\n# Use custom host and port\nmarkdown2code server --host 0.0.0.0 --port 8000\n\n# Specify output directory\nmarkdown2code server --output ./my-projects\n```\n\n### Using the Web Interface\n\n1. Start the server using one of the commands above\n2. Open your browser and navigate to the server URL (e.g., http://localhost:5000)\n3. Choose one of two options:\n - Enter markdown content directly in the text area\n - Upload a markdown file\n4. Click \"Convert\" to process your markdown\n5. View the conversion results, including:\n - List of created files\n - Directory structure\n - Any conversion messages or errors\n\n### Features\n\n- Direct markdown content input\n- File upload support\n- Automatic project.md creation\n- Real-time conversion feedback\n- Error handling and display\n- Clean, responsive UI\n- Configurable output directory\n\n### Example Usage\n\n1. Start the server with a custom output directory:\n```bash\nmarkdown2code server --output ./projects\n```\n\n2. Open http://localhost:5000 in your browser\n\n3. Enter or upload your markdown content\n\n4. After conversion, your files will be created in the specified output directory:\n```\nprojects/\n\u251c\u2500\u2500 project.md # Your original markdown\n\u251c\u2500\u2500 src/ # Generated source files\n\u2502 \u251c\u2500\u2500 main.py\n\u2502 \u2514\u2500\u2500 utils.py\n\u2514\u2500\u2500 ... # Other generated files\n```\n\n## Backup and Restore\n\n\n### Backup and Restore\n\n#### Creating Backups\nThe --backup flag creates a Git backup before making any changes:\n\n```bash\n# Preview with backup information\nmarkdown2code convert input.md --preview --backup\n\n# Convert with automatic backup\nmarkdown2code convert input.md --backup\n\n# Force overwrite with backup\nmarkdown2code convert input.md --force --backup\n```\n\nExample output with --backup:\n```\nCreating backup before proceeding...\nCreated backup in branch: backup_20240109_123456\n\nBacked up files:\n- src/main.py\n- tests/test_main.py\n\nFiles to be created:\nDirectory: ./src (will be created)\nFile: ./src/main.py (exists)\nFile: ./src/utils.py (will be created)\n\nNote: Original state backed up in branch: backup_20240109_123456\nProject structure created successfully!\n```\n\n#### Quick Restore\nUse the --restore flag to quickly restore from the most recent backup:\n\n```bash\n# Restore from last backup\nmarkdown2code convert input.md --restore\n```\n\nExample restore output:\n```\nRestored 3 files from last backup: backup_20240109_123456\n\nRestored files:\n- src/main.py\n- src/utils.py\n- tests/test_main.py\n```\n\n#### Manual Backup Management\nFor more control over backups:\n\n```bash\n# List all backups (newest first)\nmarkdown2code backup list\n\n# Show backup details\nmarkdown2code backup info backup_20240109_123456\n\n# Restore specific backup\nmarkdown2code backup restore backup_20240109_123456\n\n# Delete old backup\nmarkdown2code backup delete backup_20240109_123456\n```\n\n## Troubleshooting\n\n\n### Backup and Restore Issues\n\n1. Quick Restore Fails\n```bash\n# Check available backups\nmarkdown2code backup list\n\n# Try manual restore if needed\nmarkdown2code backup restore BACKUP_NAME\n```\n\n2. No Backups Found\n```bash\n# Check if directory is a git repository\ngit status\n\n# Initialize if needed\ngit init\n\n# Create initial backup\nmarkdown2code convert input.md --backup\n```\n\n3. Restore Conflicts\n```bash\n# Preview changes first\nmarkdown2code convert input.md --preview --restore\n\n# Force restore if needed\nmarkdown2code convert input.md --force --restore\n```\n\n\n### Best Practices\n\n1. Create descriptive backup messages:\n```bash\nmarkdown2code backup create --message \"Added new API endpoints\"\n```\n\n2. Backup before major changes:\n```bash\nmarkdown2code backup create --message \"Pre-refactor backup\"\n```\n\n3. Regular backups of specific files:\n```bash\nmarkdown2code backup create --files src/* --message \"Source code backup\"\n```\n\n4. Check backup status:\n```bash\nmarkdown2code backup list\nmarkdown2code backup info BACKUP_NAME\n```\n\n\n### Backup Issues\n\n1. Restore Fails\n```bash\n# Check if working directory is clean\ngit status\n\n# Force clean working directory\ngit reset --hard\ngit clean -fd\n\n# Try restore again\nmarkdown2code backup restore BACKUP_NAME\n```\n\n2. Backup Creation Fails\n```bash\n# Check if git is initialized\ngit status\n\n# Initialize if needed\ngit init\n\n# Try backup again\nmarkdown2code backup create\n```\n\n3. Backup Conflicts\n```bash\n# List all backups\nmarkdown2code backup list\n\n# Check specific backup\nmarkdown2code backup info BACKUP_NAME\n\n# Delete problematic backup if needed\nmarkdown2code backup delete BACKUP_NAME\n```\n\n2. Run tests:\n```bash\npytest\npytest --cov=markdown2code\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development guidelines.\n\n## Troubleshooting\n\n### Common Issues\n\n1. File Conflicts\n```bash\n# Use preview to check conflicts\nmarkdown2code input.md --preview\n\n# Force overwrite if needed\nmarkdown2code input.md --force\n```\n\n2. Configuration Issues\n```bash\n# Create fresh configuration\nmarkdown2code --create-config\n\n# Use verbose logging\nmarkdown2code input.md --verbose\n```\n\n3. Permission Issues\n```bash\n# Check file permissions\nls -l output_dir\n\n# Fix shell script permissions\nchmod +x output_dir/*.sh\n```\n\n## License\n\nThis project is licensed under the Apache License - see the [LICENSE](LICENSE) file for details.\n\n\n\n## AI Chat Example\n\nHere's an example of converting an AI chat into a working project:\n\n1. Save this AI chat conversation as `chat.md`:\n\n````markdown\n# React Todo App Development Chat\nProject structure suggested by AI:\n```markdown\ntodo-app/\n\u251c\u2500\u2500 public/\n\u2502 \u2514\u2500\u2500 index.html\n\u251c\u2500\u2500 src/\n\u2502 \u251c\u2500\u2500 components/\n\u2502 \u2502 \u251c\u2500\u2500 TodoList.js\n\u2502 \u2502 \u2514\u2500\u2500 TodoItem.js\n\u2502 \u251c\u2500\u2500 App.js\n\u2502 \u2514\u2500\u2500 index.js\n\u2514\u2500\u2500 package.json\n```\n\nThe AI suggested this HTML:\n```html\n# public/index.html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Todo App</title>\n</head>\n<body>\n <div id=\"root\"></div>\n</body>\n</html>\n```\n...\n````\n[chat.md](chat.md)\n\n2. Convert the chat to a project:\n\n3. Preview what will be created\n```bash\nmarkdown2code chat.md --preview --output todo-app\n```\nOutput:\n```bash\nPreview of files to be created:\n\nDirectories:\n- todo-app/todo-app (will be created)\n- todo-app/public (will be created)\n- todo-app/src (will be created)\n- todo-app/components (will be created)\n\nFiles:\n- todo-app/README.md (will be created)\n- todo-app/public/index.html (will be created)\n- todo-app/src/App.js (will be created)\n- todo-app/src/components/TodoList.js (will be created)\n- todo-app/src/components/TodoItem.js (will be created)\n- todo-app/src/index.js (will be created)\n- todo-app/package.json (will be created)\n```\n\n# Create the project\n```bash\nmarkdown2code chat.md --output todo-app\n```\n```\n2024-11-20 16:10:55,512 - markdown2code.converter - INFO - \nFiles to be created:\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - Directory: todo-app/todo-app (will be created)\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - Directory: todo-app/public (will be created)\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - Directory: todo-app/src (will be created)\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - Directory: todo-app/components (will be created)\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/README.md (will be created)\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/public/index.html (will be created)\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/src/App.js (will be created)\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/src/components/TodoList.js (will be created)\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/src/components/TodoItem.js (will be created)\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/src/index.js (will be created)\n2024-11-20 16:10:55,513 - markdown2code.converter - INFO - File: todo-app/package.json (will be created)\n2024-11-20 16:10:55,514 - markdown2code.converter - INFO - Creating file: todo-app/README.md\n2024-11-20 16:10:55,514 - markdown2code.converter - INFO - Creating file: todo-app/public/index.html\n2024-11-20 16:10:55,515 - markdown2code.converter - INFO - Creating file: todo-app/src/App.js\n2024-11-20 16:10:55,515 - markdown2code.converter - INFO - Creating file: todo-app/src/components/TodoList.js\n2024-11-20 16:10:55,515 - markdown2code.converter - INFO - Creating file: todo-app/src/components/TodoItem.js\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - Creating file: todo-app/src/index.js\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - Creating file: todo-app/package.json\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - \nCreated files:\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - README.md\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - package.json\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - public/index.html\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - src/App.js\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - src/components/TodoItem.js\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - src/components/TodoList.js\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - - src/index.js\n2024-11-20 16:10:55,516 - markdown2code.converter - INFO - \nProject structure created successfully!\n```\n\n\n3. Run the project:\n```bash\ncd todo-app\nnpm install\nnpm start\n```\n```bash\npip install -e . && python -m markdown2code server --host localhost --port 5000\npython -m markdown2code server --host localhost --port 5000\nmarkdown2code server --host localhost --port 5001 --output test_output\nmarkdown2code server --host localhost --port 5000\n```\n\n\n## TESTS\n\n```bash\npython -m markdown2code convert test_python_files.txt --output test_output\n```\n\nOutput\n\n```bash\n2024-11-20 20:28:04,455 - markdown2code.converter - INFO - Creating file: test_output/tests/conftest.py\n2024-11-20 20:28:04,455 - markdown2code.converter - INFO - Creating file: test_output/tests/test_api.py\n2024-11-20 20:28:04,455 - markdown2code.converter - INFO - \nCreated files:\n2024-11-20 20:28:04,455 - markdown2code.converter - INFO - - tests/conftest.py\n2024-11-20 20:28:04,455 - markdown2code.converter - INFO - - tests/test_api.py\n2024-11-20 20:28:04,455 - markdown2code.converter - INFO - \nProject structure created successfully!\n```\n",
"bugtrack_url": null,
"license": "Apache",
"summary": "Convert markdown files into organized project structures with code files",
"version": "2.8.0",
"project_urls": {
"Homepage": "https://github.com/plain-mark/markdown2code"
},
"split_keywords": [
"markdown",
" code generation",
" project structure",
" development tools"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1e4b8f726ce3b4cc79063783eb2446dfaf9bf5675b0d3cd7507f6fbab6ca0104",
"md5": "63be9ddd25ae21f79a91ffd608094ff1",
"sha256": "0b8e24d3b777930609033f423692a5d9c440f0e0100cc362c12f3cbe04e3e0be"
},
"downloads": -1,
"filename": "markdown2code-2.8.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "63be9ddd25ae21f79a91ffd608094ff1",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6",
"size": 23113,
"upload_time": "2024-11-20T23:34:57",
"upload_time_iso_8601": "2024-11-20T23:34:57.306219Z",
"url": "https://files.pythonhosted.org/packages/1e/4b/8f726ce3b4cc79063783eb2446dfaf9bf5675b0d3cd7507f6fbab6ca0104/markdown2code-2.8.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "62ec1f453abca8c50e4897135cb6733916ab1c6b86dc0db75ad7d966e844ef97",
"md5": "a4d0b0707375c9a9d0a06b60d7520643",
"sha256": "c3ed80649e7c306e98b373620b4c98eef4f88464dbe5935a4787a1cc3ef71928"
},
"downloads": -1,
"filename": "markdown2code-2.8.0.tar.gz",
"has_sig": false,
"md5_digest": "a4d0b0707375c9a9d0a06b60d7520643",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 28001,
"upload_time": "2024-11-20T23:34:59",
"upload_time_iso_8601": "2024-11-20T23:34:59.313898Z",
"url": "https://files.pythonhosted.org/packages/62/ec/1f453abca8c50e4897135cb6733916ab1c6b86dc0db75ad7d966e844ef97/markdown2code-2.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-20 23:34:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "plain-mark",
"github_project": "markdown2code",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "setuptools",
"specs": [
[
">=",
"42.0.0"
]
]
},
{
"name": "wheel",
"specs": [
[
">=",
"0.37.0"
]
]
},
{
"name": "pathlib",
"specs": [
[
">=",
"1.0.1"
]
]
},
{
"name": "pytest",
"specs": [
[
">=",
"7.0.0"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
">=",
"4.0.0"
]
]
},
{
"name": "PyYAML",
"specs": [
[
">=",
"6.0.0"
]
]
},
{
"name": "Flask",
"specs": [
[
">=",
"2.3.3"
]
]
}
],
"lcname": "markdown2code"
}