Add wordcount
This commit is contained in:
parent
70351adae6
commit
805ddbcadb
2 changed files with 4 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
from md_pdf.consts import TEMPLATES_DIR, STATIC_DIR
|
||||
from word_count import word_count
|
||||
|
||||
|
||||
EXTRA_CONTEXT = {
|
||||
|
@ -11,4 +12,5 @@ def get_context(config, content):
|
|||
context = config['context'].copy()
|
||||
context['title'] = config['title']
|
||||
context = dict(context, **EXTRA_CONTEXT)
|
||||
context['word_count'] = word_count(content)
|
||||
return context
|
||||
|
|
3
setup.py
3
setup.py
|
@ -12,7 +12,8 @@ setup(
|
|||
"progressbar2==3.16.0",
|
||||
"pypandoc==1.3.3",
|
||||
"pyscss==1.3.5",
|
||||
"PyYAML==3.12"
|
||||
"PyYAML==3.12",
|
||||
"word-count==0.1.0"
|
||||
],
|
||||
setup_requires=['setuptools_scm'],
|
||||
packages=find_packages(),
|
||||
|
|
Reference in a new issue