diff --git "a/data/2.PostgreSQL\344\270\255\351\230\266/1.PostgreSQL\346\225\260\346\215\256\345\272\223\347\232\204\345\237\272\346\234\254\347\273\223\346\236\204/6.\346\225\260\346\215\256\345\272\223\346\211\251\345\261\225/config.json" "b/data/2.PostgreSQL\344\270\255\351\230\266/1.PostgreSQL\346\225\260\346\215\256\345\272\223\347\232\204\345\237\272\346\234\254\347\273\223\346\236\204/6.\346\225\260\346\215\256\345\272\223\346\211\251\345\261\225/config.json" index fb9d9e325f740a96fd609edacecde0adc781d4fb..05176beac9db4af28f710f8d822430b509df3dac 100644 --- "a/data/2.PostgreSQL\344\270\255\351\230\266/1.PostgreSQL\346\225\260\346\215\256\345\272\223\347\232\204\345\237\272\346\234\254\347\273\223\346\236\204/6.\346\225\260\346\215\256\345\272\223\346\211\251\345\261\225/config.json" +++ "b/data/2.PostgreSQL\344\270\255\351\230\266/1.PostgreSQL\346\225\260\346\215\256\345\272\223\347\232\204\345\237\272\346\234\254\347\273\223\346\236\204/6.\346\225\260\346\215\256\345\272\223\346\211\251\345\261\225/config.json" @@ -1,6 +1,13 @@ { "node_id": "pg-d2b6e840cfad44a2aa357cfee56d437d", - "keywords": ["数据库扩展", "数据库插件", "extension"], + "keywords": [ + "数据库扩展", + "数据库插件", + "extension" + ], "children": [], - "export": [] + "export": [ + "language.json", + "extension.json" + ] } \ No newline at end of file diff --git "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/1.\350\201\232\345\220\210\345\222\214\345\210\206\347\273\204/config.json" "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/1.\350\201\232\345\220\210\345\222\214\345\210\206\347\273\204/config.json" index 7d7c5861d26c74d5aa385ac6fc74b3e860ebea83..d23aa9c436d02697282f817e66decfff21183805 100644 --- "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/1.\350\201\232\345\220\210\345\222\214\345\210\206\347\273\204/config.json" +++ "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/1.\350\201\232\345\220\210\345\222\214\345\210\206\347\273\204/config.json" @@ -1,6 +1,11 @@ { "node_id": "pg-3a87b0dbead643e58f1ff1d93acd80cc", - "keywords": ["group by", "分组"], + "keywords": [ + "group by", + "分组" + ], "children": [], - "export": [] + "export": [ + "salary.json" + ] } \ No newline at end of file diff --git "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/2.\350\277\236\346\216\245\346\237\245\350\257\242/config.json" "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/2.\350\277\236\346\216\245\346\237\245\350\257\242/config.json" index 26d2258e02364b4fec81e91f82f5459755a52964..5a941b68e7a35bc572f8387babc2e5c6e65278a5 100644 --- "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/2.\350\277\236\346\216\245\346\237\245\350\257\242/config.json" +++ "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/2.\350\277\236\346\216\245\346\237\245\350\257\242/config.json" @@ -1,6 +1,11 @@ { "node_id": "pg-458d5d590ea64188847b45d8e6343f83", - "keywords": ["join", "连接查询"], + "keywords": [ + "join", + "连接查询" + ], "children": [], - "export": [] + "export": [ + "customer_order.json" + ] } \ No newline at end of file diff --git "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/5.CTE/config.json" "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/5.CTE/config.json" index 146c831e3d56a84a9dcf0d2765175fedc5f5f888..c916f507b8a52264864fc36add1e9738dc20c7d2 100644 --- "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/5.CTE/config.json" +++ "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/5.CTE/config.json" @@ -1,6 +1,12 @@ { "node_id": "pg-6beb084543204f4f9d87930c0a6c5707", - "keywords": ["common table expression", "cte", "recursive"], + "keywords": [ + "common table expression", + "cte", + "recursive" + ], "children": [], - "export": [] + "export": [ + "to_root.json" + ] } \ No newline at end of file diff --git "a/data/3.PostgreSQL\351\253\230\351\230\266/1.\351\233\206\347\276\244\345\222\214\345\244\215\345\210\266/3.fdw/config.json" "b/data/3.PostgreSQL\351\253\230\351\230\266/1.\351\233\206\347\276\244\345\222\214\345\244\215\345\210\266/3.fdw/config.json" index 688ad40557c4e3884ef42ba6580d36330a9eb7fb..f668756391166dc2ee48363ffa12cec6d276ea8a 100644 --- "a/data/3.PostgreSQL\351\253\230\351\230\266/1.\351\233\206\347\276\244\345\222\214\345\244\215\345\210\266/3.fdw/config.json" +++ "b/data/3.PostgreSQL\351\253\230\351\230\266/1.\351\233\206\347\276\244\345\222\214\345\244\215\345\210\266/3.fdw/config.json" @@ -1,6 +1,11 @@ { "node_id": "pg-20a433f6ae65429f9b1a7f17c751ac01", - "keywords": ["外部数据连接", "fdw"], + "keywords": [ + "外部数据连接", + "fdw" + ], "children": [], - "export": [] + "export": [ + "fdw.json" + ] } \ No newline at end of file diff --git a/src/tree.py b/src/tree.py index ae5c7e5861641fa56461104badcfefcaecc8412a..b5a8cb26891d2283019c0347bc3bb1b5bdfef96f 100644 --- a/src/tree.py +++ b/src/tree.py @@ -306,13 +306,23 @@ class TreeWalker: def ensure_exercises(self, section_path): config = self.ensure_section_config(section_path) + flag = False for e in os.listdir(section_path): base, ext = os.path.splitext(e) _, source = os.path.split(e) if ext != ".md": continue - meta_path = os.path.join(section_path, base + ".json") + mfile = base + ".json" + meta_path = os.path.join(section_path, mfile) self.ensure_exercises_meta(meta_path, source) + export = config.get("export", []) + if mfile not in export: + export.append(mfile) + flag = True + config["export"] = export + + if flag: + dump_json(os.path.join(section_path, "config.json"), config, True, True) for e in config.get("export", []): full_name = os.path.join(section_path, e)