blob: e2d7649f585fe095e233f24e6899a41708f040b2 [file] [log] [blame]
John DeNisco06dcd452018-07-26 12:45:10 -04001.. _styleguide02:
2
3*************************
4Bullets, Bold and Italics
5*************************
6
7Bold text can be show with **Bold Text**, Italics with *Italic text*. Bullets like so:
8
9* Bullet 1
10* Bullet 2
11
12#. Numbered Bullet 1
13#. Numbered Bullet 2
14
15*****
16Notes
17*****
18
19A note can be used to describe something not in the normal flow of the paragragh. This
20is an example of a note.
21
22.. note::
23
24 Using **git commit** after adding your files saves a "Snapshot" of them, so it's very hard
25 to lose your work if you *commit often*.
26
27***********
28Code Blocks
29***********
30
31This paragraph describes how to do **Console Commands**. When showing VPP commands it is reccomended
32that the command be executed from the linux console as shown. The Highlighting in the final documents
33shows up nicely this way.
34
35.. code-block:: console
36
37 $ sudo bash
38 # vppctl show interface
39 Name Idx State Counter Count
40 TenGigabitEthernet86/0/0 1 up rx packets 6569213
41 rx bytes 9928352943
42 tx packets 50384
43 tx bytes 3329279
44 TenGigabitEthernet86/0/1 2 down
45 VirtualEthernet0/0/0 3 up rx packets 50384
46 rx bytes 3329279
47 tx packets 6569213
48 tx bytes 9928352943
49 drops 1498
50 local0 0 down
51 #
52
53
54The **code-block** construct is also used for code samples. The following shows how to include a block of
55"C" code.
56
57.. code-block:: c
58
59 #include <vlib/unix/unix.h>
60 abf_policy_t *
61 abf_policy_get (u32 index)
62 {
63 return (pool_elt_at_index (abf_policy_pool, index));
64 }
65
66Diffs are generated in the final docs nicely with "::" at the end of the description like so::
67
68 diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c
69 index 6e136e19..69189c93 100644
70 --- a/src/vpp/vnet/main.c
71 +++ b/src/vpp/vnet/main.c
72 @@ -18,6 +18,8 @@
73 #include <vlib/unix/unix.h>
74 #include <vnet/plugin/plugin.h>
75 #include <vnet/ethernet/ethernet.h>
76 +#include <vnet/ip/ip4_packet.h>
77 +#include <vnet/ip/format.h>
78 #include <vpp/app/version.h>
79 #include <vpp/api/vpe_msg_enum.h>
80 #include <limits.h>
81 @@ -400,6 +402,63 @@ VLIB_CLI_COMMAND (test_crash_command, static) = {
82
83 #endif