:Divbox/설명문서

위키백과, 우리 모두의 백과사전.

이 틀을 사용하여 간단하고 유연한 색상의 텍스트 배경을 만들 수 있다.

이것은 장식용 틀이며 일반 백과사전에서 사용하기 위한 것이 아니다. 기사에는 표시되지 않는다.

목적[편집]

위키백과는 다음과 같은 상자형 틀이 가득하다:

상자가 항상 최적일 수는 없고, 눈에 거슬릴 수도 있다. 하지만 박스가 사용되면, 일반적으로 임의로 형식을 가지며, 이로 인해 불일치가 발생할 수도 있다.

{{Divbox}}은 상자 안의 텍스트를 표시하는 간단한 방법을 제공한다. 색상은 시각적 의미에서 함께 작업하도록 이미 선택된 상자 테두리와 배경을 모두 설정하는 개인 스타일 키워드를 사용하여 선택된다.

키워드 none은 내용을 보이지 않는 상자에 넣는다. 이 옵션을 사용하면 보이는 상자가 없어도 이 컨텐츠에 동일한 상자 모델을 제공할 수 있다.

이 틀은 다른 틀 내에 사용되거나 다른 페이지의 일부로 사용될 것이다.

사용법[편집]

틀의 일반적인 구문은 다음과 같음:

{{divbox|1=style|2=title|3=content|radius=}}

인수[편집]

1 (Style)
필수. 다음 중의 것을 사용:
목록에서 이름이 지정되지 않은 첫 번째 매개변수인 경우 "1="을 생략할 수 있다.
2 (Title)
선택. 일반 텍스트. 맨 위에 진하게 가운데에 표시된다. 목록에서 이름이 지정되지 않은 두 번째 매개 변수인 경우 "2="를 생략할 수 있다.
3 (Content)
필수. 메시지 본문을 형성하는 마크업을 포함한 모든 텍스트이다. 이 매개변수가 목록의 세 번째 이름 없는 파라미터이고 내용에 등호(=)가 포함되어 있지 않으면 "3="을 생략할 수 있다.
radius
둥근 모서리의 곡률, px, pt 또는 em와 같은 유효한 단위에 맞춤. 매개변수는 원래 모서리가 날카롭거나 둥근 스타일에서 작동하여 기본 모서리 원형도를 재정의한다. 이 전체 매개 변수와 값을 무시할 수 있다.; 하지만 일단 사용하게 되면 "radius="를 생략할 수 없으며, 대소문자를 구분한다. 그러나 명명된 매개 변수와 마찬가지로 아무 위치에 나타날 수 있다. (즉, 마지막 매개 변수가 될 필요는 없다).

예제[편집]

보여지는 출력물 입력한 내용
gray: {{divbox|gray|Lorem ipsum|Lorem ipsum dolor...}}
red: {{divbox|radius=5px|red|Lorem ipsum|Lorem ipsum dolor...}}
navy: {{divbox|radius=10px|navy|Lorem ipsum|Lorem ipsum dolor...}}
amber: {{divbox|radius=15px|amber|Lorem ipsum|Lorem ipsum dolor...}}
테두리나 배경이 없음: {{divbox|none|Lorem ipsum|Lorem ipsum dolor...}}
제목 없음 {{divbox|navy||Lorem ipsum dolor...}}
Content contains '=': {{divbox|lavender|Lorem ipsum|3=Lorem <span style="color:#F00;">ipsum</span> dolor...}}

Using subst: with this template[편집]

The subst: atom may be used with {{divbox}}. This may be highly desirable. Note that subst: does not take effect in preview, but only after saving a page. The template's inclusion is replaced by the code of the template itself, which will continue to write the box as before, but without an additional server call.

Since {{divbox}} itself calls a template based on your choice of style keyword, you will find that even after saving an instance of use with subst: there remains a "live" call to the underlying style template. This means that viewing the page risks a server call to the style template, but also means that changes to the style template automatically propagate to all pages where it is used. This way, all {{divbox}}-type boxes, wherever they are in the project, keep the same consistent look.

Just paste in your content and, when you're finished, be sure to close the template call with }}.

Since the contents are given in the form of two parameter values, for the content you may place within {{divbox}}, the restrictions on parameter values apply. For example, if you put content that includes template calls, {{divbox}} cannot tell where its last parameter ends.

If the contents do not satisfy the restrictions, insert this code in your page first:

{{subst:divbox|keyword|title|DUMMYCONTENT}}

That is, choose your style and title as usual (or omit the title with two pipes), but instead of actual content, write "DUMMYCONTENT". Then, save the page and reopen it for editing. You'll see the box code in all its gory detail, and the placeholder DUMMYCONTENT, followed by the HTML division closing tag. Now, you may simply replace DUMMYCONTENT with your content, save, and move on. Since almost anything may be placed within division tags, this should not break no matter what you do.

Making new divbox styles[편집]

I'd rather hope you were able to find joy within the existing set of styles, but if not, you can create new ones. Follow these instructions to be sure your new style will "play nice" with {{divbox}}. Note that this requires some understanding of CSS.

  1. Experiment in a drawing program, such as GraphicConverter or Adobe Photoshop, and decide what colors you want for your new box style. You need to find out the HTML color codes for each color.
  2. Open an existing box style template, such as {{divbox/style/red}}. Copy out the code.
  3. Create a new box style template page. It must be located in main Template namespace and must be named Template:divbox/style/XXXXX, where "XXXXX" is your new style name.
  4. Paste in the "borrowed" code and replace the color codes with your new, chosen colors. Save the new template.
  5. Return to this Talk page and add your new style to this documentation. Remember, a job's not over until the paperwork is done!

Note that you may even change the division box margins and paddings. This is not recommended. There are a couple of good reasons for specifying these values, and in these units. Most users who "roll their own" make choices with unintended consequences; {divbox} is meant to help you avoid these pitfalls.

See also[편집]

틀:Mbox templates see also