Skip to content

Commit be7fb12

Browse files
committed
docs.py: Removed duplicate function
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
1 parent c9dfccd commit be7fb12

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

src/cfengine_cli/docs.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,6 @@ def get_markdown_files(start, languages):
9898
return return_dict
9999

100100

101-
def _leading_spaces(s):
102-
n = 0
103-
for c in s:
104-
if c == " ":
105-
n += 1
106-
else:
107-
return n
108-
return n
109-
110-
111101
def _remove_indentation(snippet_lines, indent):
112102
for i, line in enumerate(snippet_lines):
113103
if line == "":
@@ -122,7 +112,7 @@ def fn_extract(origin_path, snippet_path, _language, first_line, last_line):
122112
lines = f.readlines()
123113
lines = [x[0:-1] for x in lines] # Remove newlines
124114
fence = lines[first_line]
125-
indent = _leading_spaces(fence)
115+
indent = count_indent(fence)
126116
snippet_lines = lines[first_line + 1 : last_line - 1]
127117
_remove_indentation(snippet_lines, indent)
128118
code_snippet = "\n".join(snippet_lines)

0 commit comments

Comments
 (0)