예제 #1
0
    store_categories(session)

    if args.develop:
        deploy_domain = "http://localhost:8000"
        public_path = "/static/dist/"

    else:
        deploy_domain = f"https://{my_config.DEPLOYMENT_DOMAIN}"
        public_path = f"/MyNotes/static/dist/"

    env.globals.update({"domain": deploy_domain, "develop": args.develop})
    env.filters["resolve"] = partial(hashed_filename, url_prefix=public_path)
    env.trim_blocks = True
    env.lstrip_blocks = True
    custom_config = Config()
    custom_config.extra_loaders = env.loader
    custom_config.ClearMetadataPreprocessor.enabled = True
    custom_config.NotesExporter.preprocessors = [
        MyNotesData,
        RemoveExecutionCount,
        ExtractModuleUsage(
            ignored=["os", "subprocess", "glob", "base64", "pathlib", "io"]),
        KeywordPreprocessor,
        NBTitleMarkdown,
        NBDateProcessor,
    ]
    custom_config.TemplateExporter.exclude_input_prompt = True
    custom_config.TemplateExporter.exclude_output_prompt = True
    custom_config.NotesExporter.exclude_anchor_links = True

    for dir, folders, files in os.walk(my_config.NOTES_DIR):