reStructuredText in GitHub


  • Headers

    Top Title
    =========
    
    Sub Title
    ---------
    
    Sub Sub Title
    ^^^^^^^^^^^^^
    
  • Images

    • Direct

      .. figure:: image-path-or-url
          :align: center
          :target: link-to-go-when-image-is-clicked
          :alt: alternative-text-if-any
      
    • Indirect

      .. |substitution| image:: image-path-or-url
          :target: link-to-go-when-image-is-clicked
      

      You can use |substitution| where you want to put your image.

  • Links

    `Link Text <link-itself>`__
    
  • Lists

    - item 1
    - item 2
    
    * item 1
    * itme 2
    
    #. item 1
    #. item 2
    
    1. item 1
    2. item 2
    

    First two lists are unordered next two are ordered.

  • Code

    • Inline

      :code:`your-code`
      
    • Code block

      .. code-block:: language(optional)
      
          Your code
          in multiple lines. You may enable line numbers too.
      
  • Tables

    +----------------+----------------+
    | Header Cell    | Header Cell    |
    +================+================+
    | Data cell      | Data Cell      |
    +----------------+----------------+
    | Header Cell    | Header Cell    |
    +----------------+----------------+
    
  • Raw HTML block

    .. raw:: html
    
        <put>
            your html code here
        </put>
    
  • Notes, warnings

    .. note::
    
        Put your note here.
    
    .. warning::
    
        Put your warning here.
    
    .. important::
    
        Put instructions here.
    
    .. admonition:: custom-text
    
        Custom description here.
    

These all are supported by GitHub very well. For more exhautive list specific to Sphinx see this link.

Tips

  • There must be a blank line before and after any directive. Such as after title or code block, tables etc.
  • The options and content of a directives must be 1 tab indented to the directives.

This Blog is licensed under Attribution-NonCommercial 4.0 International


You may put your GitHub Username.
I'll never share your email with anyone else.
Please Enter something !
Enter upto 200 characters.