Plugin Configuration Module¶
This section is about the module that plays the role to handle the plugin configuration which independent from the plugin core.
It will be called by plugin core and CLI directly.
MkdocsNoteConfig ¶
Bases: Config
Configuration class, managing all configuration parameters.
Source code in src/mkdocs_note/config.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
enabled = config_opt.Type(bool, default=True) class-attribute instance-attribute ¶
Whether the plugin is enabled.
graph_config = config_opt.Type(dict, default={'enabled': False, 'name': 'title', 'debug': False}) class-attribute instance-attribute ¶
Configuration for the network graph visualization.
Available options: - name: Node naming strategy ("title" or "file_name") - debug: Enable debug logging for graph generation
notes_root = config_opt.Dir(exists=False, default='docs') class-attribute instance-attribute ¶
The directory of the notes, which defines the plugin's working scope. All note scanning, file operations, and asset management are limited to this directory.
notion_sync = config_opt.Type(dict, default={'docs_dir': 'docs', 'nav_file': 'docs/.nav.yml', 'database_id': '', 'data_source_id': '', 'title_property': '页面', 'tags_property': '标签', 'site_url': '', 'state_path': '.notion_sync_state.json', 'delay': 0.35, 'local_images': 'upload', 'cache_dir': '.cache/mkdocs-note', 'allow_cursor_mcp_token': False, 'silence_mcp_token_warning': False}) class-attribute instance-attribute ¶
Configuration for Notion wiki sync (CLI: mkdocs-note notion-sync).
Available options: - docs_dir: Documentation root (git diff / relative path base) - nav_file: Path to awesome-nav .nav.yml (relative to project root) - database_id: Notion wiki database / page ID (or env NOTION_WIKI_DATABASE) - data_source_id: Notion data source ID (or env NOTION_WIKI_DATA_SOURCE) - title_property: Title property name (default: 页面) - tags_property: Multi-select tags property name (default: 标签) - site_url: Public site URL for remote image fallbacks - state_path: Local page-map JSON path - delay: Seconds between Notion API calls - local_images: upload local files, or site to use MkDocs site URLs - cache_dir: Directory for --full resume checkpoints - allow_cursor_mcp_token: Developer-only; allow reading token from Cursor mcp.json - silence_mcp_token_warning: Suppress the MCP-token usage warning
preview_config = config_opt.Type(dict, default={'enabled': False, 'mode': 'summary', 'delay_ms': 300, 'max_chars': 200, 'include_fragments': True, 'mobile': False, 'scope': 'linked_only'}) class-attribute instance-attribute ¶
Configuration for same-site link hover previews.
Available options: - enabled: Opt-in; when false the feature is a full no-op - mode: summary (title + abstract) or excerpt (section body / HTML) - delay_ms: Hover delay before showing the card - max_chars: Truncation length for plain-text summaries / excerpts - include_fragments: Emit #heading keys when mode is excerpt - mobile: Enable touch preview strategy (default off) - scope: linked_only (link targets only) or all pages
recent_notes_config = config_opt.Type(dict, default={'enabled': False, 'insert_marker': '<!-- recent_notes -->', 'insert_num': 10}) class-attribute instance-attribute ¶
Configuration for the recent notes. Available options: - enabled: Whether to enable the recent notes - insert_marker: The marker to insert the recent notes - insert_num: The number of recent notes to insert