added support for markdown comments

This commit is contained in:
Dmytro Yeroshkin 2021-10-22 10:36:58 +02:00
parent 71fb8cfd0c
commit c549f0fc7f
1 changed files with 3 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import sys
CHAPTER_MARKER = '## '
STATUS_MARKER = '[status]: # '
ACT_MARKER = '[act]: # '
COMMENT_MARKER = '[//]: # '
def count_words(line):
@ -48,6 +49,8 @@ def main():
elif line.startswith(ACT_MARKER):
act_number = int(line[len(ACT_MARKER):].strip('()\n'))
word_count_by_act[act_number] = 1
elif line.startswith(COMMENT_MARKER):
pass
else:
line_word_count = count_words(line)
word_count_by_chapter[chapter_number] += line_word_count