Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97c5f12b86 | ||
|
|
a56792ae0d | ||
|
|
14cd8beadc | ||
|
|
48e339c119 | ||
|
|
9b3c63c2c4 |
No files matched your search
@@ -7,7 +7,7 @@
|
|||||||
**Convert GEDCOM genealogy files to Obsidian-compatible markdown notes with WikiLinks**
|
**Convert GEDCOM genealogy files to Obsidian-compatible markdown notes with WikiLinks**
|
||||||
|
|
||||||
[](https://www.python.org/downloads/)
|
[](https://www.python.org/downloads/)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
[](https://github.com/AlexKucera/gedcom-to-markdown/actions/workflows/tests.yml)
|
[](https://github.com/AlexKucera/gedcom-to-markdown/actions/workflows/tests.yml)
|
||||||
[](https://codecov.io/gh/AlexKucera/gedcom-to-markdown)
|
[](https://codecov.io/gh/AlexKucera/gedcom-to-markdown)
|
||||||
[](https://coderabbit.ai)
|
[](https://coderabbit.ai)
|
||||||
@@ -183,6 +183,65 @@ Stories are linked from person notes using WikiLinks, making it easy to navigate
|
|||||||
|
|
||||||
The `Index.md` file at the root contains an alphabetical listing of all individuals with WikiLinks to their person notes.
|
The `Index.md` file at the root contains an alphabetical listing of all individuals with WikiLinks to their person notes.
|
||||||
|
|
||||||
|
## Canvas Visualization
|
||||||
|
|
||||||
|
The `--canvas` option generates an **Obsidian Canvas file** that provides an interactive, visual representation of your family tree. This creates a `.canvas` file in your output directory that can be opened in Obsidian for a graphical view of family relationships.
|
||||||
|
|
||||||
|
### How It Works
|
||||||
|
|
||||||
|
The canvas generator uses a **generational layout algorithm** that arranges family members spatially:
|
||||||
|
|
||||||
|
- **Timeline Layout**: Ancestors appear to the right, descendants to the left, creating a left-to-right timeline
|
||||||
|
- **Vertical Positioning**: Family members are arranged vertically with gender-aware positioning to minimize relationship line crossings
|
||||||
|
- **Automatic Tree Building**: Uses breadth-first search from the selected root person to build the family tree
|
||||||
|
- **Disconnected Families**: Automatically detects and includes unconnected family groups as separate sections
|
||||||
|
- **Visual Elements**:
|
||||||
|
- Each person appears as a card/node with their name and basic information
|
||||||
|
- Person images are embedded in the canvas nodes when available
|
||||||
|
- Parent-child relationships shown as lines connecting left to right
|
||||||
|
- Spouse relationships shown as bidirectional vertical connections
|
||||||
|
|
||||||
|
### Root Person Selection
|
||||||
|
|
||||||
|
When using the `--canvas` flag, you can specify the root person in several ways:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Interactive selection (displays numbered list)
|
||||||
|
python src/main.py -i family.ged -o output --canvas
|
||||||
|
|
||||||
|
# By selection number
|
||||||
|
python src/main.py -i family.ged -o output --canvas --root 85
|
||||||
|
|
||||||
|
# By GEDCOM ID
|
||||||
|
python src/main.py -i family.ged -o output --canvas --root @I253884714@
|
||||||
|
```
|
||||||
|
|
||||||
|
The root person serves as the starting point for building the family tree visualization.
|
||||||
|
|
||||||
|
### Limitations and Known Issues
|
||||||
|
|
||||||
|
While the canvas generator creates a useful visualization, it has some limitations:
|
||||||
|
|
||||||
|
1. **Spacing Approximations**: The algorithm calculates node positions using heuristics for spacing. Complex family structures (many siblings, multiple marriages) can sometimes result in:
|
||||||
|
- Nodes positioned slightly too close together
|
||||||
|
- Occasional minor overlaps between adjacent cards
|
||||||
|
|
||||||
|
2. **Manual Adjustments Expected**: In most cases, **a few nodes may overlap slightly**, but these overlaps are typically minimal and **can easily be fixed by hand** in Obsidian by dragging the nodes to better positions.
|
||||||
|
|
||||||
|
3. **Complex Marriages**: Individuals with multiple marriages may have relationship lines that cross in non-optimal ways.
|
||||||
|
|
||||||
|
4. **Large Trees**: Very large family trees (100+ individuals) may require manual adjustment for optimal viewing.
|
||||||
|
|
||||||
|
5. **Edge Routing**: Connection lines between nodes use straight lines, which can sometimes cross through other nodes in complex family structures.
|
||||||
|
|
||||||
|
### Tips for Best Results
|
||||||
|
|
||||||
|
- Start with a central family member (grandparent or parent) as the root person
|
||||||
|
- For large families, consider creating multiple canvas files focused on different branches
|
||||||
|
- Use Obsidian's zoom and pan features to navigate large canvases
|
||||||
|
- After initial generation, spend a few minutes adjusting any overlapping nodes for a cleaner layout
|
||||||
|
- The canvas is fully interactive - you can reorganize it to suit your preferences while maintaining all the relationship connections
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
```text
|
```text
|
||||||
@@ -267,7 +326,7 @@ pytest -v
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
|
||||||
|
|
||||||
## Acknowledgments
|
## Acknowledgments
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,18 @@ class Individual:
|
|||||||
"""
|
"""
|
||||||
return self.element.get_pointer()
|
return self.element.get_pointer()
|
||||||
|
|
||||||
|
def get_fs_id(self) -> str:
|
||||||
|
"""
|
||||||
|
Return the FamilySearch Tree ID (`_FSFTID`) if present.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
str: FamilySearch Tree ID value, or an empty string when not available.
|
||||||
|
"""
|
||||||
|
for child in self.element.get_child_elements():
|
||||||
|
if child.get_tag() == "_FSFTID":
|
||||||
|
return child.get_value() or ""
|
||||||
|
return ""
|
||||||
|
|
||||||
def get_names(self) -> Tuple[str, str]:
|
def get_names(self) -> Tuple[str, str]:
|
||||||
"""
|
"""
|
||||||
Return the individual's first and last name with surrounding whitespace removed.
|
Return the individual's first and last name with surrounding whitespace removed.
|
||||||
|
|||||||
@@ -123,8 +123,11 @@ class MarkdownGenerator:
|
|||||||
|
|
||||||
birth = individual.get_birth_info()
|
birth = individual.get_birth_info()
|
||||||
death = individual.get_death_info()
|
death = individual.get_death_info()
|
||||||
|
fs_id = individual.get_fs_id()
|
||||||
|
|
||||||
f.write(f"ID: {individual.get_id()}\n")
|
f.write(f"ID: {individual.get_id()}\n")
|
||||||
|
if fs_id:
|
||||||
|
f.write(f"FamilySearch ID: {fs_id}\n")
|
||||||
f.write(f"Name: {individual.get_full_name()}\n")
|
f.write(f"Name: {individual.get_full_name()}\n")
|
||||||
|
|
||||||
# Lived years
|
# Lived years
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ def sample_gedcom_content():
|
|||||||
1 NAME John /Doe/
|
1 NAME John /Doe/
|
||||||
2 GIVN John
|
2 GIVN John
|
||||||
2 SURN Doe
|
2 SURN Doe
|
||||||
|
1 _FSFTID G123-ABC
|
||||||
1 SEX M
|
1 SEX M
|
||||||
1 BIRT
|
1 BIRT
|
||||||
2 DATE 1 JAN 1950
|
2 DATE 1 JAN 1950
|
||||||
|
|||||||
@@ -80,6 +80,16 @@ class TestIndividualBasicInfo:
|
|||||||
"""Test gender extraction."""
|
"""Test gender extraction."""
|
||||||
assert john_doe.get_gender() == 'M'
|
assert john_doe.get_gender() == 'M'
|
||||||
|
|
||||||
|
def test_get_fs_id(self, john_doe, sample_gedcom_file):
|
||||||
|
"""Test FamilySearch Tree ID extraction from _FSFTID tag."""
|
||||||
|
assert john_doe.get_fs_id() == 'G123-ABC'
|
||||||
|
|
||||||
|
parser = GedcomParser(sample_gedcom_file)
|
||||||
|
individuals = parser.get_individuals()
|
||||||
|
jane = [ind for ind in individuals if 'Jane' in str(ind.get_name())]
|
||||||
|
jane_doe = Individual(jane[0], parser.parser)
|
||||||
|
assert jane_doe.get_fs_id() == ''
|
||||||
|
|
||||||
def test_get_gender_default_unknown(self, sample_gedcom_file):
|
def test_get_gender_default_unknown(self, sample_gedcom_file):
|
||||||
"""Test that missing gender defaults to 'U'."""
|
"""Test that missing gender defaults to 'U'."""
|
||||||
gedcom_content = """0 HEAD
|
gedcom_content = """0 HEAD
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ class TestMetadataFormatting:
|
|||||||
|
|
||||||
# Check for YAML frontmatter metadata
|
# Check for YAML frontmatter metadata
|
||||||
assert 'ID: I1' in content
|
assert 'ID: I1' in content
|
||||||
|
assert 'FamilySearch ID: G123-ABC' in content
|
||||||
assert 'Name: John Doe' in content
|
assert 'Name: John Doe' in content
|
||||||
assert 'Sex: M' in content
|
assert 'Sex: M' in content
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user