retypeapp / retype

Retype is an ✨ ultra-high-performance✨ static site generator that builds a website based on simple text files.
https://retype.com
Other
1.01k stars 201 forks source link

Enhancement suggestion: VS Code extension for Preview #644

Open xPh03n1x opened 8 months ago

xPh03n1x commented 8 months ago

Hello,

I found Retype a couple of days and I am enjoying your product. Well done!

The editor is nice but it's always nice when you can directly see the "preview" of what you are writing. Lots of Markdown editors have such support and I am sure lots of people use it.

Expanding the Markdown components with additional components is commendable and it definitely enriches the app further. However, when a Markdown IDE with Preview is used and such components are present in the file, quite often the rendered preview is quite broken and doesn't even begin to cover the actual output the Retype app would produce.

I might be doing things wrong but I need one tab to the Components Wiki open at all times when writing my documents. I find myself switching to it and looking for the component I need all the time, and then "temp-saving" the document and checking the produced output in a browser. I'm sure I'll get used to the components with time (if I use it long enough), but I find it rather odd that I need to learn a separate group-set of components, usable in just one app. I hope you get my point correctly.

Given that VS Code is quite popular and extensions for it can be created rather easily (in lots of programming languages), I would like to suggest creating a VS Code extension for "Preview" that supports the syntax for the custom components. VS Code has Markdown preview built-in and I think you can extending it with an extension by adding additional regular expression for the custom components. This would effectively allow people to directly create their Retype articles in VS Code.

I looked through your repositories to try and help with that but it seems the project's files are closed-source and I couldn't find the components' files.

I hope this makes sense to you as much as it does to me.

geoffreymcgill commented 8 months ago

Hi @xPh03n1x. Thanks for the awesome feedback and suggestions! Happy to hear you are enjoying using Retype.

We are definitely interested in building out more WYSIWYG functionality with the editor and other tools, such as extending VSCode. It's a pretty high priority for us, although just difficult for us to invest in that development right at the moment.

As you mentioned, within VSCode you can open a Preview option by using command + shift + p on Mac or ctrl + shift + p on Windows. You can also open that Tab in a split view with the .md page source. Editing and saving the source .md file will automatically update the Preview view when using retype start.

xPh03n1x commented 8 months ago

As you mentioned, within VSCode you can open a Preview option by using command + shift + p on Mac or ctrl + shift + p on Windows. You can also open that Tab in a split view with the .md page source. Editing and saving the source .md file will automatically update the Preview view when using retype start.

Thanks for your reply, Mr. McGill !

The VS Code Preview works well when you are doing standard Markdown - you see the same thing as the end result. However, just like with any other Markdown editor, it suffers from the lack of support for your custom components, which are only available to the Retype "interpreter".

This results in the Preview being quite "garbled" (can't come up with a better word right now), sometimes even malformed because of custom components usage, and it differs from the end result quite a lot.

Further to the point, the constant switching between:

is (at the very least) counter-intuitive, time consuming, and counter-productive. That's a bit contradictory to the tagline "write more, stress less"

I personally applaud the idea of having a fully featured WYSIWYG editor right into Retype. I can also understand why it can be hard to justify spending a lot of time on this. Although, you gotta admit, the editor in a content app is a really important thing. Imagine Wordpress in the early days having only a textarea for posts, instead of a WYSIWYG editor - we would be living in a different world right now 🙃