Skip to content

Commit 6c21e65

Browse files
committed
docs:add sample code-block for header file include
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 1a0224a commit 6c21e65

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/_ext/gen_include.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ def generate_directives(header_file_path, xml_directory_path):
142142
rst_output += "\n"
143143
if not api_name.startswith("_"):
144144
rst_output += get_rst_header("Header File")
145-
rst_output += "* :header_src_file:`" + header_file_path + "`\n"
146-
rst_output += "\n"
145+
rst_output += "Source: :header_src_file:`" + header_file_path + "`\n"
146+
rst_output += "\n\n"
147+
rst_output += ".. code-block:: c\n\n"
148+
rst_output += "\t#include <" + header_file_path[8:] + ">\n\n"
147149

148150
try:
149151
import xml.etree.cElementTree as ET

0 commit comments

Comments
 (0)