1010from cloudquery .plugin_v3 import plugin_pb2_grpc
1111from structlog import wrap_logger
1212
13- from cloudquery .sdk .docs .generator import Generator
1413from cloudquery .sdk .internal .servers .discovery_v1 .discovery import DiscoveryServicer
1514from cloudquery .sdk .internal .servers .plugin_v3 import PluginServicer
16- from cloudquery .sdk .plugin .plugin import Plugin , TableOptions
17-
18- DOC_FORMATS = ["json" , "markdown" ]
15+ from cloudquery .sdk .plugin .plugin import Plugin
1916
2017_IS_WINDOWS = sys .platform == "win32"
2118
@@ -136,34 +133,10 @@ def run(self, args):
136133 help = "network to serve on. can be tcp or unix" ,
137134 )
138135
139- doc_parser = subparsers .add_parser (
140- "doc" ,
141- formatter_class = argparse .RawTextHelpFormatter ,
142- help = "Generate documentation for tables" ,
143- description = """Generate documentation for tables.
144-
145- If format is markdown, a destination directory will be created (if necessary) containing markdown files.
146- Example:
147- doc ./output
148-
149- If format is JSON, a destination directory will be created (if necessary) with a single json file called __tables.json.
150- Example:
151- doc --format json .
152- """ ,
153- )
154- doc_parser .add_argument ("directory" , type = str )
155- doc_parser .add_argument (
156- "--format" ,
157- type = str ,
158- default = "json" ,
159- help = "output format. one of: {}" .format ("," .join (DOC_FORMATS )),
160- )
161136 parsed_args = parser .parse_args (args )
162137
163138 if parsed_args .command == "serve" :
164139 self ._serve (parsed_args )
165- elif parsed_args .command == "doc" :
166- self ._generate_docs (parsed_args )
167140 else :
168141 parser .print_help ()
169142 sys .exit (1 )
@@ -185,16 +158,3 @@ def _serve(self, args):
185158
186159 def stop (self ):
187160 self ._server .stop (5 )
188-
189- def _generate_docs (self , args ):
190- generator = Generator (
191- self ._plugin .name (),
192- self ._plugin .get_tables (
193- options = TableOptions (
194- tables = ["*" ],
195- skip_tables = [],
196- skip_dependent_tables = False ,
197- )
198- ),
199- )
200- generator .generate (args .directory , args .format )
0 commit comments