Skip to content

Commit

Permalink
added visible subchapter view!
Browse files Browse the repository at this point in the history
  • Loading branch information
katsaii committed Jul 14, 2024
1 parent 36f6968 commit a73e4bc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions docs-gen/catlog/catlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,17 @@ def section_count(sections):
with list_element():
write_contents_section(sb, section, 0)

def write_main(sb, chapter):
def write_main(sb, book, chapter):
with sb.main():
with sb.article():
with sb.heading(0, class_="chapter-title"):
sb.write(chapter.title)
for subchapter in chapter.subchapters:
with sb.tag("div", class_="subchapter-title"):
sb.write("↳ ")
uid = title_to_uid(book.title, subchapter.title)
with sb.link(uid_to_path(uid, sb.EXT), class_="subchapter-title"):
sb.write(subchapter.title)
if chapter.overview:
write_richtext(sb, chapter.overview)
for section in chapter.sections:
Expand Down Expand Up @@ -248,7 +254,7 @@ def compile_chapter_pages(chapters):
with sb.article(id="chapter-content"):
write_chapters(sb, book, chapter)
write_contents(sb, chapter)
write_main(sb, chapter)
write_main(sb, book, chapter)
write_footer(sb, meta)
pages.append((path, sb.content))
if chapter.subchapters:
Expand Down
3 changes: 1 addition & 2 deletions docs-gen/catlog/gml.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,7 @@ def script_name_to_module_name(module):
return name

def feather_name_to_type_name(typename):
if typename == None:
typenane = "Any"
typename = "Any" if typename == None else typename
new_elements = []
for i, element in enumerate(typename.split(".")):
element = element.strip()
Expand Down
7 changes: 7 additions & 0 deletions docs-gen/catlog/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ def stab(self, **attrs):
z-index : 99;
}
.subchapter-title {
color : var(--c-fg-2);
font-family : var(--f-mono);
font-weight : bold;
font-size : 15pt;
}
@keyframes keyframes-fade {
from { background : var(--c-accent) }
}
Expand Down

0 comments on commit a73e4bc

Please sign in to comment.