mirror of
https://github.com/natelandau/obsidian-metadata.git
synced 2025-11-17 17:33:40 -05:00
feat: add new inline metadata (#15)
* feat: add new inline metadata to notes * fix: prepend note content after frontmatter * refactor: cleanup search patterns * feat(regex): find top of note * test: add headers * fix: insert to specified location * test: improve test coverage * docs: add inline metadata
This commit is contained in:
committed by
Nathaniel Landau
parent
13513b2a14
commit
17985615b3
@@ -37,6 +37,27 @@ def sample_note(tmp_path) -> Path:
|
||||
dest_file.unlink()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def short_note(tmp_path) -> Path:
|
||||
"""Fixture which creates a temporary short note file."""
|
||||
source_file1: Path = Path("tests/fixtures/short_textfile.md")
|
||||
source_file2: Path = Path("tests/fixtures/no_metadata.md")
|
||||
if not source_file1.exists():
|
||||
raise FileNotFoundError(f"Original file not found: {source_file1}")
|
||||
if not source_file2.exists():
|
||||
raise FileNotFoundError(f"Original file not found: {source_file2}")
|
||||
|
||||
dest_file1: Path = Path(tmp_path / source_file1.name)
|
||||
dest_file2: Path = Path(tmp_path / source_file2.name)
|
||||
shutil.copy(source_file1, dest_file1)
|
||||
shutil.copy(source_file2, dest_file2)
|
||||
yield dest_file1, dest_file2
|
||||
|
||||
# after test - remove fixtures
|
||||
dest_file1.unlink()
|
||||
dest_file2.unlink()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def sample_vault(tmp_path) -> Path:
|
||||
"""Fixture which creates a sample vault."""
|
||||
|
||||
Reference in New Issue
Block a user