Skip to content

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
class MkdocsNoteConfig(Config):
	"""Configuration class, managing all configuration parameters."""

	enabled = config_opt.Type(bool, default=True)
	"""Whether the plugin is enabled.
    """

	notes_root = config_opt.Dir(exists=False, default="docs")
	"""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.
    """

	recent_notes_config = config_opt.Type(
		dict,
		default={
			"enabled": False,
			"insert_marker": "<!-- recent_notes -->",
			"insert_num": 10,
		},
	)
	"""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
    """

	# Network Graph Configuration
	graph_config = config_opt.Type(
		dict,
		default={
			"enabled": False,
			"name": "title",  # Node naming strategy: "title" or "file_name"
			"debug": False,  # Enable debug logging for graph generation
		},
	)
	"""Configuration for the network graph visualization.

    Available options:
    - name: Node naming strategy ("title" or "file_name")
    - debug: Enable debug logging for graph generation
    """

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.

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