(schemafile, markdownfile)
| 556 | |
| 557 | |
| 558 | def main(schemafile, markdownfile): |
| 559 | with open(schemafile, 'r') as f: |
| 560 | schema = json.load(f) |
| 561 | |
| 562 | name = schema.get('rpc') or schema.get('notification') or schema.get('hook') |
| 563 | if name is None: |
| 564 | name = os.path.basename(schemafile).replace('.json', '') |
| 565 | # Outputs rpc title and synopsis with request parameters |
| 566 | generate_header(schema, name) |
| 567 | # Outputs command description with request parameter descriptions |
| 568 | generate_description(schema) |
| 569 | # Outputs other remaining sections before return value section |
| 570 | generate_body(schema) |
| 571 | # Outputs command response with response parameter descriptions |
| 572 | generate_return_value(schema) |
| 573 | # Outputs other remaining sections after return value section |
| 574 | generate_footer(schema, name) |
| 575 | |
| 576 | if markdownfile is None: |
| 577 | return |
| 578 | |
| 579 | |
| 580 | if __name__ == '__main__': |
no test coverage detected