Created
June 3, 2015 09:27
-
-
Save d0ugal/53a1af8ec63c906cc203 to your computer and use it in GitHub Desktop.
A simple script to update MkDocs pages config to match the 0.13 style.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This expects you to be in an environment with MkDocs 0.13 or greater installed. | |
| Save the file, run it by passing in a mkdocs.yml and it will print out the | |
| converted version. Copy this into the config, tweak test and you are done! | |
| """ | |
| import click | |
| import yaml | |
| from mkdocs import legacy | |
| @click.command() | |
| @click.argument('config', type=click.File('rb')) | |
| def convert(config): | |
| config = yaml.load(config) | |
| print(yaml.dump(legacy.pages_compat_shim(config['pages']))) | |
| if __name__ == '__main__': | |
| convert() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment