set a proper name to function
This commit is contained in:
parent
1c80d84e9c
commit
382ad016d3
@ -94,7 +94,7 @@ endsnippet
|
|||||||
global !p
|
global !p
|
||||||
import re
|
import re
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
def find_all_code_type(path):
|
def get_popular_code_type(path):
|
||||||
with open(path) as source:
|
with open(path) as source:
|
||||||
types = re.findall(r'[:|\.\.\s]code::?\s(\w+)', source.read())
|
types = re.findall(r'[:|\.\.\s]code::?\s(\w+)', source.read())
|
||||||
try:
|
try:
|
||||||
@ -105,7 +105,7 @@ def find_all_code_type(path):
|
|||||||
return popular_type
|
return popular_type
|
||||||
endglobal
|
endglobal
|
||||||
snippet cb "Code Block" b
|
snippet cb "Code Block" b
|
||||||
.. code-block:: ${1:`!p snip.rv = find_all_code_type(path)`}
|
.. code-block:: ${1:`!p snip.rv = get_popular_code_type(path)`}
|
||||||
|
|
||||||
${2:code}
|
${2:code}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user