note_splitter.split_tab module
- class note_splitter.split_tab.SplitTab(main_window: PySide6.QtWidgets.QMainWindow)
Bases:
PySide6.QtWidgets.QWidget
- reload_tab_inputs() None
Reloads the inputs on the tab from the settings.
Uses the default settings as a fallback for any settings that are not found.
- save_new_notes(split_contents: list[str], new_file_names: list[str]) list[note_splitter.note.Note]
Creates new files and saves strings into them.
The lists for the contents and names of the new files are parallel.
- split_contents
A list of strings to each be saved into a new file.
- Type
list[str]
- new_file_names
A list of names of files to be created.
- Type
list[str]
- Returns
new_notes – The newly created notes.
- Return type
list[Note]
- staticMetaObject = PySide6.QtCore.QMetaObject("SplitTab" inherits "QWidget": )
- note_splitter.split_tab.append_backlinks(root_note: note_splitter.note.Note, notes: list[note_splitter.note.Note]) None
Appends backlinks to the root note in each of the given notes.
- Parameters
root_note (str) – The note that the backlinks will link to.
notes (list[Note]) – The notes to append backlinks to.
- note_splitter.split_tab.create_index_file_(source_note: note_splitter.note.Note, new_notes: list[note_splitter.note.Note], split_type: type[note_splitter.tokens.Token]) note_splitter.note.Note
Creates an index file for the new notes in the same folder.
- Parameters
source_note (Note) – The note that the new notes were created from.
new_notes (list[Note]) – The newly created notes.
split_type (type[tokens.Token]) – The type of token that was split by.
- Returns
The newly created index note.
- Return type
- note_splitter.split_tab.split_text(content: str, tokenize: Callable, split: Callable, format_: Callable, split_type: type[note_splitter.tokens.Token], split_attrs: dict, using_split_keyword: bool, remove_split_keyword: bool, split_keyword: str, parse_blocks: bool, copy_global_tags: bool, copy_frontmatter: bool, move_footnotes: bool) list[str]
Splits a string into multiple strings based on several factors.
- note_splitter.split_tab.content
The string to be split.
- Type
str
- note_splitter.split_tab.tokenize
A function created from the Lexer class that converts a string into a list of tokens.
- Type
Callable
- note_splitter.split_tab.split
A function created from the Splitter class that groups the tokens into sections.
- Type
Callable
- note_splitter.split_tab.format_
A function created from the Formatter class that adjusts the formatting of each section and converts them to strings.
- Type
Callable
- note_splitter.split_tab.split_type
The type of token to split by.
- Type
type[tokens.Token]
- note_splitter.split_tab.split_attrs
The attributes of the token to split by.
- Type
dict
- note_splitter.split_tab.using_split_keyword
Whether to use a keyword to decide which files to split.
- Type
bool
- note_splitter.split_tab.remove_split_keyword
Whether to remove the keyword from the content of the token.
- Type
bool
- note_splitter.split_tab.split_keyword
The keyword for deciding which files to split.
- Type
str
- note_splitter.split_tab.parse_blocks
Whether to parse blocks.
- Type
bool
- note_splitter.split_tab.copy_global_tags
Whether to copy global tags to each new file.
- Type
bool
- note_splitter.split_tab.copy_frontmatter
Whether to copy frontmatter to each new file.
- Type
bool
- note_splitter.split_tab.move_footnotes
Whether to move footnotes into the new files.
- Type
bool
- Returns
split_contents – A list of strings that are the sections of the original string.
- Return type
list[str]