قالب:بداية لا لف/شرح

من ويكي الكتب

هذا قالب {{بداية لا لف}}.

يمنع هذا القالب التفاف الكلمات (فواصل الأسطر) في النص والروابط التي تحتوي على مسافات. إنه مصمم للتعامل مع حالات الالتفاف الصعبة حقًا حيث تحتاج إلى التحكم الكامل. على سبيل المثال في قوائم الروابط الطويلة المعقدة للغاية. يعمل هذا القالب بشكل شبيه بـ {{nowrap}} و{{nowraplinks}}.

لا يأخذ هذا القالب أي معلمات ، وبدلاً من ذلك يعمل جنبًا إلى جنب مع {{نهاية لا لف}}.

القوالب المساعدة[عدل]

يحتوي هذا القالب على عدد من القوالب المساعدة التي تسمح لك بإخبار متصفح الويب بمكان حدوث فواصل الأسطر بالضبط:

ملحوظة! يمكن استخدام هذه القوالب المساعدة فقط في أقسام محاطة بـ {{بداية لا لف}} و{{نهاية لا لف}} أو قد تتسبب في سلوك غريب لصفحتك.

  • {{wrap}} - علامات حيث قد يحدث التفاف.
  • {{·wrap}} أو {{·w}} - يبدو مثل هذا: " · ". للقوائم المنقطة. يضع نقطة تحيط بها مسافات ثم يشير إلى احتمال حدوث التفاف بعد تلك النقطة.
  • {{•wrap}} أو {{•w}} - يبدو مثل هذا: " • ". للقوائم المنقطة التي تستخدم خطًا صغيرًا وبالتالي تحتاج إلى نقطة أكبر. يضع نقطة محاطة بمسافات ثم يشير إلى احتمال حدوث التفاف بعد النقطة.
  • {{–wrap}} أو {{–w}} - يبدو مثل هذا: " – ". للقوائم المتقطعة. يضع خط محاط بمساحات ثم يشير إلى احتمال حدوث التفاف بعد الخط.
  • {{—wrap}} أو {{—w}} - يبدو مثل هذا: " — ". يضع خط مزدوج محاطاً بمسافات ثم يشير إلى احتمال حدوث التفاف بعد الخط المزدوج.
  • {{!wrap}} أو {{!w}} - يبدو مثل هذا: " | ". للقوائم المفصولة بخط أفقي. يضع خط أفقي محاطًا بمسافات ثم يشير إلى إمكانية حدوث التفاف "بعد" هذا الخط. الخط الأفقي المُستخدم ليس خطًا حقيقيًا ولكنه رمز | لذا من المُفترض أن يعمل ضمن جداول الويكي وما إلى ذلك.
  • {{\wrap}} أو {{\w}} - يبدو مثل هذا: " / ". للقوائم المفصولة بـشرطة مائلة. يضع شرطة مائلة محاطة بمسافات ثم يشير إلى إمكانية حدوث التفاف "بعد" الشرطة المائلة. ال "\" في الاسم يميل بطريقة أخرى غير الشرطة المائلة المقدمة "/" لأسباب تتعلق بتقنية الويكي.

الإستخدام[عدل]

{{بداية لا لف}}

'''ملح''' و{{wrap}} '''فلفل''' و{{wrap}} '''كاري''' 
و{{wrap}} '''زعفران'''.{{wrap}} 
'''ملح''' و{{wrap}} '''فلفل''' و{{wrap}} '''كاري''' 
و{{wrap}} '''زعفران'''. 

{{نهاية لا لف}}

سوف يُظهر شيء مثل هذا:

ملح و فلفل و كاري و
زعفران. ملح و فلفل و
كاري و زعفران.

But it will not render like this:

Salt and Pepper and Curry
and Saffron. Salt and Pepper
and Curry and Saffron.

To make your code readable and easy to edit, you can put each wrappable "line" on its own line. And let's use some dots too. Like this:

{{nowrap begin}}

'''Salt''' and '''Pepper'''{{·wrap}} 
'''Pepper''' and '''Curry'''{{·wrap}} 
'''Curry''' and '''Saffron'''{{·wrap}} 
'''Saffron''' and '''Salt'''

{{nowrap end}}

It will render something like this:

Salt and Pepper · Pepper and Curry ·
Curry and Saffron · Saffron and Salt

But it will not render like this:

Salt and Pepper · Pepper
and Curry · Curry and Saffron
· Saffron and Salt

Examples[عدل]

Here are the above examples in actual running code in a table. Try dragging the width of your web browser window so it becomes smaller and smaller and watch how the line wrapping behaves:

Salt and · Pepper and · Curry and · Saffron· Salt and · Pepper and · Curry and · Saffron.

Salt and Pepperقالب:·wrap Pepper and Curryقالب:·wrap Curry and Saffronقالب:·wrap Saffron and Salt

An example demonstrating all the helper templates:

Saltقالب:Wrap Pepperقالب:Wrap Curryقالب:·wrap Saffronقالب:·wrap Saltقالب:•wrap Pepperقالب:•wrap Curryقالب:–wrap Saffronقالب:–wrap Saltقالب:!wrap Pepperقالب:!wrap Curryقالب:\wrap Saffronقالب:\wrap Salt

Saltقالب:Wrap Pepperقالب:Wrap Curryقالب:·wrap Saffronقالب:·wrap Saltقالب:•wrap Pepperقالب:•wrap Curryقالب:–wrap Saffronقالب:–wrap Saltقالب:!wrap Pepperقالب:!wrap Curryقالب:\wrap Saffronقالب:\wrap Salt

Technical details[عدل]

The actual code that does the job is this HTML+CSS code:

<span style="white-space:nowrap;"> Text and links </span> <span style="white-space:nowrap;"> More text and links </span>

It means that wraps may only happen in the unprotected space between the </span> and the <span ...>. That's what {{nowrap begin}} and its helper templates are packaging in an easy to use way.

{{·wrap}} and the other helper templates should not have any spaces or newlines before them or they will render two spaces before the dot. They tolerate anything from no to several spaces and even a newline after them and they will still only render one space after the dot. If a wrap occurs then the wrap will come after the dot, even if there are spaces before the helper template.

The {{·wrap}} causes problems if inside sections of bolded and/or italicized text. Do end the bold text before the {{·wrap}} and continue the bold text after it to avoid the problems. {{•wrap}} and the other helper templates only have this problem if the section is bolded and italicised at the same time.

See also[عدل]

  • {{nowrap end}} - The other end of this template.
  • {{nowrap}} - A template with similar purpose.
  • {{nowraplinks}} - Prevents wraps inside links and only allows wraps between the links and in normal text. Very useful for link lists and usually easier to use than this template.
  • {{·}} and {{}} - If you need dots/bullets when not using {{nowrap begin}}+{{nowrap end}}.