MCPcopy
hub / github.com/ChinaGodMan/UserScripts / generate_html_content

Function generate_html_content

utils/merge_change_history.py:33–48  ·  view source on GitHub ↗
(nation, js_path, greasyfork_id, script_directory, readme_html)

Source from the content-addressed store, hash-verified

31
32# 生产HTML内容
33def generate_html_content(nation, js_path, greasyfork_id, script_directory, readme_html):
34 with open(TEMPLATE, 'r', encoding='utf-8') as file:
35 html_template = file.read()
36 results = search_in_file(js_path, nation)
37 name = results.name_matches[0]
38 description = results.description_matches[0]
39 html_template = format_str(html_template)
40 html_content = html_template.format(
41 name=name,
42 description=description,
43 greasyfork_id=greasyfork_id,
44 filepath=js_path,
45 backuppath=script_directory,
46 readme_html=readme_html
47 )
48 return html_content
49
50
51scripts = read_json('docs/ScriptsPath.json')

Callers 1

Calls 2

search_in_fileFunction · 0.90
format_strFunction · 0.90

Tested by

no test coverage detected