[WordPress] 外掛分享: File Inliner

前言介紹

  • 這款 WordPress 外掛「File Inliner」是 2008-06-08 上架。
  • 目前有 20 個安裝啟用數。
  • 上一次更新是 2009-05-14,距離現在已有 5833 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.0 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

kanma |

外掛標籤

code | text | files | inline |

內容簡介

這個外掛可以在文章中顯示檔案的內容,該檔案的內容(稱為「片段」)會預設以

 標籤區塊的形式呈現。

這個外掛相較於自行貼上檔案內容,具有以下優勢:

當檔案修改後,不需要修改與其相關的文章
預設保留縮排(有利於展示程式碼片段)
可以選擇性提供檔案連結(無需複製貼上片段)

如果有需要(參閱 preserveformat 參數),檔案的內容會以

標籤區塊呈現,每行文字(由換行符號區隔)會分別置於一個

區塊中。

使用方法

語法: [file lang="某語言" start="某行號" end="某行號" link="開或關" style="某樣式屬性" preserveformat="開或關"]路徑/至/您的/檔案[/file]

注意:屬性的順序是必要的!

範例:內嵌檔案

只需在文章中寫下 [file]路徑/至/您的/檔案[/file] 即可。

範例:使用語法突顯外掛

如果您寫下了 [file lang="cpp"]path/to/your/file[/file](例如),
且如果您所使用的語法突顯外掛支援

 語法(大多數都支援),那麼您的檔案內容將如往常一樣由語法突顯外掛進行處理。

範例:提供檔案連結

如果您寫下了 [file link="on"]path/to/your/file[/file],會在文字區域的左上方自動添加一個連結。

範例:內嵌檔案的子集

如果您寫下了 [file start="10" end="20"]path/to/your/file[/file],
只會顯示檔案的第 10 至 20 行。如果您需要,可以省略開頭(即「從開頭至第 20 行」)或結尾設定(即「從第 10 行至檔案結尾」)。

範例:將文字的顏色設定為紅色

只需在文章中寫下 [file style="color: #FF0000;"]path/to/your/file[/file]。

範例:停用外掛處理 [file][/file] 區塊

只需寫下 [file off]您的內容[/file] 即可。

注意:「off」屬性必須排在其他屬性之前。

原文外掛簡介

This plugin displays the content of a file in a post. The content of the file
(called a “snippet”) is put in a


block by default.
It has the following advantages over pasting the content of the file in your post
yourself:

When the file is modified, no need to modify the posts referring to it
Indentation is preserved by default (useful to show code snippets)
Can optionally provide a link to the file (no need to copy-paste your snippet)

If requested (see the preserveformat parameter), the content of the file
is put in a

block, with each line (delimited by
the carriage return) in its own

block.
Usage
Syntax: [file lang="some_lang" start="a_line_number" end="a_line_number" link="on_or_off" style="some_style_properties" preserveformat="on_or_off"]path/to/your/file[/file]
Note: The order of the attributes is mandatory!
Example: Inlining of a file
In your post, write [file]path/to/your/file[/file]. That’s it!
Example: Using a syntax highlighter plugin
If you write [file lang="cpp"]path/to/your/file[/file] (for instance),
and if the syntax highlighter plugin you use supports
the


syntax (most does), then the content
of your file will be processed by the syntax highlighter plugin as usual.
Example: Provide a link to the file
If you write [file link="on"]path/to/your/file[/file], a link will
be automatically added to the top left of the text area.
Example: Inline a subset of a file
If you write [file start="10" end="20"]path/to/your/file[/file],
only the lines 10 to 20 of the file will be displayed. You can omit the start
(ie. “from beginning to line 20”) or the end (ie. “from line 10 to the end of
the file”) if you want.
Example: Set the color of the text to red
In your post, write [file style="color: #FF0000;"]path/to/your/file[/file].
Example: Prevent the plugin to process a [file][/file] block
Just write [file off]your content[/file].
Note: The ‘off’ attribute must come BEFORE any other ones.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「File Inliner」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0.0 | 1.1.0 | 1.1.1 | 1.2.0 | trunk |

