Here's a simplified version focusing on exactly what you need - a local site for managing Markdown tables with task tracking. I'll break it down into two main files:
- Frontend (HTML + CSS + JS in one file)
- Backend (Simple Python server)
1. index.html (Main Interface)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Task Tables</title>
<style>
/* Clean, minimal styling */
body {
font-family: system-ui, -apple-system, sans-serif;
max-width: 1200px;
margin: 20px auto;
padding: 20px;
}
.table-container {
margin: 20px 0;
padding: 15px;
border: 1px solid #eee;
border-radius: 8px;
}
table {
width: 100%;
border-collapse: collapse;
margin: 10px 0;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
.controls {
margin: 10px 0;
}
button {
padding: 5px 10px;
margin-right: 5px;
}
.done {
background: #e8f5e9;
}
</style>
</head>
<body>
<h1>Task Tables</h1>
<!-- Controls for new table creation -->
<div class="controls">
<button onclick="createNewTable()">Create New Table</button>
</div>
<!-- Container for all tables -->
<div id="tables"></div>
<script>
function createNewTable() {
const tablesDiv = document.getElementById('tables');
const tableContainer = document.createElement('div');
tableContainer.className = 'table-container';
// Add table title/name
const titleInput = document.createElement('input');
titleInput.type = 'text';
titleInput.placeholder = 'Table Name';
titleInput.style.marginBottom = '10px';
// Table controls
const controls = document.createElement('div');
controls.className = 'controls';
controls.innerHTML = `
<button onclick="addRow(this)">Add Row</button>
<button onclick="copyAsMd(this)">Copy as MD</button>
<button onclick="deleteTable(this)">Delete Table</button>
`;
// Create actual table
const table = document.createElement('table');
table.innerHTML = `
<thead>
<tr>
<th>Task</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody></tbody>
`;
tableContainer.appendChild(titleInput);
tableContainer.appendChild(controls);
tableContainer.appendChild(table);
tablesDiv.appendChild(tableContainer);
// Add first row automatically
addRow(controls.querySelector('button'));
}
function addRow(button) {
const table = button.closest('.table-container').querySelector('table');
const row = table.insertRow(-1);
row.innerHTML = `
<td><input type="text" placeholder="Task description"></td>
<td>
<select onchange="updateRowStatus(this)">
<option value="pending">⏳ Pending</option>
<option value="done">✅ Done</option>
</select>
</td>
<td>
<button onclick="deleteRow(this)">Delete</button>
</td>
`;
}
function updateRowStatus(select) {
const row = select.closest('tr');
row.className = select.value === 'done' ? 'done' : '';
}
function deleteRow(button) {
button.closest('tr').remove();
}
function deleteTable(button) {
if(confirm('Delete this table?')) {
button.closest('.table-container').remove();
}
}
function copyAsMd(button) {
const table = button.closest('.table-container').querySelector('table');
const title = button.closest('.table-container').querySelector('input').value;
let md = `# ${title}\n\n| Task | Status |\n|------|--------|\n`;
const rows = table.querySelectorAll('tbody tr');
rows.forEach(row => {
const task = row.querySelector('input').value;
const status = row.querySelector('select').value === 'done' ? '✅' : '⏳';
md += `| ${task} | ${status} |\n`;
});
navigator.clipboard.writeText(md);
alert('Copied to clipboard as Markdown!');
}
// Create first table automatically
createNewTable();
</script>
</body>
</html>
2. server.py (Simple Local Server)
from http.server import HTTPServer, SimpleHTTPRequestHandler
import socket
class LocalOnlyHandler(SimpleHTTPRequestHandler):
def do_GET(self):
if self.client_address[0] not in ['127.0.0.1', 'localhost']:
self.send_error(403, "Local access only")
return
return SimpleHTTPRequestHandler.do_GET(self)
def run(port=8000):
server_address = ('127.0.0.1', port)
httpd = HTTPServer(server_address, LocalOnlyHandler)
print(f"Server running at http://127.0.0.1:{port}")
print("Local access only - Ctrl+C to stop")
try:
httpd.serve_forever()
except KeyboardInterrupt:
print("\nShutting down server...")
httpd.server_close()
if __name__ == '__main__':
run()
How to Use:
- Save both files in the same directory
- Run the Python server:
python server.py
- Open
http://localhost:8000 in your browser
Features:
- ✅ Create multiple tables
- ✅ Add/remove rows
- ✅ Mark tasks as done/pending
- ✅ Copy table as Markdown
- ✅ Delete tables
- ✅ Local-only access (security)
- ✅ Zero dependencies
- ✅ Clean, simple interface
To extend this, you could add:
- Save/load tables from files
- Sort tasks
- Categories/tags
- Due dates
- Priority levels
Would you like me to add any of these features or modify anything in the current implementation?