Add Markdown Support to NetJournal Web Journal

In the previous post, we tackled the core backend logic of building the web journal NetJournal from scratch . Now it's time to address the user experience. Nobody wants a journal that only supports text + emoji + ASCII art.  So, thinking about it, the best solution would be Markdown. Inspiration I asked GPT, and it gave a great example. https://devv.ai/zh/search?threadId=dbr3kt6te3uo The core code is this little snippet document.getElementById('markdown-content').addEventListener('input', function () {   const markdownContent = document.getElementById('markdown-content').value;   const htmlPreview = document.getElementById('html-preview');   htmlPreview.innerHTML = marked.parse(markdownContent); });

白嫖worker 自建短链服务 Url-Shorten-Worker 变身日记本 NetJournal 支持Markdown

上一篇我们解决了网络日记本 NetJournal 从无到有的核心后台逻辑 . 现在要来解决使用效果了. 谁也不想日记本里面只能用文字+emoji+ascii艺术吧.  那想一想, 最好的解决方案就是 Markdown 了. 启发 找 GPT 一问, 给了一个很好的例子. https://devv.ai/zh/search?threadId=dbr3kt6te3uo 核心代码就是这一小段 document.getElementById('markdown-content').addEventListener('input', function () {   const markdownContent = document.getElementById('markdown-content').value;   const htmlPreview = document.getElementById('html-preview');   htmlPreview.innerHTML = marked.parse(markdownContent); });

How to Build a Cloud Diary with PasteBin Worker

Previously we implemented the online notepad PasteBin , which is used to host a piece of text for yourself. Demo site:  https://pastebin.icdyct.cloudns.asia/tieludasiliqiuweiyue If you want to use it as your own diary, it would be a bit inconvenient. For example, if you use this page as the main operation page, rather than writing elsewhere and pasting it over, this page doesn't let you write a bit, save it, write a bit more, and save again. When you click save, it prompts that the key already exists. Another point is that when you want to modify a certain diary entry, you have to go to the display list to find it, which is a bit inconvenient. Approach First, when saving key-value to the database, do not check whether the key already exists (in the previous short link system, it was checked). Second, add a small feature to read a specified key-value. After clicking the Load button, read the value from the database and place the data into the original operation interface.  Subsequen...

白嫖worker 自建短链服务 Url-Shorten-Worker 变身网络日记本 NetJournal

前面我们已经实现了 网络记事本 PasteBin , 用于托管自己的一段文本. 演示站:  https://pastebin.icdyct.cloudns.asia/tieludasiliqiuweiyue 如果想作为自己的一份日记本的话, 用起来会有一点不顺手. 比如, 如果你把这个页面作为主要的操作页面, 而不是从别的地方写好了再复制粘贴过来, 那么这个页面并不能让你写一点了保存一下, 再写一点了再保存一下. 你点保存的时候会提示 key 存在冲突. 还有一点就是, 当你确定要修改某一篇日记时, 还要去显示列表中找到它, 有点不方便. 思路 一是实现一下, 在向数据库保存key-value时, 不要检测key是否已存在(在之前的短链系统中, 是检测了的) 二是增加读取指定key-value的小功能. 点击了 Load 按钮之后, 从数据库中把 value 读出来, 再把数据放到原本的操作界面上.  后续操作就可以按以前系统的操作方式使用就好了.