
內容簡介
這個「Paragraph Level IDs」外掛會在每個文章內的段落標籤中加入一個「id」屬性,讓作者和讀者可擁有額外的功能。
例如,<p> 會變成 <p id=”para1234-5″>。
這些新增功能可以讓任何人直接鏈結至文章內特定的段落,非常適用於長篇文章、學術論文、法律文件等。
路線圖
未來我希望能做出以下改進:
簡化程式碼讓它更加高效率和檔案大小更小
針對「id」提供更多客製化選項
提供某些語言的回溯相容性和本地化支援
提供選項讓這個功能只套用至指定的文章類型
我歡迎任何建議、支援、測試錯誤、分叉專案、除錯等,以協助我實現這些額外功能。
鳴謝
我的朋友 @strangerpixel 在 0.2 版本的程式碼上重寫,讓這個 1.0 版本得以推出。
@s_ha_dum 在 [這個 Stack Exchange 的主題] (http://wordpress.stackexchange.com/questions/74558/automate-paragraphs-in-a-post-page-to-have-a-unique-anchor-link) 中的留言,以及 @Milo 在 [這個 Stack Exchange 的主題] (http://wordpress.stackexchange.com/questions/90066/numbering-sections-and-block-level-elements-in-wpautop-wordpress-as-cms-for-l) 的留言,啟發了我想出這個外掛。
[Add To Post 外掛] (https://wordpress.org/plugins/add-to-post/) 的使用方式對我建立簡單的設定表單也有所幫助。
外掛標籤
開發者團隊
原文外掛簡介
The Paragraph Level IDs plugin adds an ‘id’ attribute to each paragraph tag in a blog post, giving the author and readers additional functionality.
So for example,
becomes
.
These additions allow anyone to link directly to that paragraph in the post. This is especially useful for long tracts of text, academic writing, and legal documents.
Road Map
In the future I hope to make the following improvements.
Streamline the code so it is at its most efficient and smallest file size.
Further customisation options for the id
A degree of backwards compatibility and localisation for other languages
An option so this feature is only applied to the post types specified.
I would welcome any advice, offers of support, bug-testing, forking the project and troubleshooting to help make these extra features possible.
Acknowledgements
My friend @strangerpixel overhauled the 0.2 code for this 1.0 release.
The comment by s_ha_dum in [this Stack Exchange thread] (http://wordpress.stackexchange.com/questions/74558/automate-paragraphs-in-a-post-page-to-have-a-unique-anchor-link) and the comment by Milo in [this Stack Exchange thread] (http://wordpress.stackexchange.com/questions/90066/numbering-sections-and-block-level-elements-in-wpautop-wordpress-as-cms-for-l) got me started. The [Add To Post plugin (https://wordpress.org/plugins/add-to-post/) was instructive in helping me build a simple settings form.
