I am looking to create tool that generates example usage of a requested python module.
Consider the following...
# Code Examples using os module in Python
## Example 1: Get the current working directory using the `os` module
import os
current_working_directory = os.getcwd()
print(f"Current working directory is: {current_working_directory}")
## Example 2: Change the current working directory using the `os` module
import os
path = "/your/desired/directory"
os.chdir(path)
Where # I want this parsed into a section.
Where ## I want this parsed into a markdown cell.
Where ''' I want this parsed into a code cell.
So to clarify, I want to paste a large text blob such as the example above, and the appropriate cells generated with the content expected.
Sorry if this is answered elsewhere, I wasn't sure what to search and tried quite a few before asking.
I asked chatgpt with no luck.
Did some google searches and found something called nbconvert. Doesn't seem to be what I need but could be wrong.