print('Copying start')
with open('./src/lib.rs', 'r') as readme_file:
lines = [line for line in readme_file if line.startswith('//!')]
badges = (
'[](https://github.com/4lineclear/easy-sgr/actions) '
'[](https://crates.io/crates/easy-sgr) '
'[](https://docs.rs/easy-sgr) '
'[](https://github.com/4lineclear/easy-sgr/blob/main/LICENSE) '
'[](https://codecov.io/gh/4lineclear/easy-sgr)'
)
with open('./README.md', 'w') as readme_file:
readme_file.write(f'# easy-sgr\n\n{badges}\n\n')
for line in lines:
line = line[4:]
if len(line) == 0:
readme_file.write('\n')
else:
readme_file.write(line)
print('Copying complete')