內容簡介
Footnotes for WordPress 是一個簡單易用的外掛,旨在輕鬆地在 WordPress 網誌的文章和頁面中,加入格式良好的註腳。
其語法大致基於 MediaWiki 註腳語法,但使用 WordPress 的短碼慣例。例如,要包含文字為「Text」的註腳,使用以下語法:
This is footnoted.[ref]Text[/ref]
這就是需要做的全部。當您添加註腳時,外掛會在文字中的註腳出現點創建一個註腳標記,並在頁面上引入帶有樣式的註腳列表中的註腳文本。當讀者在啟用 JavaScript 的瀏覽器中點擊鏈接時,外掛中包含的腳本會在內嵌在文本中的氣泡中創建註腳標記,這樣可以輕鬆閱讀,而不會喪失他們的位置。在不支持 JavaScript 的情況下,點擊註腳標記會跳轉到該註腳的文本。
跳轉基於外掛程式可以自動為您生成的唯一錨點。但是,如果您想為註腳創建自己的特定 ID,可以使用 name="..." 屬性:
This is footnoted.[ref name="my-unique-id-1"]文本[/ref]
如果為註腳定義了 ID,您還可以在文檔中稍後引用同一註腳,使用 [backref name="..."] 短碼。
This is footnoted.[ref name="source1"]來源 1[/ref]
同樣如此。[ref name="source2"]來源[/ref]
這個與第一個相同。[backref name="source1"]
註腳是以數字編號開始,從 1 開始。然而,您可以使用 number="..." 屬性來更改編號。例如,當引用包含註腳或章節末注的書籍時,我經常使用這個功能以表示原始文本中使用的註腳。
This is footnoted, but footnotes begin at number 42.[ref number="42"]...[/ref]
您可以通過使用 superscript="..." 屬性更改顯示在註腳上方的上標鏈接的文本或符號。例如,可以使用星號而不是註腳編號:
This is footnoted with a good old asterisk.[ref superscript="*"]...[/ref]
默認情況下,註腳列表顯示在文章底部。但是,如果要將它們顯示在文章底部上方的某個位置(出於格式或其他原因),可以使用 [references/] 短碼:
This is footnoted.[ref]文本[/ref]
其他一些事情[ref]文本[/ref]
[references/]
參見:章節末注。
這將使兩個註腳出現在第二段落的下方,但位於「參見:」文本的上方。
用法
要創建註腳,使用 [ref]...[/ref] 包裝您的註腳文本。
例如:This is footnoted.[ref]這是註腳的文本。[/ref]
通常,註腳使用編號上標指示註腳,從 1 開始。您可以選擇使用符號,如*、**、† 等。要使用自定義文字作為註腳的上標,使用 [ref superscript="*"]...[/ref],並替換...
外掛標籤
開發者團隊
原文外掛簡介
Footnotes for WordPress is a simple plugin designed with a simple aim in mind: to make
it dead-easy to include decently-formatted footnotes in posts and pages on your
WordPress blog.
The syntax is roughly based on the common MediaWiki syntax for footnotes, but uses the
WordPress shortcode conventions. So, to include a footnote with the text “Text,” you use:
This is footnoted.[ref]Text[/ref]
And that’s all you need to do. When you add a footnote, Footnotes for WordPress will
create a note marker at the point that the foonote appears in the text, and includes
the text of the footnote in a styled list of notes down the page. When a reader clicks
on the link in a JavaScript-enabled browser, a script included with the plugin will
create a small bubble inline in the text, which pops up over the footnote marker for
easy reading without losing their place. In non-JavaScript-enabled contexts, clicking
on the footnote marker jumps down the page to the text of the note.
The jump is based on an unique anchor which the plugin can automatically generate for
you. However, if you want to create a specific ID of your own for the footnote, you
can do so using the name="..." attribute:
This is footnoted.[ref name="my-unique-id-1"]Text[/ref]
If you define an ID for a footnote, you can also refer back to the same footnote
later on in the document, using the [backref name="..."] shortcode.
This is footnoted.[ref name="source1"]Source 1[/ref]
So is this.[ref name="source2"]Source[/ref]
And this one comes from the same source as the first.[backref name="source1"]
Footnotes are numbered, beginning at 1. However, you can change the numbering if you
so desire using the number="..." attribute. For example, I often use this when
quoting from a book that contains footnotes or endnotes, in order to represent the
notes used by the original text.
This is footnoted, but footnotes begin at number 42.[ref number="42"]...[/ref]
You can change the text that is displayed in the note’s superscripted link from the
note’s number to any text or symbol that you choose using the superscript="..."
attribute. For example, to use an asterisk instead of the note number:
This is footnoted with a good old asterisk.[ref superscript="*"]...[/ref]
By default, the list of footnotes appears at the bottom of the post. However, if you
wish them to appear somewhere above the bottom of the post, for formatting or other
reasons, you can do so using the [references/] shortcode:
This is footnoted.[ref]Text[/ref]
As are some[ref]Text[/ref] other things.
[references/]
See also: Endnotes.
Which will cause the two footnotes to appear beneath the second paragraph but above
the “See also:” text.
Usage
To create a footnote, use [ref]...[/ref] to wrap the text of your note.
Example: This is footnoted.[ref]This is the text of the of the footnote.[/ref]
Normally footnotes use numbered superscripts to indicate the footnote, beginning
with 1. You can choose to use symbols instead, like *, **, †, etc. To use custom
text for a footnote’s superscript, use [ref superscript="*"]...[/ref], and
replace the asterisk with whatever symbol or text you want to use.
Normally footnotes begin at 1 and count up towards infinity. If you want to use
numbered subscripts but need to reset the number they count from, use the number
attribute. For example, if you want the current subscript to be numbered 128, and
for subsequent subscripts to be numbered 129, 130, etc., use:
[ref number=”128″]…[/ref].
To create a footnote with a specific unique ID, instead of the one that the plugin
will automatically generate for you, use [ref name="..."]...[/ref]
Example: This is footnoted.[ref name="my-unique-id"]This is the note text.[/ref]
If you define an ID for a footnote, you can also refer back to the same
footnote later on in the document, using the [backref name="..."]
shortcode.
This is footnoted.[ref name=”source1″]Source 1[/ref]
So is this.[ref name=”source2″]Source[/ref]
And this one comes from the same source as the first.[backref name=”source1″]
To force the plugin to display notes at a different location instead of at the bottom
of the post, use [references/]
Example:
This is footnoted.[ref]Text[/ref]
As are some[ref]Text[/ref] other things.
[references/]
See also: Endnotes.
If you wish to change how footnotes are styled, you can alter them in your
WordPress theme stylesheet, or using JavaScript. The default elements and
classes are for superscript links to footnotes,
<
ol class=”footnotes”> for the list of references, and
for each individual footnote. So, for example, to
display footnotes at the bottom in a simple list, rather than in individual
boxes with “Note” headers, add the following line to your Theme stylesheet:
ol.footnotes li {
background: transparent !important;
padding: 0px !important;
border: none !important;
margin: 0.5em 2em !important;
}
The use of `!important` will ensure that it overrides the default styles
set up by the plugin.
Alternatively, if you want to change the CSS class which is applied to to
the footnotes list, you can do so using the class parameter on
[references/]:
This is a test.[ref]Lewis (2000).[/ref]
Notes
[references class="compact" /]
… which will produce the following HTML:
This is a test.[1]
Notes
- [1] Lewis
(2000). ↩
Since the default styling is based on children of ol.footnotes, those
styles will not apply, and you can apply whatever styles you wish to the
class that you’ve created.
Changes from version 2010.0309 to version 2010.0822
Added [backref name="..." /] shortcode allowing you to refer back to a note with an established name
Eliminated a bug which caused duplicate IDs if you tried to set up multiple sections of footnotes in the same post using repeated [references/] codes.
Added [references class="foo" /] syntax, allowing user to supply their own class for CSS re-styling purposes.
Tested for and verified compatibility up to WordPress 3.0.1 and WordPress trunk.
Changes from version 2010.0306 to version 2010.0309
Eliminates a harmless but potentially annoying source of “Missing argument” warnings from PHP
