368426f0f4
- Added `app.py` with Flask backend for real-time Markdown to Word conversion using python-docx - Implemented `convert_md_to_docx` function with support for headings, tables, code blocks, images, and blockquote styling - Created `templates/index.html` with responsive UI featuring dual-panel editor/preview layout - Added `static/script.js` for client-side functionality including live preview, toolbar buttons, and export workflow - Enhanced `static/style.css` with modern styling for editor, preview, and settings panels - Updated `README.md` to document features, usage, and customization options - Added `requirements.txt` with dependencies: Flask, python-docx, markdown - Implemented auto-captioning for images and tables with sequential numbering - Added table pagination support with header repetition across page breaks - Integrated configuration settings panel for customizing styles, captions, and document options
175 lines
9.7 KiB
HTML
175 lines
9.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>GhostEditor - Markdown to Word Converter</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
</head>
|
|
<body>
|
|
<div class="container-fluid">
|
|
<header class="bg-primary text-white p-3 mb-4">
|
|
<h1 class="mb-0"><i class="fas fa-file-word"></i> GhostEditor</h1>
|
|
<p class="mb-0">Real-time Markdown to Word converter with advanced styling and auto-captioning</p>
|
|
</header>
|
|
|
|
<div class="row">
|
|
<!-- Settings Panel -->
|
|
<div class="col-md-3">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5><i class="fas fa-cog"></i> Document Settings</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="mb-3">
|
|
<label class="form-label">Document Title</label>
|
|
<input type="text" id="docTitle" class="form-control" placeholder="Enter document title">
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label class="form-label">Default Text Style</label>
|
|
<select id="defaultStyle" class="form-select">
|
|
<option value="Normal">Normal</option>
|
|
<option value="Heading1">Heading 1</option>
|
|
<option value="Heading2">Heading 2</option>
|
|
<option value="Heading3">Heading 3</option>
|
|
<option value="Quote">Quote</option>
|
|
<option value="Code">Code</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label class="form-label">Auto Caption Settings</label>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="autoCaptionImages" checked>
|
|
<label class="form-check-label" for="autoCaptionImages">Auto-caption images</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="autoCaptionTables" checked>
|
|
<label class="form-check-label" for="autoCaptionTables">Auto-caption tables</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="autoCaptionFigures" checked>
|
|
<label class="form-check-label" for="autoCaptionFigures">Auto-caption figures</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label class="form-label">Table Pagination</label>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="tablePagination" checked>
|
|
<label class="form-check-label" for="tablePagination">Enable table pagination</label>
|
|
</div>
|
|
</div>
|
|
|
|
<button id="exportBtn" class="btn btn-success w-100">
|
|
<i class="fas fa-file-export"></i> Export to Word
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mt-3">
|
|
<div class="card-header">
|
|
<h5><i class="fas fa-list"></i> Style Preview</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div id="stylePreview">
|
|
<p class="text-muted">Select text to apply styles</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Editor and Preview -->
|
|
<div class="col-md-9">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="card">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<h5><i class="fas fa-edit"></i> Markdown Editor</h5>
|
|
<div class="btn-group" role="group">
|
|
<button class="btn btn-outline-secondary btn-sm" id="boldBtn"><b>B</b></button>
|
|
<button class="btn btn-outline-secondary btn-sm" id="italicBtn"><i>I</i></button>
|
|
<button class="btn btn-outline-secondary btn-sm" id="headingBtn">H1</button>
|
|
<button class="btn btn-outline-secondary btn-sm" id="listBtn"><i class="fas fa-list"></i></button>
|
|
<button class="btn btn-outline-secondary btn-sm" id="imageBtn"><i class="fas fa-image"></i></button>
|
|
</div>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
<textarea id="markdownInput" class="form-control border-0 rounded-0" rows="20" placeholder="Enter your Markdown here..."></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<div class="card">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<h5><i class="fas fa-eye"></i> Real-time Preview</h5>
|
|
<div class="form-check form-switch">
|
|
<input class="form-check-input" type="checkbox" id="previewToggle" checked>
|
|
<label class="form-check-label" for="previewToggle">Live Preview</label>
|
|
</div>
|
|
</div>
|
|
<div class="card-body preview-container">
|
|
<div id="previewOutput"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Block Styling Panel -->
|
|
<div class="card mt-3">
|
|
<div class="card-header">
|
|
<h5><i class="fas fa-paint-brush"></i> Block Styling</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<label class="form-label">Current Block Type</label>
|
|
<select id="blockType" class="form-select">
|
|
<option value="paragraph">Paragraph</option>
|
|
<option value="heading">Heading</option>
|
|
<option value="list">List</option>
|
|
<option value="code">Code Block</option>
|
|
<option value="table">Table</option>
|
|
<option value="image">Image</option>
|
|
<option value="quote">Quote</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label class="form-label">Apply Style</label>
|
|
<select id="applyStyle" class="form-select">
|
|
<option value="Normal">Normal</option>
|
|
<option value="Heading1">Heading 1</option>
|
|
<option value="Heading2">Heading 2</option>
|
|
<option value="Heading3">Heading 3</option>
|
|
<option value="Quote">Quote</option>
|
|
<option value="Code">Code</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label class="form-label">Custom Caption</label>
|
|
<input type="text" id="customCaption" class="form-control" placeholder="Enter custom caption">
|
|
</div>
|
|
</div>
|
|
<div class="mt-3">
|
|
<button id="applyStyleBtn" class="btn btn-primary">
|
|
<i class="fas fa-check"></i> Apply Style
|
|
</button>
|
|
<button id="applyCaptionBtn" class="btn btn-info">
|
|
<i class="fas fa-font"></i> Apply Caption
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
<script src="/static/script.js"></script>
|
|
</body>
|
|
</html> |