DEV Community

Cover image for Write faster in the dev.to editor - adding a WYSIWYG and keyboard shortcuts! [hack 2]

Write faster in the dev.to editor - adding a WYSIWYG and keyboard shortcuts! [hack 2]

GrahamTheDev on March 29, 2021

This is is just a proof of concept, if there is enough demand I will refine it and improve it but it suits my needs for now, hopefully it will make...
Collapse
 
afif profile image
Temani Afif

You can also consider creating a user script that can be used with tools like: chrome.google.com/webstore/detail/... .. it would be more convenient for many of us

Collapse
 
grahamthedev profile image
GrahamTheDev

Great suggestion 😻!

If it proves popular then I will definitely do that (once I have refined it and added the missing features) as at the moment the code is a jumbled mess due to experimenting!

I have also never made a chrome extension before so if people do like it I may just make it an extension as that is inline with being "beginner friendly".

Collapse
 
areknawo profile image
Arek Nawo

Nice work! Kind-of similar to what I'm doing with CodeWrite, just that the editor is separate and Dev.to (as well as other platforms) are supported through auto-filling. Might plug-in directly to the editors in the future.
Love the bookmark idea though - didn't think of that!

Collapse
 
grahamthedev profile image
GrahamTheDev

Great work on CodeWrite, I have added it to my list of "things to try".

Does it have an API (or will it have?) as it could be a great plug and play solution for people who build custom websites.

Collapse
 
areknawo profile image
Arek Nawo

Thought about it already. Maybe in the future. Auto-filling on the web is pretty hard - especially with contenteditable rich editors. Techniques that I use won't work on every website, but on the vast majority. Might do a blog post on this.
So, if I manage to standardize it, then yeah, API might be on the way.

Thread Thread
 
grahamthedev profile image
GrahamTheDev

Sorry just re-read this.

I meant an API to retrieve the HTML / markdown generated for processing.

I thought that way people can use your service to write, then publish to everywhere including their own site. Or is that what you meant was difficult 😋?

Thread Thread
 
areknawo profile image
Arek Nawo

Kind-of. Right now it works like that:

  • you write your piece in CodeWrite editor
  • then "pin it for publishing"
  • then go to one of Medium, Hashnode, or Dev.to, open pop-up and click publish

CodeWrite detects potential issues (e.g. images too large, code highlighting not supported), presents you with potential solutions (e.g. resize image to FHD, convert to GitHub Gists embeds) and "auto-fills" the post's content within the editor.

Auto-filling and issue-resolving mechanisms aren't the same for every website, and so they aren't good candidates for an API.
I could provide generalized access to the pop-up menu and created content, but this would leave too much work on the API user's side.
As for standard "Markdown exports" - they're in development, alongside GitHub Pages auto-filling.
Hopefully, I'm clear. CodeWrite is a rather unique idea and it's quite hard to explain it properly.

Collapse
 
sidcraftscode profile image
sid

@ben we should add this to dev.to

Collapse
 
grahamthedev profile image
GrahamTheDev • Edited

I think you meant we should add something like this to dev.to - nobody wants my crappy hacked together code running on the site permanently 🤣🤣🤣

There are a few items already in the github repo about this, so I am pretty sure it is on their radar already.

github.com/forem/forem/issues/3049

github.com/forem/forem/issues/5023

github.com/forem/forem/issues/10522 (this one has a nice design that fits the site aesthetic)

Collapse
 
khangnd profile image
Khang

Learned something cool here, thanks for sharing :)

Collapse
 
elijahlynn profile image
Elijah Lynn

Is there an open issue for adding something like this to Dev.to? Would be good to add this to that issue if open already. If an issue doesn't exist yet, would be good to create one.

Collapse
 
grahamthedev profile image
GrahamTheDev

github.com/forem/forem/issues/3049

github.com/forem/forem/issues/5023

github.com/forem/forem/issues/10522 (this one has a nice design that fits the site aesthetic)

are ones that I could find that seem applicable.

Collapse
 
grahamthedev profile image
GrahamTheDev

Let me know if you end up using this (or if there is a better one somebody else has already built) in the comments!