In terms of generating Markua locally, the best thing to do is probably to just treat it like Markdown, and either use something like a Markdown extension for VSCode, or install and use pandoc to generate HTML. You won't get the Markua features, obviously, but the core of Markua is just Markdown, so for probably more than 90% of what you're typing, it will be exactly the same.
In fact, you could decide to make it start out 100% the same by adopting the following approach:
Create the book in GitHub or Dropbox mode. (If you know Git, choose GitHub.)
Start by writing the first draft of your book in the subset of Markua which is 100% compatible with Markdown (basically, just write Markdown, and don't use inline HTML: this is valid Markua, just not as feature-rich as it could be).
Use whatever Markdown tool to preview locally.
Use Leanpub to generate the ebook as you go.
Paste HTML from Leanpub or from the tool you are using in #2 into Substack.
After the book is complete, then do a decoration pass as part of an editing pass, where you add index entries, crosslinks, and the various other features that Markua adds to Markdown.
This way has a number of advantages:
You can write on your computer.
You can preview on your computer using any Markdown-capable tool, and it's almost instant.
You can publish in-progress on Leanpub with one click.
You can export your HTML from your own computer or from Leanpub onto Substack.
Sticking to the subset of Markua that is 100% identical to Markdown (i.e. just use Markdown without inline HTML) means there is less to learn, so there is less temptation to get distracted and more temptation to just write, and not format or procrastinate.
Adding the Markua features as part of a decoration pass at the end means that your book gets a good edit, which you may otherwise not force yourself to do when self-publishing!