From e88d3b8483fcc563310cc9e18e49797c1f2c4a5b Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 11 Sep 2023 20:41:34 -0500 Subject: [PATCH] here we go... almost --- res/docpdf/make_paper.py | 42 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/res/docpdf/make_paper.py b/res/docpdf/make_paper.py index ec096c0b9..79971b0cd 100644 --- a/res/docpdf/make_paper.py +++ b/res/docpdf/make_paper.py @@ -82,15 +82,32 @@ if __name__ == "__main__": # perform sort file_list.sort(key=sort_func) + first = True + for my_file in file_list: + pageLink = my_file.replace(os.path.sep, "__") + + if pageLink.endswith("__doc__README.md"): + continue + with open(my_file, 'r') as md: LOGGER.info("processing file %s" % my_file) data = md.read() # retrieve title pageTitle = data.partition('\n')[0].replace("# ","") - pageLink = my_file.replace(os.path.sep, "__"), - index += '
  • %s
  • ' % ( pageLink, pageTitle ) + + if pageLink.endswith("__README.md"): + if first: + first = False + else: + index += '' + + index += '
  • %s' % ( pageLink, pageTitle, pageLink ) + if pageLink.endswith("__README.md"): + index += '
      ' + else: + index += '' # perform link fixing data = re.sub(r'\[(.+?)\]\((.+?)\)', fix_links, data) @@ -103,7 +120,7 @@ if __name__ == "__main__": ) # finish index - index += '
    ' + index += '
  • ' # build html final_html = (''' @@ -147,7 +164,7 @@ if __name__ == "__main__": margin-right: 4pt; list-style-type: none; } - li:before { + ul > li:before { content: '-'; padding-right: 3pt; } @@ -204,6 +221,23 @@ if __name__ == "__main__": font-weight: normal; color: #555; } + a.indexItemPre { + color: #000; + text-decoration: none; + letter-spacing: .01em; + } + a.indexItemPre[href^='#']:after { + content: ''; + } + a.indexItem { + float: right; + overflow: hidden; + } + a.indexItem[href^='#']:after { + content: target-counter(attr(href),page); + color: #000; + font-size: 11pt; + } #cover { height: 100%%; text-align: center;