확장기능:Poem
Poem 출시 상태: 안정 |
|
---|---|
구현 | 태그 |
설명 | 시 서식에 쓸 수 있는 <poem> 추가 |
만든 이 | Nikola Smolenski토론 |
최신 버전 | 지속적인 업데이트 |
MediaWiki | 1.25+ |
데이터베이스 변경 | 아니오 |
라이선스 | Creative Commons Zero v1.0 Universal |
다운로드 | |
<poem> |
|
Quarterly downloads | 41 (Ranked 91st) |
Public wikis using | 10,039 (Ranked 12th) |
Poem 확장 기능 번역 (translatewiki.net에서 가능한 경우) | |
이슈 | 미해결 작업 · 버그 보고 |
The Poem extension allows easy formatting of poems and similar material within Wikitext .
Once the extension is enabled, you can put any block of text within <poem></poem>
tags, which has the following effects:
- All newlines are preserved by converting them into
<br />
tags
- The block of text is enclosed in
<p>...</p>
tags (as well as a div of class "poem")
- Colons at the beginning of a line are converted into 1 em indentation
- Spaces at the beginning of a line are preserved and no longer invoke the
<pre>
tag
The extension preserves wikilinks, bolding, etc. if they are present in the poem.
Usage
Example
Input text | Output |
---|---|
<poem>
In [[Wikipedia:Xanadu|Xanadu]] did Kubla Khan
A stately pleasure-dome decree:
Where Alph, the sacred river, ran
Through caverns measureless to man
Down to a sunless sea.
So twice five miles of fertile ground
With walls and towers were girdled round:
And there were gardens bright with sinuous rills,
Where blossomed many an incense-bearing tree;
And here were forests ancient as the hills,
Enfolding sunny spots of greenery.
</poem>
|
In Xanadu did Kubla Khan |
Example with indentation
Input text | Output |
---|---|
<poem>
Une terre au flanc maigre, âpre, avare, inclément
Où les vivants pensifs travaillent tristement,
::Et qui donne à regret à cette race humaine
Un peu de pain pour tant de labeur et de peine ;
::Des hommes durs, éclos sur ces sillons ingrats ;
Des cités d’où s’en vont, en se tordant les bras,
::La charité, la paix, la foi, sœurs vénérables ;
L’orgueil chez les puissants et chez les misérables ;
</poem>
|
Une terre au flanc maigre, âpre, avare, inclément |
Style
The poem text is wrapped in a div, which has no style by default; but inherits any style or class option passed to the poem.
For example, while indented text can be used for simple examples to prevent filling and draw a nice blue box, it can be hard to read in some cases, since long lines aren't broken. A similar, but somewhat better effect can be obtained with:
<poem style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;">
When applied to the above example, the result is as follows:
In Xanadu did Kubla Khan
A stately pleasure-dome decree:
Where Alph, the sacred river, ran
Through caverns measureless to man
Down to a sunless sea.
So twice five miles of fertile ground
With walls and towers were girdled round:
And there were gardens bright with sinuous rills,
Where blossomed many an incense-bearing tree;
And here were forests ancient as the hills,
Enfolding sunny spots of greenery.
"compact" option
Applying the <poem>
tag with the compact option to a text of more than two lines, every line becomes a separate paragraph.
(That is to say, it allows for more compact markup, not for a more compact output.)
Subsequent use of the <poem>
tag with the compact option, with up to two newlines in between, gives just a single newline between texts, not a new paragraph.
Thus, applied to texts of more than two lines each, every line becomes a separate paragraph, except that the last line of each text and the first line of the next text are combined into one paragraph.
Input | Output | Input | Output |
---|---|---|---|
<poem>
One,
Two.
</poem>
<poem>
Three?
Four!
</poem>
|
One, Three? |
<poem compact>
One,
Two.
</poem>
<poem compact>
Three?
Four!
</poem>
|
One,
Two. Three?
Four! |
Input | Output | Input | Output |
---|---|---|---|
<poem>
One,
Two.
Extra.
</poem>
<poem>
Three?
Four!
Extra.
</poem>
|
One, Three? |
<poem compact>
One,
Two.
Extra.
</poem>
<poem compact>
Three?
Four!
Extra.
</poem>
|
One,
Two. Three?
Four! |
Problems and solutions
- Variables and ParserFunctions do work inside the
<poem>...</poem>
container, but NOT within the<poem ... >
tag itself; this prevents templates with code such as<poem style="{{{1}}}">
. - One workaround is to use
<div style="{{{1}}}"><poem> ... </poem></div>
instead. - Another way is to use the
#tag
magic word: {{#tag:poem| ... |style="{{{1}}}"}}.- NB: this would however seem not to work with the "compact" option.
Input (inside OK, within not OK) | Output |
---|---|
<poem style="{{{1|border: 1px solid Black;}}}">
One,
{{{2|Two.}}}
</poem>
|
One, |
Input (both inside and within OK) | Output |
<div style="{{{1|border: 1px solid Black;}}}">
<poem>
One,
{{{2|Two.}}}
</poem>
</div>
|
One, |
{{#tag:poem|
One,
{{{2|Two.}}}
|style="{{{1|border: 1px solid Black;}}}"
}}
|
One, |
Installation
- 파일을 다운로드하고
Poem
폴더를extensions/
디렉토리에 넣어 주세요.
개발자와 코딩 기여자는 Git을 이용해 확장기능을 다운받는 것이 좋습니다.cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Poem - 아래의 코드를 LocalSettings.php 코드의 마지막에 추가합니다.
wfLoadExtension( 'Poem' );
- 완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.
Vagrant 설치:
- Vagrant 를 사용하고 있는 경우에는,
vagrant roles enable poem --provision
로 설치해주세요
이 확장 기능은 하나 이상의 위키미디어 프로젝트에서 사용 중입니다. 이것은 아마도 이 확장 기능이 안정적이고 트래픽이 많은 웹 사이트에서 사용할 수 있을 만큼 충분히 잘 작동한다는 것을 의미합니다. 설치된 위치를 확인하려면 위키미디어의 CommonSettings.php 및 InitialiseSettings.php 구성 파일에서 이 확장 기능의 이름을 찾습니다. 특정 위키에 설치된 확장 기능의 전체 목록은 위키의 Special:Version 문서에서 볼 수 있습니다. |
This extension is included in the following wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |