-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
93 lines (89 loc) · 4.53 KB
/
index.html
File metadata and controls
93 lines (89 loc) · 4.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GitHub Repo → Single Document</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>GitHub Repository to Single Document</h1>
<p>Enter a repository input such as <code>https://github.com/owner/repo</code> or <code>owner/repo.git</code>.</p>
<div class="controls">
<div class="control-group">
<label for="repoUrl">Repository Input</label>
<input type="text" id="repoUrl" placeholder="owner/repo.git or https://github.com/owner/repo" value="https://github.com/octocat/Hello-World" autocomplete="url">
</div>
<button id="fetchBtn">Fetch & Build Markdown</button>
</div>
<div class="optionsRow">
<label><input type="checkbox" id="includeToc">Include Markdown TOC</label>
<label><input type="checkbox" id="includeDataFiles">Include data/text logs (.csv/.tsv/.log/.env)</label>
<label><input type="checkbox" id="includeDotfiles">Include hidden dotfiles</label>
<label><input type="checkbox" id="enableMaxFileSize" checked>Limit max file size</label>
<label for="maxFileSizeKb">Max file size (KB)
<input class="sizeInput" type="number" id="maxFileSizeKb" min="10" max="5000" step="10" value="250">
</label>
</div>
<details class="advancedOptions">
<summary>Advanced (optional)</summary>
<div class="advancedGrid">
<label><input type="checkbox" id="allowShorthand" checked>Allow shorthand (owner/repo)</label>
<label><input type="checkbox" id="strictPreviewMode">Strict preview mode (disable raw HTML rendering)</label>
<label><input type="checkbox" id="detectBinaryBySample">Detect binary files by sampled bytes (skip likely binary)</label>
<label for="includePaths">Include paths (comma/newline patterns)
<input type="text" id="includePaths" autocomplete="off" placeholder="src/**,packages/*/src/**">
</label>
<label for="excludePaths">Exclude paths (comma/newline patterns)
<input type="text" id="excludePaths" autocomplete="off" placeholder="**/dist/**,**/*.min.js">
</label>
<label for="githubToken">GitHub token (temporary, session-only)
<input type="password" id="githubToken" autocomplete="off" placeholder="ghp_...">
</label>
<label for="githubTimeoutMs">GitHub timeout (ms)
<input class="sizeInput" type="number" id="githubTimeoutMs" min="1000" max="120000" step="500" placeholder="12000">
</label>
<label for="githubMaxRetries">GitHub max retries
<input class="sizeInput" type="number" id="githubMaxRetries" min="0" max="10" step="1" placeholder="2">
</label>
</div>
<p class="advancedWarning">Warning: this token is used in browser runtime requests and is not persisted by this app.</p>
</details>
<div id="status" role="status" aria-live="polite"></div>
<div id="resultContainer" class="hidden">
<h2>Combined Markdown Document</h2>
<div class="viewControls">
<label for="paneMode">View mode</label>
<select id="paneMode" aria-label="Choose output pane mode">
<option value="split">Split (Raw + Preview)</option>
<option value="raw">Raw only</option>
<option value="preview">Preview only</option>
</select>
</div>
<div class="outputGrid">
<div class="pane rawPane">
<h3>Raw Markdown</h3>
<textarea id="outputRaw" readonly wrap="off" aria-label="Raw markdown output"></textarea>
</div>
<div class="pane previewPane">
<h3>Preview</h3>
<div id="outputPreview" class="preview" aria-label="Rendered markdown preview" tabindex="0"></div>
</div>
</div>
<div class="stats" id="stats"></div>
<div class="actions">
<button id="downloadBtn">Download as .md</button>
<button id="copyBtn" type="button">Copy Markdown</button>
</div>
</div>
<script type="importmap">
{
"imports": {
"marked": "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js",
"dompurify": "https://cdn.jsdelivr.net/npm/dompurify/+esm"
}
}
</script>
<script type="module" src="js/app.js"></script>
</body>
</html>