Help:Định dạng

From mediawiki.org
This page is a translated version of the page Help:Formatting and the translation is 35% complete.
Outdated translations are marked like this.
PD Lưu ý: Khi bạn sửa đổi trang này, bạn đồng ý phát hành đóng góp của bạn theo giấy phép CC0. Xem trang trợ giúp cộng đồng để biết thêm. PD

Bạn có thể định dạng văn bản của mình bằng cách sử dụng định dạng wiki, được quy định bởi các ký tự thông thường như dấu hoa thị, dấu nháy đơn hoặc dấu bằng có ý nghĩa đặc biệt trong wiki, tùy thuộc vào vị trí của chúng. Ví dụ: để định dạng từ một từ được in nghiêng, bạn đặt nó trong hai cặp dấu nháy đơn như ''thế này'' .

Cách định dạng văn bản

Miêu tả Bạn gõ như thế này sẽ được
Định dạng cho văn bản - "sẽ áp dụng lên toàn bộ Wiki"
Chữ nghiêng
''In nghiêng''

In nghiêng

Chữ đậm
'''In đậm'''

In đậm

In đậm & in nghiêng
'''''in đậm & in nghiêng'''''

in đậm & in nghiêng

Không định dạng văn bản
<nowiki>không [[định dạng]] "theo chuẩn của wiki"</nowiki>

không [[định dạng]] "theo chuẩn của wiki"

Định dạng đề mục - "chỉ áp dụng lên các dòng đầu tiên của văn bản"
Các cấp độ định dạng đề mục khác nhau
== Cấp 2 ==

=== Cấp 3 ===

==== Cấp 4 ====

===== Cấp 5 =====

====== Cấp 6 ======

  • Đừng sử dụng cấp 1 vì đó là cấp dành riêng cho tiêu đề của bài viết.
  • Đừng gõ bất cứ cái gì trên cùng dòng sau dấu bằng.
  • Bài viết từ 4 đề mục trở lên sẽ tự động tạo bảng mục lục (trừ khi bạn sử dụng cụm từ kì diệu __NOTOC__).

Cấp 2

Cấp 3

Cấp 4

Cấp 5
Cấp 6
Dòng kẻ ngang
Dòng trên
----
Dòng dưới

Dòng trên


Dòng dưới

Danh sách
* Thêm vào trước mỗi dòng
* một [[Wikipedia:asterisk|dấu hoa thị]] (*).
** Càng thêm nhiều dấu hoa thị
*** các dòng chữ sẽ càng đi ra xa
* Ngắt dòng <br />không làm thay đổi vị trí của dòng bị ngắt.
*** tăng mức đột ngôt tạo ra một khoảng trống
Những bắt đầu dòng khác kết thúc danh sách

* kết hợp danh sách
** với định nghĩa
::- định nghĩa
** tạo một khoảng trống

* kết hợp danh sách
** với định nghĩa
*:- định nghĩa
** không tạo khoảng trống

*danh sách
:- định nghĩa
:* danh sách con không bị khoảng trống
:* Khỏang trống sau định nghĩa
  • Thêm vào trước mỗi dòng
  • một dấu hoa thị (*).
    • Càng thêm nhiều dấu hoa thị
      • các dòng chữ sẽ càng đi ra xa
  • Ngắt dòng
    không làm thay đổi vị trí của dòng bị ngắt.
      • tăng mức đột ngôt tạo ra một khoảng trống

Những bắt đầu dòng khác kết thúc danh sách

  • kết hợp danh sách
    • với định nghĩa
- định nghĩa
    • tạo một khoảng trống
  • kết hợp danh sách
    • với định nghĩa
    - định nghĩa
    • không tạo khoảng trống
  • danh sách
- định nghĩa
  • danh sách con không bị khoảng trống
  • Khỏang trống sau định nghĩa
Danh sách đánh số
# Bắt đầu mỗi dòng
# với một [[Wikipedia:Dấu thăng|dấu thăng]] (#).
## Nhiều dấu thăng, mức càng sâu
### và sâu hơn
# Ngắt dòng <br />không làm thay đổi mức.
### tăng mức đột ngôt tạo ra một khoảng trống
# Dòng trống

# kết thúc danh sách và bắt đầu cái mới.
Những bắt đầu dòng khác 
cũng kết thúc danh sách.

