karthiks3000 / postman-doc-gen

Generate API documentation from a postman collection
MIT License
254 stars 45 forks source link

Collection description not formatting #29

Open JasonPoll opened 1 year ago

JasonPoll commented 1 year ago

First, thank you for postman-doc-gen, it's saved me a lot of time.

I'm wondering if there is any reason to not have the overall collection description markdown converted to HTML?

For my own purposes, I made this small modification to postman_doc_gen/document_generator.py and the top-level collection description converted from markdown to HTML as desired:

--- a/postman_doc_gen/document_generator.py
+++ b/postman_doc_gen/document_generator.py
@@ -53,7 +53,7 @@ class DocumentGenerator:
         self.api_collection = APICollectionModel()

         self.api_collection.name = json_collection[INFO][NAME]
-        self.api_collection.description = json_collection[INFO].get(DESCRIPTION, '')
+        self.api_collection.description = self.markdown_to_html(json_collection[INFO].get(DESCRIPTION, ''))
         self.api_collection.schema = json_collection[INFO][SCHEMA]
         self.api_collection.file_name = os.path.basename(collection_file_name)