feat: MD-style popup print for strategy doc and checklist

Open clean white document in new tab with auto print dialog instead of printing the dark hub page.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-06 03:28:44 +08:00
parent 0d5b20c0db
commit 22b2db34fc
6 changed files with 245 additions and 105 deletions
+10
View File
@@ -7,6 +7,7 @@ from lib.hub.hub_strategy_lib import (
load_strategy_payload,
strategy_meta_payload,
build_export_html,
build_print_html,
)
@@ -34,6 +35,15 @@ class TestHubStrategyLib(unittest.TestCase):
self.assertIn("Gate", html)
self.assertIn("", html)
def test_print_html_doc_and_checklist(self):
doc = build_print_html("binance", "doc")
cl = build_print_html("binance", "checklist")
self.assertIn("window.print", doc)
self.assertIn("window.print", cl)
self.assertIn("币安", doc)
self.assertIn("开仓检查清单", cl)
self.assertIn("", cl)
if __name__ == "__main__":
unittest.main()