From ba0c3d412898710197236cf37eb21adf2bbc66f5 Mon Sep 17 00:00:00 2001 From: Nanda Scott Date: Wed, 31 Oct 2018 13:05:59 -0400 Subject: [PATCH] Updated gen docs --- gen_docs.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/gen_docs.py b/gen_docs.py index 90141d3..a12b8d3 100644 --- a/gen_docs.py +++ b/gen_docs.py @@ -1,13 +1,7 @@ import sys import scrython import re -from scrython.bulk_data import * -from scrython.cards import * -from scrython.catalog import * -from scrython.rulings import * -from scrython.sets import * -from scrython.symbology import * -from types import FunctionType +import os def format_args(string, f): f.write('\n## Args\n\n|arg|type|description|\n|:---:|:---:|:---:|\n') @@ -89,6 +83,9 @@ These docs will likely not be as detailed as the official Scryfall Documentation functions = [x for x in dir(eval(_class)) if not x.startswith('_')] + if not os.path.exists('./docs/{}'.format(subpackage.__name__)): + os.makedirs('./docs/{}'.format(subpackage.__name__)) + with open('./docs/{}/{}.md'.format(subpackage.__name__, _class), 'w') as f: f.write('# **class** `{}.{}()`\n'.format(subpackage.__name__, _class)) f.write(intro) @@ -109,9 +106,26 @@ These docs will likely not be as detailed as the official Scryfall Documentation print('~~~~~~~~~~~~~~~~~~~~~~~~~~') if __name__ == '__main__': + from scrython.bulk_data import * main(scrython.bulk_data) + del scrython.bulk_data + + from scrython.cards import * main(scrython.cards) + del scrython.cards + + from scrython.catalog import * main(scrython.catalog) + del scrython.catalog + + from scrython.rulings import * main(scrython.rulings) + del scrython.rulings + + from scrython.sets import * main(scrython.sets) - main(scrython.symbology) \ No newline at end of file + del scrython.sets + + from scrython.symbology import * + main(scrython.symbology) + del scrython.symbology \ No newline at end of file