note_splitter.settings module

The user’s application settings and related functions.

QtCore.QSettings cannot correctly save booleans, so booleans are saved as integers.

create_backlinksbool

Whether or not to append a backlink to the source file in each new file.

blockquote_patternstr

The uncompiled regex pattern for blockquotes.

code_fence_patternstr

The uncompiled regex pattern for code fences.

copy_frontmatterbool

Whether or not to copy frontmatter from the source file to each new file.

copy_global_tagsbool

Whether or not to copy global tags from the source file to each new file.

create_index_filebool

Whether or not to create an index file.

destination_folder_pathstr

The absolute path to the user’s folder where new files will be saved.

empty_line_patternstr

The uncompiled regex pattern for empty lines.

file_id_formatstr

The format of the file IDs.

file_id_regexstr

The uncompiled regular expression to use to extract file IDs from the files.

file_name_formatstr

The format of the new file names. Does not include the file extension.

file_path_in_link_patternstr

The uncompiled regex pattern for file paths in links.

finished_task_patternstr

The uncompiled regex pattern for finished tasks.

footnote_patternstr

The uncompiled regex pattern for footnotes.

frontmatter_fence_patternstr

The uncompiled regex pattern for frontmatter fences.

header_patternstr

The uncompiled regex pattern for headers.

horizontal_rule_patternstr

The uncompiled regex pattern for horizontal rules.

math_fence_patternstr

The uncompiled regex pattern for math fences.

move_footnotesbool

Whether or not to copy footnotes into each new file that has the relevant footnote references, and remove them from the ones that don’t have the relevant references.

note_typeslist[str]

The file extensions of the files that may be chosen to be split. Each must start with a period.

ordered_list_item_patternstr

The uncompiled regex pattern for ordered list items.

parse_blocksbool

Whether or not to create Block tokens while parsing.

remove_split_keywordbool

Whether or not to remove the split keyword from the source file and new file(s).

replace_split_contentsbool

Whether or not to replace the parts of the source file that was split out with links to the new files.

source_folder_pathstr

The absolute path to the user’s folder containing the files to be split.

split_attrsdict

The attributes to split by. If the chosen split type has an attribute, it can be used to narrow down what to split by.

split_keywordstr

The tag/keyword the program searches for to know which file(s) to split.

split_typestr

The output-formatted name of the type to split by. This can be any token type, even an abstract one.

table_divider_patternstr

The uncompiled regex pattern for table dividers.

table_row_patternstr

The uncompiled regex pattern for table rows.

tag_patternstr

The uncompiled regex pattern for tags.

task_patternstr

The uncompiled regex pattern for tasks.

unordered_list_item_patternstr

The uncompiled regex pattern for unordered list items.

using_split_keywordbool

Whether or not the split keyword was used to find file(s) to split.

The settings for the formats of file names and IDs can use the following variables:

  • %uuid4 - A universally unique identifier.

  • %title - The title of the file (the body of its first header, or the first line

    of the file if there is no header).

  • %Y - The current year.

  • %M - The current month.

  • %D - The current day.

  • %h - The current hour.

  • %m - The current minute.

  • %s - The current second.

Additionally, the file name format setting can use the %id variable which gets replaced with the ID of the file as described by the file ID format setting.

Every time file_id_format is changed, file_id_regex must be updated.

note_splitter.settings.add_new_settings(settings: PySide6.QtCore.QSettings) None

Add any new settings to the registry without overwriting existing ones.

note_splitter.settings.export_settings() None

Exports the settings from the registry to a JSON file.

note_splitter.settings.get_token_type(type_name: str) type

Get a token type by name.

Parameters

type_name (str) – The output-formatted name of the token type to get.

note_splitter.settings.get_token_type_name(token_type: type) str

Get the token type’s output-formatted name.

Parameters

token_type (type) – The token type to get the name of.

note_splitter.settings.get_token_type_names(filter_predicate: Optional[Callable[[type], bool]] = None, all_token_types: Optional[list[type]] = None) list[str]

Get all token types’ output-formatted names.

Parameters
  • predicate (Callable, optional) – A function that filters the token types.

  • all_token_types (list, optional) – A list of all token types. If not provided, the list of all token types will be fetched.

note_splitter.settings.import_settings() None

Attempts to import settings from a JSON file to the registry.

Overwrites any existing conflicting settings. Ignores any settings with keys that are not in the default settings.

note_splitter.settings.reset_settings() None

Clears all settings and saves the default settings to the registry.

Does not clear settings from the user interface.

note_splitter.settings.show_message(text: str) None
note_splitter.settings.update_from_checkbox(setting_name: str, check_box: PySide6.QtWidgets.QCheckBox) None

Updates a setting in the registry with a check box’s state.

note_splitter.settings.update_from_combo_box(setting_name: str, combo_box: PySide6.QtWidgets.QComboBox) None

Updates a setting in the registry with a combo box’s value.

note_splitter.settings.update_from_line_edit(setting_name: str, line_edit: PySide6.QtWidgets.QLineEdit) None

Updates a setting in the registry with a line edit’s text.

note_splitter.settings.update_setting(setting_name: str, value: Any) None

Updates a setting in the registry.