'MKdocs: Fetch Data from REST API

I am trying to create to port old wiki pages to a centralized location. Some of the data however needs to fetched in runtime from a REST Server.

For this purpose I have found a hacky solution of using mkdocs-macros plugin. And then create a custom module in the main.py file where I am using the python requests module to perform simple HTTP GET requests and return the required data.

Is there a better/proper way to do the above functionality in mkdocs?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source