Skip to content

Commit 662ca9c

Browse files
committed
feat: update documentation, fix UI bugs
1 parent 6147ba8 commit 662ca9c

15 files changed

Lines changed: 1033 additions & 493 deletions

‎.github/scripts/build-docs.py‎

Lines changed: 92 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -138,72 +138,98 @@ def md_to_html(md):
138138
html.append(convert_table(rows))
139139
continue
140140

141-
# Ordered lists
142-
olm = re.match(r'^\s*\d+\.\s+(.+)$', line)
143-
if olm:
144-
items = []
145-
while i < len(lines) and re.match(r'^\s*\d+\.\s+', lines[i]):
146-
item_text = re.sub(r'^\s*\d+\.\s+', '', lines[i])
147-
item_html = inline_format(item_text)
148-
i += 1
149-
extra = []
150-
while i < len(lines):
151-
s = lines[i].lstrip()
152-
indent = len(lines[i]) - len(s)
153-
if indent >= 3 and s.startswith('```'):
154-
ch, i = consume_code(lines, i)
155-
extra.append(ch)
156-
elif indent >= 3 and s.startswith('> '):
157-
extra.append(f'<blockquote>{inline_format(s[2:])}</blockquote>')
158-
i += 1
159-
elif lines[i].strip() == '':
160-
i += 1
161-
continue
162-
elif indent >= 3 and s.strip():
163-
extra.append(inline_format(s))
164-
i += 1
165-
else:
166-
break
167-
items.append(f'<li>{" ".join(extra) if item_html == "" else item_html}{"".join(extra) if item_html != "" else ""}</li>')
168-
# Fix: combine item_html with extra
169-
fixed_items = []
170-
for item in items:
171-
fixed_items.append(item)
172-
html.append('<ol>\n' + '\n'.join(items) + '\n</ol>')
173-
continue
141+
# Lists (ordered and unordered) — stack-based recursive nesting
142+
def is_list_item(ln):
143+
return bool(re.match(r'^(\s*)(?:\d+\.|[-*+])\s+', ln))
144+
145+
def item_indent(ln):
146+
m = re.match(r'^(\s*)', ln)
147+
return len(m.group(1)) if m else 0
148+
149+
def item_tag(ln):
150+
"""Return 'ol' for ordered, 'ul' for unordered."""
151+
stripped = ln.lstrip()
152+
return 'ol' if re.match(r'^\d+\.\s+', stripped) else 'ul'
153+
154+
def item_text_content(ln):
155+
return re.sub(r'^\s*(?:\d+\.|[-*+])\s+', '', ln)
174156

