(nation, js_path, greasyfork_id, script_directory, readme_html)
| 31 | |
| 32 | # 生产HTML内容 |
| 33 | def 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 | |
| 51 | scripts = read_json('docs/ScriptsPath.json') |
no test coverage detected