Skip to content

Commit 4b65f9f

Browse files
committed
Added regex to identify API section of readme
1 parent 9483ccb commit 4b65f9f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

nicedoc/regex_utils.py

+15
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,18 @@
1212

1313
# Given a python file, extracts all the camelcased variable/methods/functions.
1414
EXTRACT_CAMEL = r"(^(?!\s*print.*).*)((\b[a-z]+)(([A-Z]+[a-z]+)+?)\b)"
15+
16+
# Splits the readme contents based on the API section.
17+
# This assumes that API is a <h2> header, i.e ## API, and is followed by a <h3> Todo (### Todo).
18+
# Parts Captured Group
19+
# Everything that
20+
# comes before the 1
21+
# API section
22+
#
23+
# API section along
24+
# with its contents 2
25+
#
26+
# Everything that
27+
# comes after the 3
28+
# API section
29+
SPLIT_README_BY_API = r"^(?<![.\n])(.*\s*)*?(## API(.*\s*)*?)(###\sTodo(.*\s*)*)"

0 commit comments

Comments
 (0)