INNER CODE UNIT · Python

main

rust-lang/rfcs · generate-book.py:27

def main():
    if os.path.exists('src'):
        # Clear out src to remove stale links in case you switch branches.
        shutil.rmtree('src')
    os.mkdir('src')

    for path in os.listdir('text'):
        symlink(f'../text/{path}', f'src/{path}')
    symlink(f'../compiler_changes.md', f'src/compiler_changes.md')
    symlink(f'../lang_changes.md', f'src/lang_changes.md')
    symlink(f'../libs_changes.md', f'src/libs_changes.md')
    symlink('../README.md', 'src/introduction.md')

    with open('src/SUMMARY.md', 'w') as summary:
        summary.write('[Introduction](introduction.md)\n\n')
        summary.write('- [Guidelines for compiler changes](compiler_changes.md)\n')
        summary.write('- [Guidelines for language changes](lang_changes.md)\n')
        summary.write('- [Guidelines for library changes](libs_changes.md)\n')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…