dreeves's Shortform
post by dreeves · 2024-05-30T20:54:28.581Z · LW · GW · 5 commentsContents
5 comments
5 comments
Comments sorted by top scores.
comment by dreeves · 2024-05-30T20:54:28.734Z · LW(p) · GW(p)
A couple days ago I wanted to paste a paragraph from Sarah Constantin's latest post on AGI into Discord and of course the italicizing disappeared which drives me bananas and I thought there must exist tools for solving that problem and there are but they're all abominations so I said to ChatGPT (4o),
can you build a simple html/javascript app with two text areas. the top text area is for rich text (rtf) and the bottom for plaintext markdown. whenever any text in either text area changes, the app updates the other text area. if the top one changes, it converts it to markdown and updates the bottom one. if the bottom one changes, it converts it to rich text and updates the top one.
aaaand it actually did it and I pasted it into Replit and... it didn't work but I told it what errors I was seeing and continued going back and forth with it and ended up with the following tool without touching a single line of code: eat-the-richtext.dreev.es
PS: Ok, I ended up going back and forth with it a lot (12h45m now in total, according to TagTime) to get to the polished state it's in now with tooltips and draggable divider and version number and other bells and whistles. But as of version 1.3.4 it's 100% ChatGPT's code with me guiding it in strictly natural language.
Replies from: Bohaska, Tapatakt↑ comment by Bohaska · 2024-05-31T13:09:11.443Z · LW(p) · GW(p)
Not necessarily related to your main point, but you could have downloaded a markdown-based text editor and pasting what you copied into it, and they'll convert the text to Markdown, which Discord uses. A couple of them should support automatic formatting of HTML text to Markdown.
For example, I copied a portion of the article and pasted it into Obsidian (a markdown-based note system), and it formatted the text into Markdown for me. This is what it looked like in Discord:
Discord only supports the first 3 levels of headings so the subheading doesn't format, but everything else is fine. When I compared it with your richtext editor, it matched perfectly.
Replies from: Yoav Ravid, dreeves↑ comment by Yoav Ravid · 2024-06-02T08:02:28.039Z · LW(p) · GW(p)
On the other hand, Obsidian doesn't have an option to convert Markdown to rich text, if you want to copy-paste the other way around (say from obsidian to gdocs). Would be nice if it did.