snazzyDocs / public-snazzyDocs

3 stars 0 forks source link

Ctrl+S to Save or Publish #63

Closed perholmes closed 2 years ago

perholmes commented 2 years ago

Hi,

It would be great if Ctrl+S could be intercepted and used for publishing the draft or the final output, depending on the current publishing settings.

I tend to want to see the final result to be able to judge it, and I go an awful lot to the Public button, which is multiple mouse clicks and a tool change. I also keep hitting Ctrl+S, which opens a Chrome HTML save dialog. Ctrl+S is so much a motor memory that it's hard to remember isn't supported.

I realize that making it easier to publish might put slightly more pressure on your servers when the static output is generated. But consider that this will be super light weight in the real world. It only happens when you edit the docs. Most of the time, docs are just sitting there with no one editing them. So I don't think this will increase your CPU bill.

snazzyDocs commented 2 years ago

Great idea... I hit CTRL/CMD+S all the time as well!

I do have one slight tweak though. I'm definitely going to try this for the publishing button. (Drafts are autosaved after changes so a shortcut is not needed there).

My only concern here is people hit the shortcut out of "motor memory" and end up publishing content that isn't ready for the live doc yet. There is the Publish Protection toggle switch, so I'll see if anything cool can be done with that.

image

I'll give it go...

As an aside, I will also attempt to make a shortcut for Previews...

Thanks for the awesome ideas, keep em coming!

snazzyDocs commented 2 years ago

Done... https://docs.snazzydocs.com/1.0/the-editor/text-editor/shortcuts#general-editor

As for the Publish Protection implementation, I decided to keep it simple for now, without any added functionality. It will be up to users to preemptively toggle the Publish Protection toggle switch on to prevent accidental publishing.

perholmes commented 2 years ago

This is a super smooth workflow for me.