Help adding plugin to `mdformat`

I’m using mdformat for markdown formatting. I need to add the mdformat-tables plugin for handling tables. The latter is not packaged in nixpkgs, so I’ve done so with:

  mdformat-tables = with nixpkgs.python3Packages; buildPythonPackage rec {
    pname = "mdformat_tables";
    version = "0.4.1";

    src = fetchPypi {
      inherit pname version;
      sha256 = "sha256-MCTojp0p17i7B/1rWcnV3PFNIGASK+KeMOctJ7Zdfak=";

    propagatedBuildInputs = [ mdformat ];
    doCheck = false;

    meta = {
      description = "An mdformat plugin for rendering tables";

The problem I’m running into is when I include both nixpkgs.mdformat and the above derivation in a shell environment, mdformat cannot see the plugin. Is there a step I’m missing to make the plugin visible to mdformat? I understand visible is subjective, but I suppose in this case I mean importable (i.e. mdformat can import mdformat-tables).

How are you adding them to the shell env? If you don’t use python.withPackages they will not end up in the site-packages of the same python instance and therefore not be able to see each other. I gave a more detailed explanation on the topic here the other day, don’t feel like repeating myself this time: NixOS + IntelliJ + Python

I should really start a blog.

If mdformat’s plugin system works anything like the plugin systems I’m used to, that should fix the problem, assuming you use mdformat via a python script and not as a binary?