<nowiki>#</nowiki> use "nowiki" tags to display a literal (#) at the beginning of a line without interpreting it as a numbered list.
  1. Bắt đầu mỗi dòng
  2. với một dấu thăng (#).
    1. Nhiều dấu thăng, mức càng sâu
      1. và sâu hơn
  3. Ngắt dòng
    không làm thay đổi mức.
      1. tăng mức đột ngôt tạo ra một khoảng trống
  4. Dòng trống
  1. kết thúc danh sách và bắt đầu cái mới.

Những bắt đầu dòng khác cũng kết thúc danh sách.

# use "nowiki" tags to display a literal (#) at the beginning of a line without interpreting it as a numbered list.

Danh sách định nghĩa
;Tên 1
: Định nghĩa 1
;Tên 2
: Định nghĩa 2-1
: Định nghĩa 2-2
Cuối dòng được bắt đầu bằng dấu chấm phẩy (;), mọi dấu hai chấm (:) sẽ không được hiển thị. nếu muốn hiển thị dấu hai chấm (:), goc thêm &#58;.
Tên 1
Định nghĩa 1
Tên 2
Định nghĩa 2-1
Định nghĩa 2-2
Căn lề
: Cách lề một khoảng
:: Cách lề hai khoảng
::::: Cách lề nhiều khoảng

Cách làm này không phải là giải pháp tốt.
Cách lề một khoảng
Cách lề hai khoảng
Cách lề nhiều khoảng
Kết hợp các kiểu danh sách
# một
# hai
#* một chấm một
#* một chấm hai
# ba
#; ba tên một
#: ba định nghĩa một
# bốn
#: bốn định nghĩa một
#: có vẻ như vẫn tiếp tục
#: và thường được sử dụng 
#: thay cho <br> of <nowiki><br></nowiki>
# năm
## năm chấm một
### năm chấm một chấm một
## năm chấm hai

The usage of #: and *: for breaking a line within an item may also harm accessibility.
  1. one
  2. two
    • two point one
    • two point two
  3. three
    three item one
    three def one
  4. four
    four def one
    this looks like a continuation
    and is often used
    instead
    of <br>
  5. five
    1. five sub 1
      1. five sub 1 sub 1
    2. five sub 2
Preformatted text
 Start each line with a space.
 Text is '''preformatted''' and
 ''markups'' '''''can''''' be done.

This way of preformatting only applies to section formatting. Character formatting markups are still effective.
Start each line with a space.
Text is preformatted and
markups can be done.
Preformatted text blocks
 <nowiki>Start with a space in the first column,
(before the <nowiki>).

Then your block format will be
    maintained.

This is good for copying in code blocks:

def function():
    """documentation string"""

    if True:
        print True
    else:
        print False</nowiki>
Start with a space in the first column,
(before the <nowiki>).

Then your block format will be
    maintained.

This is good for copying in code blocks:

def function():
    """documentation string"""

    if True:
        print True
    else:
        print False

Paragraphs

MediaWiki ignores single line breaks. To start a new paragraph, leave an empty line. You can force a line break within a paragraph with the HTML tag ‎<br />.

HTML tags

Some HTML tags are allowed in MediaWiki, for example ‎<code>, ‎<div>, and ‎<span>. These apply anywhere you insert them.

Description You type You get
Inserted
(Displays as underline in most browsers)
<ins>Inserted</ins>

or

<u>Underline</u>

Inserted

or

Underline

Deleted
(Displays as strike-through in most browsers)
<s>Strike-through</s>

or

<del>Deleted</del>

Strike-through

or

Deleted

Fixed width text
<code>Mã nguồn</code>
Mã nguồn
Blockquotes
Text before
<blockquote>Blockquote</blockquote>
Text after
If the quote contains multiple paragraphs the tags need to be on separate lines to display properly, i.e.:
<blockquote>
First paragraph.

Second paragraph.
</blockquote>

Text before

Blockquote

Text after

Quotes
<q>This is a quotation</q>
The q element must not be used in place of quotation marks that do not represent quotes; for example, it is inappropriate to use the q element for marking up sarcastic statements.[1]
This is a quotation
Comment
<!-- This is a comment -->
Comments are visible only 
in the edit zone.

Comments are visible only in the edit zone.

Completely preformatted text
<pre>
Text is '''preformatted''' and 
''markups'' '''''cannot''''' be done
</pre>

For marking up of preformatted text, check the "Preformatted text" entry at the end of the previous table.
Text is '''preformatted''' and 
''markups'' '''''cannot''''' be done
Customized preformatted text
<pre style="color: red">
Text is '''preformatted''' 
with a style and 
''markups'' '''''cannot''''' be done
</pre>

A CSS style can be named within the style attribute.
Text is '''preformatted''' 
with a style and 
''markups'' '''''cannot''''' be done

continued:

Description You type You get
Default preformatted text has a CSS attribute (white-space: pre-wrap;) to wrap the text according to available width
<pre>
This long sentence is used to demonstrate text wrapping. This additional sentence makes the text even longer. This additional sentence makes the text even longer.
</pre>
This long sentence is used to demonstrate text wrapping. This additional sentence makes the text even longer. This additional sentence makes the text even longer.
Customized preformatted text with disabled text wrapping
<pre style="white-space: pre;">
This long sentence is used to demonstrate text wrapping. This additional sentence makes the text even longer. This additional sentence makes the text even longer.
</pre>
This long sentence is used to demonstrate text wrapping. This additional sentence makes the text even longer. This additional sentence makes the text even longer.


Inserting symbols

Symbols and other special characters not available on your keyboard can be inserted in a multitude of ways. Many Operating Systems and browsers allow you to insert special characters through a menu option or Operating System panel. Additionally, you can use the WikiEditor or VisualEditor to insert them into the edit screen.

As a last resort, you can use a special sequence of characters. Those sequences are called HTML entities. For example, the following sequence (entity) &rarr; when inserted will be shown as right arrow HTML symbol → and &mdash; when inserted will be shown as an em dash HTML symbol —.


Hover over any symbol to reveal the entity that produces it. Some symbols not available in the current font will appear as empty squares.
HTML symbol entities
Á á Â â ´ Æ æ À à Α α & Å å Ã ã Ä ä Β β ¦ Ç ç ¸ ¢
Χ χ ˆ © ¤ ° Δ δ ÷ É é Ê ê È è Ε ε Η η
Ð ð Ë ë ƒ ½ ¼ ¾ Γ γ > Í í Î î ¡ Ì ì Ι ι
¿ Ï ï Κ κ Λ λ « < ¯ µ · Μ μ  
¬ Ñ ñ Ν ν Ó ó Ô ô Œ œ Ò ò Ω ω Ο ο ª º Ø ø Õ õ Ö
ö Φ φ Π π ϖ ± £ Ψ ψ " » ® Ρ ρ
Š š § ­ Σ σ ς ¹ ² ³ ß Τ τ Θ θ ϑ Þ þ ˜
× Ú ú Û û Ù ù ¨ ϒ Υ υ Ü ü Ξ ξ Ý ý ¥ ÿ Ÿ Ζ ζ
Description You type You get
Copyright symbol &copy;
©
Greek delta letter symbol &delta;
δ
Euro currency symbol &euro;

See the list of all HTML entities on the Wikipedia article List of HTML entities. Additionally, MediaWiki supports two non-standard entity reference sequences: &רלמ; and &رلم; which are both considered equivalent to &rlm; which is a right-to-left mark. (Used when combining right to left languages with left to right languages in the same page.)

HTML tags and symbol entities displayed themselves (with and without interpreting them)

&amp;euro;  → &euro;
<span style="color: red; text-decoration: line-through;">Typo to be corrected</span>  → Typo to be corrected
&lt;span style="color: red; text-decoration: line-through;">Typo to be corrected</span>  → <span style="color: red; text-decoration: line-through;">Typo to be corrected</span>

Nowiki for HTML

‎<nowiki /> can prohibit (HTML) tags:

  • <<nowiki />pre>  → <pre>

But not & symbol escapes:

  • &<nowiki />amp;  → &

To print & symbol escapes as text, use "&amp;" to replace the "&" character (eg. type "&amp;nbsp;", which results in "&nbsp;").

Other formatting

Beyond the text formatting markup shown hereinbefore, here are some other formatting references:

You can find more references at Help:Mục lục .

References