How to create a "Document"?

I would like to learn how to create these Documents (Documents — JupyterLab 3.2.0 documentation) and register them with the registry. I have been looking at the code in “notebook-extension”, however it is complicated. Is there a relatively simple example of how this is done?