diff options
author | Teddy Wing | 2018-12-10 20:51:17 +0100 |
---|---|---|
committer | Teddy Wing | 2018-12-12 23:24:29 +0100 |
commit | 33edb225a1f2d77afee5434ea37b9c9258369194 (patch) | |
tree | fcdeb2d3d3c3f4b4c8941fa769cbff8c8f29c559 /README.md | |
parent | cbdd6901e01c531fd1316d9744887b6294ea3f6b (diff) | |
download | Comment-Syntax-33edb225a1f2d77afee5434ea37b9c9258369194.tar.bz2 |
Add comments_by_extension.toml
Based on `comments.toml` but keyed by file extension instead of language
name.
Generated using the following two scripts with some additional manual
modification:
convert_file_extension_keys_toml.py:
#!/usr/bin/env python3
import toml
comments = toml.load('comments.toml')
by_extension = {}
for language, attributes in comments.items():
if 'extensions' in attributes:
value = attributes
extensions = value.pop('extensions')
value['name'] = language
for extension in extensions:
by_extension[extension] = value
with open('comments_by_extension.toml', 'w') as f:
toml.dump(by_extension, f)
sort_file_extensions.py:
#!/usr/bin/env python3
from collections import OrderedDict
import toml
comments = toml.load('comments_by_extension.toml')
comments = OrderedDict(sorted(comments.items()))
with open('comments_by_extension.toml', 'w') as f:
toml.dump(comments, f)
Diffstat (limited to 'README.md')
0 files changed, 0 insertions, 0 deletions