Extension:Poem

From mediawiki.org
This page is a translated version of the page Extension:Poem and the translation is 100% complete.
यह एक्सटेंशन मीडियाविकि 1.21 और अधिक के साथ उपलब्ध होता है। यानी कि आपको इसे दोबारा डाउनलोड करने की ज़रूरत नहीं। हालाँकि, आपको दूसरी विधियों का पालन करना होगा।
मीडियाविकि एक्सटेंशन मैन्युअल
Poem
प्रकाशन की स्थिति: स्थिर
कार्यान्वयन टैग
विवरण कविता प्रारूपण के लिए ‎<poem> टैग जोड़ता है
लेखक Nikola Smolenskiवार्ता
नवीनतम संस्करण निरंतर अद्यतन
MediaWiki 1.25+
डेटाबेस बदलता है नहीं
लाइसेंस क्रिएटिव कॉमन्स ज़ीरो v1.0 वैश्विक
डाउनलोड करें
‎<poem>
Quarterly downloads 55 (Ranked 90th)
Public wikis using 10,039 (Ranked 12th)
Poem एक्सटेंशन को अनुवादित करें अगर यह translatewiki.net पर उपलब्ध है
मुद्दे अधूरे कार्य · बग की रिपोर्ट करें

Poem एक्सटेंशन कविता या ऐसी चीज़ों को Wikitext के ज़रिए आसानी से प्रारूपित करने देता है। जब एक्सटेंशन सक्षम हो जाता है, आप टेक्स्ट के किसी भी ब्लॉक को ‎<poem>‎</poem> टैगों के अंदर रख सकते हैं, जिसका कुछ ऐसा असर होगा:

  • सभी नई पंक्तियों को ‎<br /> टैग्स में बदलकर रखा जाता है
  • टेक्स्ट को ब्लॉक को ‎<p>...‎</p> टैग के (और "‎<p>...‎</p>" क्लास के एक div के भी) अंदर रखा जाता है
  • पंक्ति के शुरुआत के कोलनों को एक 1em इनडेंटेशन में बदल दिया जाता है
  • पंक्ति के शुरुआत के रिक्त स्थान को रखा जाता है और ये ‎<pre> टैग को इन्वोक नहीं करते

एक्सटेंशन, कविता में विकिकड़ियों, बोल्डिंग, आदि के मौजूद होने पर उन्हें रखता है।

उपयोग

उदाहरण

इनपुट टेक्स्ट आउटपुट
<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
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>
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
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 ;

शैली

कविता के टेक्स्ट को div में लपेटा जाता है, जिसका डिफ़ॉल्ट से अपना कोई स्टाइल नहीं होता; मगर यह कविता में दिए गए किसी भी style या class विकल्प को प्राप्त करता है।

उदाहरणस्वरूप, इनडेंट किए गए टेक्स्ट का इस्तेमाल साधारण उदाहरणों में फ़िल को रोकने और एक बढ़िया-सा नीला बक्सा बनाने के लिए किया जा सकता है, मगर कभी-कभी इसे पढ़ना मुश्किल हो सकता है, क्योंकि लंबी पंक्तियों को तोड़ा नहीं जाता है। एक इसी तरह का मगर बेहतर इफ़ेक्ट इससे पाया जा सकता है:

<poem style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;">

जब इसे ऊपर के उदाहरण पर लागू किया जाता है, परिणाम होता है:

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" विकल्प

‎<poem> टैग को compact विकल्प के साथ दो से अधिक पंक्तियों वाले किसी टेक्स्ट पर जोड़ने पर हर पंक्ति अपना एक अनुच्छेद बन जाती है। (यानी, इससे एक कॉम्पैक्ट मार्कअप बनता है, कॉम्पैक्ट आउटपुट नहीं।)

इसके बाद compact विकल्प के साथ ‎<poem> टैग का इस्तेमाल करने पर अंदर अधिकतम दो नई पंक्तियाँ रखने पर, टेक्स्ट्स के बीच बस एक नई पंक्ति दिखाई जाती है, नया अनुच्छेद नहीं।

यानी अगर इसे दो से अधिक पंक्तियों वाले टेक्स्ट्स पर लागू किया जाता है, हर पंक्ति अपना एक अनुच्छेद बन जाती है, मगर हर टेक्स्ट की आखिरी पंक्ति और अगले टेक्स्ट की पहली पंक्ति को एक ही अनुच्छेद बना दिया जाता है।

इनपुट आउटपुट इनपुट आउटपुट
<poem>
One,
Two.
</poem>
<poem>
Three?
Four!
</poem>

One,
Two.

Three?
Four!

<poem compact>
One,
Two.
</poem>
<poem compact>
Three?
Four!
</poem>
One,
Two.
Three?
Four!
इनपुट आउटपुट इनपुट आउटपुट
<poem>
One,
Two.
Extra.
</poem>
<poem>
Three?
Four!
Extra.
</poem>

One,
Two.
Extra.

Three?
Four!
Extra.

<poem compact>
One,
Two.
Extra.
</poem>
<poem compact>
Three?
Four!
Extra.
</poem>
One,

Two.

Extra.
Three?

Four!

Extra.

समस्याएँ और समाधान

  • वेरिएबल्स और ParserFunctions ‎<poem>...‎</poem> कंटेनर के अंदर काम करते हैं, मगर <poem ... > टैग के बीच नहीं; इससे <poem style="{{{1}}}"> जैसे साँचों के कोड नहीं जोड़े जा सकते हैं।
  • एक समाधान है <div style="{{{1}}}"><poem> ... </poem></div> का इस्तेमाल करना।
  • दूसरा तरीका है #tag जादुई शब्द का इस्तेमाल करना: {{#tag:poem| ... |style="{{{1}}}"}}।
    • नोट: यह "compact" विकल्प के साथ काम नहीं करेगा।
इनपुट (अंदर ठीक है, बीच में नहीं) आउटपुट
<poem style="{{{1|border: 1px solid Black;}}}">
One,
{{{2|Two.}}}
</poem>

One,
Two.

इनपुट (अंदर और बीच में, दोनों ठीक हैं) आउटपुट
<div style="{{{1|border: 1px solid Black;}}}">
<poem>
One,
{{{2|Two.}}}
</poem>
</div>

One,
Two.

{{#tag:poem|
One,
{{{2|Two.}}}
|style="{{{1|border: 1px solid Black;}}}"
}}

One,
Two.


स्थापना

  • फ़ाइलों को डाउनलोड करें और अपने extensions/ फ़ोल्डर के Poem नामक डिरेक्ट्री में डालें।
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Poem
  • अपने LocalSettings.php फ़ाइल के अंत में निम्न कोड जोड़ें:
    wfLoadExtension( 'Poem' );
    
  • Yes पूर्ण – अपने विकि पर Special:Version पर जाकर देखें कि एक्सटेंशन को सफलतापूर्वक स्थापित किया गया है कि नहीं।


Vagrant स्थापना:

  • अगर आप Vagrant का इस्तेमाल कर रहे हैं, तो vagrant roles enable poem --provision से स्थापित करें