
內容簡介
只顯示於區塊編輯器的評論
我喜歡在 Ulysses 本地或使用 我的部落格 的 Iceberg 編輯器 草擬文章。雖然我很喜歡 Iceberg,但當我發布一篇文章時,我通常會切回預設的 Gutenberg 編輯器 - 這將刪除之前添加的任何評論。
有能力在文章中添加和保留任何相關的編輯評論,而不在前端呈現,意味著我可以自由地隨時記錄任何想法,而不需要多想它。這就是自然而然的方便。
了解有關 Markdown Comment 的更多信息 →
Markdown Comment 的有趣之處:
1.僅供編輯器使用
該區塊僅在編輯器中呈現。對於閱讀此文的開發人員,這意味著沒有保存功能。我不希望我的未完成的想法、提醒和筆記出現在我的文章中--即使它們被 CSS 隱藏。
2.有用的區塊轉換
我添加了一些轉換,從標題和段落到評論,以及快捷鍵當您輸入 %% 並按下 [空格] 鍵時。這讓我可以快速添加評論,甚至將整個段落或標題轉換為評論。
3.輕鬆解決評論
為支持簡單性的路徑,我希望能有一種快速解決(即驅逐)評論的方法。因此,我添加了一個工具列控制,以快速解決評論,並刪除整個區塊。
4.無豐富文本支援
評論需要對編輯影響最小,並盡可能自然。這就是為什麼沒有典型的 RichText 控制(雖然您仍然可以加粗、斜體和添加超鏈接)。而且,您可以更改評論的顏色--沒有其他排版控制。
5.完全支援 CSS 變量
全球樣式和完整的站點編輯正在為主題開啟通往 CSS 變量的大門。區塊應該以相同的心態進行設計,這正是我在這裡做的。我添加了一些簡單的 CSS 變量,帶有預設值。若要進一步設計此評論,無需使用類別覆蓋任何樣式,只需編寫幾個 CSS 變量即可。
外掛標籤
開發者團隊
原文外掛簡介
Comments that only render in the block editor
I honestly enjoy drafting articles either locally in Ulysses, or on my blog using the Iceberg Editor. While I do love Iceberg, once I publish an article I typically bring back the default Gutenberg experience — thus removing any comments I previously added.
Having the ability to add, and keep, any relevant editing comments within my posts, without rendering them on the front-end, means that I am freed up to mentally jot any idea down without thinking about it. It is simply natural and convenient.
Learn more about Markdown Comment →
What’s interesting about Markdown Comment:
1. Editor only
The block only renders within the editor. For developers reading this, that means there’s no save function. I don’t want my unfinished ideas, reminders, and notes rendered within my post – even if they’re hidden by CSS.
2. Helpful block transforms
I added a couple transforms, to and from headings and paragraphs, and a raw shortcut when you type %% and hit the [space] key. This lets me quickly add comments, and even convert whole paragraphs or headings to a comment.
3. Easily resolve comments
To support that path towards simplicity, I wanted a method to quickly resolve — i.e. banish — a comment entirely. So, I added a toolbar control to quickly resolve the comment, removing the block entirely.
4. No rich text support
Comments need to have minimal impact on editing, and feel as natural as possible. That’s why there are no typical RichText controls (although you can still bold, italicize and add hyperlinks). And while you can change the color of the comment — there are no other typographic controls.
5. Entirely CSS Variable ready
Global styles and full site editing are opening the door for themes to be heavily powered by CSS variables. Blocks should be designed with that same mentality, which is exactly what I did here. I added simple CSS variables with fallbacks that are the default values. To further theme the comment, there’s no need to override any styles with classes, just write a few CSS variables.
