MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / render

Function render

scripts/website/render_blog_prose_html.py:22–34  ·  view source on GitHub ↗
(paths, output)

Source from the content-addressed store, hash-verified

20
21
22def render(paths, output):
23 chunks = []
24 for path in paths:
25 _front_matter, body, _start = read_post(path)
26 rendered = body_to_html(body)
27 # A comment with the source path keeps the combined file debuggable;
28 # the extractor ignores comments.
29 chunks.append(f"<!-- {html.escape(path)} -->\n<article>\n{rendered}\n</article>")
30 os.makedirs(os.path.dirname(output) or ".", exist_ok=True)
31 with open(output, "w", encoding="utf-8") as fh:
32 fh.write("<!DOCTYPE html>\n<html><body>\n")
33 fh.write("\n\n".join(chunks))
34 fh.write("\n</body></html>\n")
35
36
37def expand_paths(paths):

Callers 1

mainFunction · 0.70

Calls 6

read_postFunction · 0.90
body_to_htmlFunction · 0.90
appendMethod · 0.65
writeMethod · 0.65
joinMethod · 0.65
escapeMethod · 0.45

Tested by

no test coverage detected