延伸相關外掛(你可能也想知道)

  • WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager 》插入標頭和頁腳 + 完整的 WordPress 代碼片段外掛, WPCode (前稱为 WPBeginner 的 "插入標頭和頁腳")是使用率超过 100 万个网站的 WordPress 代码片段外掛中...。
  • Code Snippets 》Code Snippets 是在您的網站上運行程式碼片段的簡單,清潔和簡單的方法。它消除了將自定義片段添加到您的佈景主題的 functions.php 檔案的需求。, 現在提供 C...。
  • Simple Custom CSS Plugin 》無需麻煩地將自訂 CSS 新增到 WordPress 網站中。, 這是一個易於使用的 WordPress 外掛,可以添加自訂 CSS 樣式以覆寫外掛和佈景主題的預設樣式。該外掛旨在...。
  • Shortcoder — Create Shortcodes for Anything 》Shortcoder 外掛可讓您建立 HTML、JavaScript、CSS 和其他代碼片段的自訂捷徑。現在,這些捷徑可以在文章/頁面中使用,並且該片段將取代其位置。, ✍ 輕鬆建立...。
  • Head & Footer Code 》Head & Footer Code 插件可以讓你在不是開發人員的情況下,添加自定義代碼片段(JavaScript、CSS 或 HTML)到網頁中。您可以將代碼放置在 (...。
  • Scripts n Styles 》這個外掛讓管理員用戶能夠將自訂的 CSS 和 JavaScript 直接添加到個別文章、頁面或任何註冊的自訂文章類型中,也可以將類別添加到 body 標籤和文章容器中。還...。
  • SyntaxHighlighter Evolved 》現在支援 WordPress 5.0 中的新區塊編輯器!, SyntaxHighlighter Evolved 讓您可以輕鬆地在網站上張貼帶有語法加亮功能的程式碼,而不會失去格式或做任何手動...。
  • Code Embed 》注意: WordPress 5.0 及以上版本的使用者請查看常見問題以了解如何在區塊編輯器中使用此外掛。, Code Embed 外掛允許您在文章中嵌入程式碼(JavaScript 和 H...。
  • PHP Everywhere 》注意:此外掛更新至 3.0.0 版本是一項重大變更,將移除 [php_everywhere] 短代碼和小工具。請透過外掛設定頁面中的升級嚮導,將原本的代碼轉換為 Gutenberg ...。
  • Highlighting Code Block 》「Highlighting Code Block」外掛可讓你以一個點擊的方式添加一個有語法突顯的程式碼區塊。, 它支援「區塊編輯器」和「傳統編輯器」。, (不過,我們建議在「...。
  • CSS & JavaScript Toolbox 》感謝您查看我們的程式碼片段外掛。我相信它將完全符合您的需求。, 適用於以下情況:, , 前端修改(無需修改主題文件), 添加功能(無需修改functions.php), ...。
  • Advance Custom HTML 》這是一款用來專業編寫 HTML 代碼的高級 HTML 編輯器,提供不同的樣式、縮排與更多功能。, Advance Custom HTML 是一款功能強大、彈性十足的區塊外掛,讓您可...。
  • Code Block Pro – Beautiful Syntax Highlighting 》展示你美麗的程式碼,不僅僅是顯示它!這個版塊外掛提供編輯程式碼塊的功能,直接運行你的程式碼,使用與受歡迎的 VS Code 編輯器相同的渲染引擎。此外掛提供...。
  • Code Syntax Block 》代碼語法區塊(Code Syntax Block)擴充了 WordPress 區塊編輯器,使用 Prism 語法高亮工具為核心代碼區塊添加了語法高亮支持。, Prism 語法高亮工具在前端執...。
  • Foxtool All-in-One: Contact chat button, Custom login, Media optimize images 》總結:Foxtool 是根據管理 WordPress 網站的真實需求而開發的產品。經過一段時間的發展,Foxtool 已成為網站管理員不可或缺的外掛程式。該外掛擁有許多值得注...。

文章
Filter
Apply Filters
Mastodon