docs: convert plugins doc md->rst
[vpp.git] / docs / gettingstarted / writingdocs / styleguidemd / styleguide02.md
1 Bullets, Bold and Italics
2 =========================
3
4 Bold text can be show with **Bold Text**, Italics with *Italic text*.
5 Bullets like so:
6
7 -   Bullet 1
8 -   Bullet 2
9
10 Code Blocks
11 ===========
12
13 This paragraph describes how to do **Console Commands**. When showing
14 VPP commands it is recommended that the command be executed from the
15 linux console as shown. The Highlighting in the final documents shows up
16 nicely this way.
17
18 ``` console
19 $ sudo bash
20 # vppctl show interface
21               Name               Idx       State          Counter          Count     
22 TenGigabitEthernet86/0/0          1         up       rx packets               6569213
23                                                      rx bytes              9928352943
24                                                      tx packets                 50384
25                                                      tx bytes                 3329279
26 TenGigabitEthernet86/0/1          2        down      
27 VirtualEthernet0/0/0              3         up       rx packets                 50384
28                                                      rx bytes                 3329279
29                                                      tx packets               6569213
30                                                      tx bytes              9928352943
31                                                      drops                       1498
32 local0                            0        down      
33 #
34 ```
35
36 The **code-block** construct is also used for code samples. The
37 following shows how to include a block of \"C\" code.
38
39 ``` c
40 #include <vlib/unix/unix.h>
41 abf_policy_t *
42 abf_policy_get (u32 index)
43 {
44   return (pool_elt_at_index (abf_policy_pool, index));
45 }
46 ```
47
48 Diffs are generated in the final docs nicely with \":\" at the end of
49 the description like so:
50
51     diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c
52     index 6e136e19..69189c93 100644
53     --- a/src/vpp/vnet/main.c
54     +++ b/src/vpp/vnet/main.c
55     @@ -18,6 +18,8 @@
56      #include <vlib/unix/unix.h>
57      #include <vnet/plugin/plugin.h>
58      #include <vnet/ethernet/ethernet.h>
59     +#include <vnet/ip/ip4_packet.h>
60     +#include <vnet/ip/format.h>
61      #include <vpp/app/version.h>
62      #include <vpp/api/vpe_msg_enum.h>
63      #include <limits.h>
64     @@ -400,6 +402,63 @@ VLIB_CLI_COMMAND (test_crash_command, static) = {
65
66      #endif