175-
# Unordered lists
176-
ulm = re.match(r'^[\s]*[-*+]\s+', line)
177-
if ulm:
178-
items = []
179-
while i < len(lines) and re.match(r'^[\s]*[-*+]\s+', lines[i]):
180-
item_text = re.sub(r'^[\s]*[-*+]\s+', '', lines[i])
181-
item_html = inline_format(item_text)
157+
def consume_list(lines, start, base_indent):
158+
"""Recursively parse a list starting at `start` with `base_indent`.
159+
Returns (html_string, next_line_index)."""
160+
i = start
161+
tag = item_tag(lines[i])
162+
parts = [f'<{tag}>']
163+
while i < len(lines):
164+
ln = lines[i]
165+
if not ln.strip():
166+
# blank line — peek ahead to see if list continues
167+
j = i + 1
168+
while j < len(lines) and not lines[j].strip():
169+
j += 1
170+
if j < len(lines) and is_list_item(lines[j]) and item_indent(lines[j]) >= base_indent:
171+
i = j
172+
continue
173+
break
174+
if not is_list_item(ln):
175+
break
176+
ind = item_indent(ln)
177+
if ind < base_indent:
178+
break
179+
if ind > base_indent:
180+
# deeper — recurse as nested list inside current <li>
181+
nested_html, i = consume_list(lines, i, ind)
182+
parts.append(nested_html)
183+
continue
184+
# Same indent — new sibling list item
185+
# Close previous <li> if open
186+
if parts[-1] != f'<{tag}>':
187+
parts.append('</li>')
188+
text = inline_format(item_text_content(ln))
189+
parts.append(f'<li>{text}')
182190
i += 1
183-
extra = []
191+
# Consume continuation content (code blocks, blockquotes, plain text)
184192
while i < len(lines):
185-
s = lines[i].lstrip()
186-
indent = len(lines[i]) - len(s)
187-
if indent >= 3 and s.startswith('```'):
193+
cont = lines[i]
194+
if not cont.strip():
195+
# blank — check if continuation follows
196+
j = i + 1
197+
while j < len(lines) and not lines[j].strip():
198+
j += 1
199+
if j < len(lines):
200+
cind = item_indent(lines[j]) if is_list_item(lines[j]) else (len(lines[j]) - len(lines[j].lstrip()))
201+
if cind > base_indent:
202+
i = j
203+
continue
204+
break
205+
s = cont.lstrip()
206+
cind = len(cont) - len(s)
207+
if is_list_item(cont) and item_indent(cont) > base_indent:
208+
nested_html, i = consume_list(lines, i, item_indent(cont))
209+
parts.append(nested_html)
210+
elif is_list_item(cont) and item_indent(cont) == base_indent:
211+
break
212+
elif cind > base_indent and s.startswith('```'):
188213
ch, i = consume_code(lines, i)
189-
extra.append(ch)
190-
elif indent >= 3 and s.startswith('> '):
191-
extra.append(f'<blockquote>{inline_format(s[2:])}</blockquote>')
192-
i += 1
193-
elif lines[i].strip() == '':
214+
parts.append(ch)
215+
elif cind > base_indent and s.startswith('> '):
216+
parts.append(f'<blockquote>{inline_format(s[2:])}</blockquote>')
194217
i += 1
195-
continue
196-
elif indent >= 3 and s.strip():
197-
extra.append(inline_format(s))
218+
elif cind > base_indent and s.strip():
219+
parts.append(f'<p>{inline_format(s)}</p>')
198220
i += 1
199221
else:
200222
break
201-
items.append(f'<li>{" ".join(extra) if item_html == "" else item_html}{"".join(extra) if item_html != "" else ""}</li>')
202-
# Fix the combine
203-
combined = []
204-
for item in items:
205-
combined.append(item)
206-
html.append('<ul>\n' + '\n'.join(items) + '\n</ul>')
223+
# Close any open <li>
224+
if parts and parts[-1] != f'<{tag}>':
225+
parts.append('</li>')
226+
parts.append(f'</{tag}>')
227+
return '\n'.join(parts), i
228+
229+
if is_list_item(line):
230+
base = item_indent(line)
231+
list_html, i = consume_list(lines, i, base)
232+
html.append(list_html)
207233
continue
208234

