markdown.rst 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. Using Markdown in Pagure
  2. ========================
  3. Pagure uses `Markdown syntax highlighting
  4. <https://daringfireball.net/projects/markdown/syntax>`_ as the base for
  5. formatting comments in issues, pull requests, and in Markdown files in
  6. repositories. For basic formatting, Pagure follows common Markdown
  7. formatting, but it also has some unique syntax for more advanced
  8. formatting. This help page helps demonstrate how to use Markdown in Pagure.
  9. Pagure relies on the `Markdown <https://python-markdown.github.io/>`_ python
  10. module to do the conversion.
  11. It has enabled a few extensions:
  12. - `Definition Lists <https://python-markdown.github.io/extensions/definition_lists/>`_
  13. - `Fenced Code Blocks <https://python-markdown.github.io/extensions/fenced_code_blocks/>`_
  14. - `Tables <https://python-markdown.github.io/extensions/tables/>`_
  15. - `Admonition <https://python-markdown.github.io/extensions/admonition/>`_
  16. - `CodeHilite <https://python-markdown.github.io/extensions/code_hilite/>`_
  17. - `Sane lists <https://python-markdown.github.io/extensions/sane_lists/>`_
  18. README files can also rely on:
  19. - `Abbreviations <https://python-markdown.github.io/extensions/abbreviations/>`_
  20. - `Footnotes <https://python-markdown.github.io/extensions/footnotes/>`_
  21. - `Table of Contents <https://python-markdown.github.io/extensions/toc/>`_
  22. While comments use:
  23. - `New Line to Break <https://python-markdown.github.io/extensions/nl2br/>`_
  24. .. warning:: Pagure does not support linking to remote images, if you want
  25. to link to an image on a ticket, you will have to upload it to pagure.
  26. Styling
  27. -------
  28. .. role:: strike
  29. :class: strike
  30. You can mark up text with bold, italics, or strikethrough.
  31. * **Style**: Bold
  32. * Syntax: `** **` or `__ __`
  33. * Example: `**This is bold text**`
  34. * Output: **This is bold text**
  35. * **Style**: Italics
  36. * Syntax: `* *` or `_ _`
  37. * Example: `_This is italicized text_`
  38. * Output: *This is italicized text*
  39. * **Style**: Strikethrough
  40. * Syntax: `~~ ~~`
  41. * Example: `~~This text is no longer relevant~~`
  42. * Output: :strike:`This text is no longer relevant`
  43. * **Style**: Bold and italics
  44. * Syntax: `** **` and `_ _`
  45. * Example: `** This text is the _most important thing ever_ **`
  46. * Output: ** This text is the *most important thing ever* **
  47. Quoting
  48. -------
  49. You can show text as being quoted with the `>` character.
  50. ::
  51. Before merging this pull request, remember Clark Kent mentioned this:
  52. > Double-check there's no reference to the Kryptonite library in the program since we removed that a few versions ago.
  53. Before merging this pull request, remember Clark Kent mentioned this:
  54. Double-check there's no reference to the Kryptonite library in the program since we removed that a few versions ago.
  55. You can also make a line-wrapping blockquote using <br/>.
  56. ::
  57. Remember what Solomon said:
  58. > I don't want to survive. <br/> I want to live.
  59. Remember what Solomon said:
  60. I don't want to survive.
  61. I want to live.
  62. For more details regarding Blockquote, refer
  63. `Blockquote <https://daringfireball.net/projects/markdown/syntax#blockquote>`_.
  64. Code
  65. ----
  66. You can highlight parts of a line as code or create entire code blocks in
  67. your Markdown documents. You can do this with the backtick character (`).
  68. Text inside of backticks will not be formatted.
  69. ::
  70. When running the program for the first time, use `superman --initialize`.
  71. When running the program for the first time, use ``superman --initialize``.
  72. To format multiple lines of code into its own block, you can wrap the text
  73. block with four tilde (~) characters
  74. ::
  75. Install the needed system libraries:
  76. `~~~~`
  77. sudo dnf install git python-virtualenv libgit2-devel \
  78. libjpeg-devel gcc libffi-devel redhat-rpm-config
  79. `~~~~`
  80. Install the needed system libraries:
  81. ::
  82. sudo dnf install git python-virtualenv libgit2-devel \
  83. libjpeg-devel gcc libffi-devel redhat-rpm-config
  84. Hyperlinks
  85. ----------
  86. Regular links
  87. ^^^^^^^^^^^^^
  88. Need to embed a link to somewhere else? No problem! You can create an
  89. in-line link by wrapping the text in `[ ]` and appending the URL in
  90. parentheses `( )` immediately after.
  91. `Pagure is used by the [Fedora Project](https://fedoraproject.org).`
  92. Pagure is used by the `Fedora Project <https://fedoraproject.org>`_.
  93. Links to ticket/PR of the same project
  94. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  95. You want to link to a ticket or a pull-request in the current project? Easy
  96. just use `#` immediately followed by the identifier of the ticket or
  97. pull-request.
  98. `This is an example for #2921`
  99. This is an example for `#2921 <https://pagure.io/pagure/issue/2921>`_
  100. Links to ticket/PR of another project
  101. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  102. You want to link to a ticket or a pull-request of a different project? Simply
  103. add the project name in front of the `#` and immediately followed by the
  104. identifier of the ticket or pull-request.
  105. `This is an example for pagure#2921`
  106. This is an example for `pagure#2921 <https://pagure.io/pagure/issue/2921>`_
  107. Lists
  108. -----
  109. Unordered lists
  110. ^^^^^^^^^^^^^^^
  111. You can make unordered lists spanning multiple lines with either `-` or `*`.
  112. ::
  113. * Superman
  114. * Batman
  115. * Protector of Gotham City!
  116. * Superwoman
  117. * Harley Quinn
  118. * Something on this list is unlike the others...
  119. * Superman
  120. * Batman
  121. * Protector of Gotham City!
  122. * Superwoman
  123. * Harley Quinn
  124. * Something on this list is unlike the others...
  125. Ordered lists
  126. ^^^^^^^^^^^^^
  127. You can make ordered lists by preceding each line with a number.
  128. ::
  129. 1. Superman
  130. 2. Batman
  131. 1. Protector of Gotham City!
  132. 2. He drives the Batmobile!
  133. 3. Superwoman
  134. 4. Harley Quinn
  135. 1. Something on this list is unlike the others...
  136. 2. Somebody evil lurks on this list!
  137. 1. Superman
  138. 2. Batman
  139. 1. Protector of Gotham City!
  140. 2. He drives the Batmobile!
  141. 3. Superwoman
  142. 4. Harley Quinn
  143. 1. Something on this list is unlike the others...
  144. 2. Somebody evil lurks on this list!
  145. Tagging users
  146. -------------
  147. You can tag other users on Pagure to send them a notification about an issue
  148. or pull request. To tag a user, use the `@` symbol followed by their username.
  149. Typing the `@` symbol in a comment will bring up a list of users that match
  150. the username. The list searches as you type. Once you see the name of the
  151. person you are looking for, you can click their name to automatically
  152. complete the tag.
  153. `@jflory7, could you please review this pull request and leave feedback?`
  154. `@jflory7 <https://pagure.io/user/jflory7>`_, could you please review this pull request and leave feedback?
  155. Tagging issues or pull requests
  156. -------------------------------
  157. In a comment, you can automatically link a pull request or issue by its number.
  158. To link it, use the `#` character followed by its number. Like with tagging
  159. users, Pagure will provide suggestions for issues or pull requests as you
  160. type the number. You can select the issue in the drop-down to automatically
  161. tag the issue or pull request.
  162. If you need to tag an issue or pull request that is outside of the current
  163. project, you are also able to do this. For cross-projects links, you can tag
  164. them by typing `<project name>#id` or `<username>/<project name>#id`.
  165. Emoji
  166. -----
  167. Pagure natively supports emoji characters. To use emoji, you can use two
  168. colons wrapped around the emoji keyword (`:emoji:`). Typing a colon by itself
  169. will bring up a list of suggested emoji with a small preview. If you see the
  170. one you are looking for, you can click it to automatically complete the emoji.
  171. `I reviewed the PR and it looks good to me. :+1: Good to merge! :clapper:`
  172. I reviewed the PR and it looks good to me. 👍 Good to merge! 🎬
  173. Improve this documentation!
  174. ---------------------------
  175. Notice anything that can be improved in this documentation? Find a mistake?
  176. You can improve this page! Find it in the official
  177. `Pagure repository <https://pagure.io/pagure/blob/master/f/doc/usage/markdown.rst>`_.