Code Markup Superef
The example in the first box is a copyable template for a complete instance of code-block. The text below it is the same content rendered as html using the Read-The-Docs theme.
.. code-block:: bash
:linenos:
:lineno-start: 15
:emphasize-lines: 1,3,5
:caption: Directives for code-block
:name: Directives listing for code-block directive
To enable line numbers, as they are here, add the :code:`:linenos:` directive.
Use `:lineno-start:` to start line numbering at a value other than 1
`:emphasize-lines:` applies highlighting to the lines specified.
Specify a name for the code-block using the `:caption:` directive.
Use the `:name:` directive to provide a label for linking
There are many directives that can be set for `code-block`.
ReST content rendered as HTML via sphinx and the Read-The-Docs theme.
To enable line numbers, as they are here, add the :linenos: directive. Use :lineno-start: to start line numbering at a value other than 1 :emphasize-lines: applies highlighting to the lines specified. Specify a name for the code-block using the :caption: directive. Use the :name: directive to provide a label for linking There are many directives that can be set for code-block.
ReST content rendered to HTML via IDZ.
To enable line numbers, as they are here, add the :linenos: directive. Use :lineno-start: to start line numbering at a value other than 1 :emphasize-lines: applies highlighting to the lines specified. Specify a name for the code-block using the :caption: directive. Use the :name: directive to provide a label for linking There are many directives that can be set for code-block.
Warnings
Do NOT escape asterisks, backslashes, underscores, and vertical pipes in code-blocks.

#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
# Python Program to find the area of triangle
a = 5
b = 6
c = 7
# Uncomment below to take inputs from the user
# a = float(input('Enter first side: '))
# b = float(input('Enter second side: '))
# c = float(input('Enter third side: '))
# calculate the semi-perimeter
s = (a + b + c) / 2
# calculate the area
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print('The area of the triangle is %0.2f' %area)