209235
# Paragraph
@@ -554,27 +580,31 @@ def make_page(title, body, slug, nav_template, footer_template, pages, is_index=
554580
}}
555581
.table-wrap {{
556582
overflow-x: auto;
583+
-webkit-overflow-scrolling: touch;
557584
margin-bottom: 1.5rem;
558585
}}
559586
.table-wrap table {{
587+
width: max-content;
588+
min-width: 100%;
560589
margin-bottom: 0;
561590
}}
562591
.sidebar-content table {{
563-
width: 100%; border-collapse: collapse; font-size: 0.85rem;
592+
width: max-content; min-width: 100%;
593+
border-collapse: collapse; font-size: 0.85rem;
564594
margin-bottom: 1.5rem;
565595
}}
566596
.sidebar-content th {{
567597
font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
568598
text-transform: uppercase; letter-spacing: 0.06em;
569599
padding: 0.75rem 1rem; text-align: left; color: var(--muted);
570600
border-bottom: 1px solid var(--border); background: var(--bg3);
571-
white-space: normal;
572-
word-break: break-word; overflow-wrap: anywhere;
601+
white-space: nowrap;
573602
}}
574603
.sidebar-content td {{
575604
padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
576605
color: var(--muted);
577-
word-break: break-word;
606+
white-space: normal; word-break: normal;
607+
overflow-wrap: break-word; max-width: 300px;
578608
}}
579609
.sidebar-content img {{
580610
max-width: 100%; border-radius: 8px; border: 1px solid var(--border);

‎docs/community-supported-devices.html‎

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,27 +152,31 @@
152152
}
153153
.table-wrap {
154154
overflow-x: auto;
155+
-webkit-overflow-scrolling: touch;
155156
margin-bottom: 1.5rem;
156157
}
157158
.table-wrap table {
159+
width: max-content;
160+
min-width: 100%;
158161
margin-bottom: 0;
159162
}
160163
.sidebar-content table {
161-
width: 100%; border-collapse: collapse; font-size: 0.85rem;
164+
width: max-content; min-width: 100%;
165+
border-collapse: collapse; font-size: 0.85rem;
162166
margin-bottom: 1.5rem;
163167
}
164168
.sidebar-content th {
165169
font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
166170
text-transform: uppercase; letter-spacing: 0.06em;
167171
padding: 0.75rem 1rem; text-align: left; color: var(--muted);
168172
border-bottom: 1px solid var(--border); background: var(--bg3);
169-
white-space: normal;
170-
word-break: break-word; overflow-wrap: anywhere;
173+
white-space: nowrap;
171174
}
172175
.sidebar-content td {
173176
padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
174177
color: var(--muted);
175-
word-break: break-word;
178+
white-space: normal; word-break: normal;
179+
overflow-wrap: break-word; max-width: 300px;
176180
}
177181
.sidebar-content img {
178182
max-width: 100%; border-radius: 8px; border: 1px solid var(--border);
@@ -465,17 +469,28 @@ <h2 id="gki-devices-kernel-54-and-up">GKI Devices (Kernel 5.4 and up)</h2>
465469
<h2 id="contribution-guidelines">Contribution guidelines</h2>
466470
<p>To keep this list useful and reliable, please follow these rules when adding or updating entries:</p>
467471
<ul>
468-
<li>Add one device per row.</li>
469-
<li>Fill every column completely.</li>
470-
<li>Contributions should be honest, complete, and verifiable.</li>
471-
<li>Provide a direct downloadable kernel archive (<code>zip</code>, <code>tar</code>, <code>img</code>) or a downloadable kernel package; inexperienced users should not need to compile the kernel themselves.</li>
472-
<li>Provide the exact source code link for your Droidspaces kernel in the Kernel Source column.</li>
473-
<li>Document the exact <code>Baseband / Build</code> string (Mandatory for Non-GKI devices only).</li>
474-
<li>Specify the <code>Root Method</code> used, such as <code>Magisk</code>, <code>KernelSU</code>, <code>APatch</code> or <code>none</code>.(Compile only the kernel without adding any implementation methods; you need to patch <code>init_boot</code> yourself to achieve root.)</li>
475-
<li>Set <code>Status</code> to one of: <code>Working</code>, <code>Partial</code>, or <code>Unusable</code>.</li>
476-
<li>In Notes, include known quirks and issues, additional setup steps, and recommended workloads.</li>
477-
<li>Submit contributions through GitHub pull requests.</li>
478-
<li>Update entries when status changes, and keep the information current.</li>
472+
<li>Add one device per row.
473+
</li>
474+
<li>Fill every column completely.
475+
</li>
476+
<li>Contributions should be honest, complete, and verifiable.
477+
</li>
478+
<li>Provide a direct downloadable kernel archive (<code>zip</code>, <code>tar</code>, <code>img</code>) or a downloadable kernel package; inexperienced users should not need to compile the kernel themselves.
479+
</li>
480+
<li>Provide the exact source code link for your Droidspaces kernel in the Kernel Source column.
481+
</li>
482+
<li>Document the exact <code>Baseband / Build</code> string (Mandatory for Non-GKI devices only).
483+
</li>
484+
<li>Specify the <code>Root Method</code> used, such as <code>Magisk</code>, <code>KernelSU</code>, <code>APatch</code> or <code>none</code>.(Compile only the kernel without adding any implementation methods; you need to patch <code>init_boot</code> yourself to achieve root.)
485+
</li>
486+
<li>Set <code>Status</code> to one of: <code>Working</code>, <code>Partial</code>, or <code>Unusable</code>.
487+
</li>
488+
<li>In Notes, include known quirks and issues, additional setup steps, and recommended workloads.
489+
</li>
490+
<li>Submit contributions through GitHub pull requests.
491+
</li>
492+
<li>Update entries when status changes, and keep the information current.
493+
</li>
479494
</ul>
480495
<div class="doc-nav-buttons"><a href="troubleshooting.html" class="doc-nav-btn doc-nav-prev">← Troubleshooting</a><a href="nix-nixos.html" class="doc-nav-btn doc-nav-next">Getting started with NixOS on Droidspaces →</a></div>
481496
<p class="doc-copyright">&copy; 2026 Droidspaces &nbsp;·&nbsp; <a href="https://github.com/ravindu644/Droidspaces-OSS/blob/main/LICENSE" rel="noopener noreferrer">GPLv3</a> &nbsp;·&nbsp; by <a href="https://github.com/ravindu644" rel="noopener noreferrer">ravindu644</a> and <a href="https://github.com/ravindu644/Droidspaces-OSS/graphs/contributors" rel="noopener noreferrer">contributors</a>

0 commit comments

Comments
 (0)