Title: External Files
Author: adamh
Published: <strong>2009 年 6 月 21 日</strong>
Last modified: 2009 年 6 月 21 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/external-files.svg)

# External Files

 由 [adamh](https://profiles.wordpress.org/adamh/) 開發

[下載](https://downloads.wordpress.org/plugin/external-files.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/external-files/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/external-files/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/external-files/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/external-files/#developers)

 [技術支援](https://wordpress.org/support/plugin/external-files/)

## 外掛說明

External files provides a shortcode _[external]_ which can be used to insert the
contents of a file or url into the current post or page. The plugin will automatically
format the text based on the extension (for files) or mime type (for urls), using
Alex Gorbatchevs’ [Syntax Highlighter](http://alexgorbatchev.com) javascript.

The shortcode can accept three optional parameters:

 * _format_ can be used to specify a highlighting format, rather than letting the
   plugin decide which format to use
 * _start_ specifies a line number to output from, so sections of a file/url can
   be shown
 * _end_ specifies the line to stop at

See the installation page for usage examples.

The available formats are:

 * AS3
 * Bash
 * Cpp
 * CSharp
 * Css
 * Delphi
 * Diff
 * Groovy
 * Java
 * JavaFX
 * JScript
 * Perl
 * Php
 * Plain
 * PowerShell
 * Python
 * Ruby
 * Scala
 * Sql
 * Vb
 * Xml

### Future features

Following is a list of ideas and features to add:

 * _BASE\_PATH_ and _BASE\_URL_ options that can be used in the shortcode to avoid
   typing the same long path/url each time
 * a list of available formats with the checkboxes to enable/disable each individually,
   thus avoiding having to load all of them
 * an option for changing the theme of the syntax highlighter

## 安裝方式

 1. Install the plugin and activate
 2. In a post or page, type [external]/path/to/your/script.txt[/external]

Examples:

[external]/path/to/file.php[/external]
 [external]http://my.website.com/about.html[/
external] [external start=10 end=20]/very/long/script.js[/external] [external format
=xml]/not/really/a-php-document.php[/external]

## 常見問題集

_My code isn’t being highlighted_

This might mean that the theme you are using doesn’t call wp_footer before the closing
body tag. The javascript that applies the highlighter is attached to the wp_footer
action – either try another theme (the default wordpress theme will work) or add
the theme by typing the following inside the closing body tag:

    ```
    <?php wp_footer(); ?>
    ```

_My code should be formatted as *x_, but is showing up as plain*

If you are specifying a format, are you using one from the available formats list(
see the Description page)? If you are not specifying a format, does the file have
a correct extension for the file type or is the web page returning with the correct
Content-Type header?

_I’m still stuck_

Get in touch, I’ll see what I can do!

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈External Files〉的開發相關工作。

參與者

 *   [ adamh ](https://profiles.wordpress.org/adamh/)

[將〈External Files〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/external-files)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/external-files/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/external-files/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/external-files/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/external-files/)。

## 變更記錄

#### 0.1

_2009-06-21_
 * First version! Works for me, comments appreciated.

## 中繼資料

 *  版本 **0.1**
 *  最後更新 **17 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 2.5 或更新版本 **
 *  已測試相容的 WordPress 版本 **2.8**
 *  語言
 * [English (US)](https://wordpress.org/plugins/external-files/)
 * 標籤:
 * [code](https://tw.wordpress.org/plugins/tags/code/)[Highlight](https://tw.wordpress.org/plugins/tags/highlight/)
   [scripts](https://tw.wordpress.org/plugins/tags/scripts/)
 *  [進階檢視](https://tw.wordpress.org/plugins/external-files/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/external-files/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/external-files/reviews/)

## 參與者

 *   [ adamh ](https://profiles.wordpress.org/adamh/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/external-files/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](http://adamhopkinson.co.uk/)