Skip to content

Commit acb143a

Browse files
committed
Add professional repository structure and documentation
- Add comprehensive .gitignore for Python projects - Create CONTRIBUTING.md with detailed contribution guidelines - Add example files and sample Logseq graph for testing - Create CHANGELOG.md for version tracking - Add GitHub issue templates for bug reports and feature requests - Create GitHub Actions workflow for automated testing - Include sample pages and journal entries - Add example usage documentation This makes the repository more professional and contributor-friendly.
1 parent a86b8d6 commit acb143a

File tree

9 files changed

+653
-0
lines changed

9 files changed

+653
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve the migration tool
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## 🐛 Bug Description
11+
A clear and concise description of what the bug is.
12+
13+
## 🔄 Steps to Reproduce
14+
1. Go to '...'
15+
2. Run command '...'
16+
3. See error
17+
18+
## 🎯 Expected Behavior
19+
A clear and concise description of what you expected to happen.
20+
21+
## 📱 Actual Behavior
22+
A clear and concise description of what actually happened.
23+
24+
## 📋 Environment Information
25+
- **OS**: [e.g. macOS 14.0, Windows 11, Ubuntu 22.04]
26+
- **Python Version**: [e.g. 3.9.7]
27+
- **Script Version**: [e.g. 1.0.0]
28+
- **Logseq Graph Size**: [e.g. ~1000 files]
29+
30+
## 📁 Sample Files
31+
If applicable, please provide:
32+
- Sample Logseq files that cause the issue
33+
- Error messages or logs
34+
- Screenshots if relevant
35+
36+
## 🔍 Additional Context
37+
Add any other context about the problem here.
38+
39+
## ✅ Checklist
40+
- [ ] I have searched existing issues to avoid duplicates
41+
- [ ] I have tested with the latest version of the script
42+
- [ ] I have provided detailed steps to reproduce
43+
- [ ] I have included environment information
44+
- [ ] I have provided sample files (if applicable)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
## 🚀 Feature Description
11+
A clear and concise description of the feature you'd like to see implemented.
12+
13+
## 💡 Motivation
14+
Why is this feature needed? What problem does it solve?
15+
16+
## 📝 Detailed Description
17+
Provide a detailed description of how you envision this feature working.
18+
19+
## 🎯 Use Case
20+
Describe a specific scenario where this feature would be useful.
21+
22+
## 🔧 Implementation Ideas
23+
If you have ideas about how this could be implemented, please share them.
24+
25+
## 📋 Additional Context
26+
Add any other context, mockups, or examples about the feature request here.
27+
28+
## ✅ Checklist
29+
- [ ] I have searched existing issues to avoid duplicates
30+
- [ ] I have provided a clear description of the feature
31+
- [ ] I have explained the motivation and use case
32+
- [ ] I have considered the impact on existing functionality

.github/workflows/test.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Test Migration Tool
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
29+
- name: Test script help
30+
run: |
31+
python logseq_to_obsidian.py --help
32+
33+
- name: Test dry-run with sample data
34+
run: |
35+
python logseq_to_obsidian.py --src examples/sample_logseq --out test_output --frontmatter --status-tags --strip-properties --rename-journals --dry-run
36+
37+
- name: Test actual migration
38+
run: |
39+
python logseq_to_obsidian.py --src examples/sample_logseq --out test_output --frontmatter --status-tags --strip-properties --rename-journals
40+
41+
- name: Verify output files
42+
run: |
43+
ls -la test_output/
44+
ls -la test_output/pages/
45+
ls -la test_output/journals/
46+
47+
- name: Check converted content
48+
run: |
49+
echo "=== Sample Page ==="
50+
cat "test_output/pages/Sample Page.md"
51+
echo -e "\n=== Journal Entry ==="
52+
cat test_output/journals/2023-09-04.md
53+
54+
- name: Test error handling
55+
run: |
56+
# Test with non-existent directory
57+
python logseq_to_obsidian.py --src nonexistent --out test_output2 --dry-run || true
58+
59+
# Test with invalid options
60+
python logseq_to_obsidian.py --src examples/sample_logseq --dry-run || true

.gitignore

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
logseq_env/
113+
114+
# Spyder project settings
115+
.spyderproject
116+
.spyproject
117+
118+
# Rope project settings
119+
.ropeproject
120+
121+
# mkdocs documentation
122+
/site
123+
124+
# mypy
125+
.mypy_cache/
126+
.dmypy.json
127+
dmypy.json
128+
129+
# Pyre type checker
130+
.pyre/
131+
132+
# macOS
133+
.DS_Store
134+
.AppleDouble
135+
.LSOverride
136+
137+
# Windows
138+
Thumbs.db
139+
ehthumbs.db
140+
Desktop.ini
141+
142+
# Linux
143+
*~
144+
145+
# IDE
146+
.vscode/
147+
.idea/
148+
*.swp
149+
*.swo
150+
151+
# Logseq specific
152+
logseq/
153+
logseq copy/
154+
155+
# Test output directories
156+
/tmp/
157+
test_output/
158+
obsidian-migration/

CHANGELOG.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Changelog
2+
3+
All notable changes to the Logseq to Obsidian Migration Tool will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2024-09-04
9+
10+
### Added
11+
- Initial release of Logseq to Obsidian migration tool
12+
- Support for converting Logseq graphs to Obsidian format
13+
- Frontmatter conversion with YAML metadata
14+
- Journal file renaming from `YYYY_MM_DD.md` to `YYYY-MM-DD.md` format
15+
- Task status conversion to Obsidian checkboxes with status tags
16+
- Property stripping to remove Logseq-specific properties
17+
- Block reference conversion from `((uuid))` to `[[page#^uuid]]`
18+
- Tag conversion from `#[[Tag With Spaces]]` to `#tag-with-spaces`
19+
- Date link conversion from `[[YYYY_MM_DD]]` to `[[YYYY-MM-DD]]`
20+
- Dry-run mode for testing migrations
21+
- Comprehensive error handling for YAML parsing
22+
- Robust file copying with proper directory handling
23+
- Command-line interface with multiple options
24+
- MIT License
25+
- Comprehensive README with usage examples
26+
- Contributing guidelines
27+
- Example files for testing
28+
- Python requirements file
29+
30+
### Features
31+
- **Frontmatter**: Adds YAML frontmatter with dates and titles
32+
- **Status Tags**: Converts task status to Obsidian-compatible format
33+
- **Journal Renaming**: Converts journal files to hyphen format
34+
- **Property Stripping**: Removes Logseq-specific properties
35+
- **Block References**: Converts Logseq block references to Obsidian format
36+
- **Error Handling**: Robust YAML parsing with graceful error handling
37+
- **Dry Run**: Test migrations before applying changes
38+
39+
### Technical Details
40+
- Python 3.6+ compatibility
41+
- PyYAML dependency for frontmatter processing
42+
- Cross-platform file handling
43+
- Unicode normalization for slug generation
44+
- Comprehensive regex patterns for various conversions
45+
46+
## [Unreleased]
47+
48+
### Planned
49+
- Automated testing with GitHub Actions
50+
- Issue templates for bug reports and feature requests
51+
- Performance optimizations for large graphs
52+
- Additional date format support
53+
- Verbose logging options
54+
- Batch processing for multiple graphs
55+
- GUI interface (optional)
56+
- Obsidian plugin integration
57+
58+
### Known Issues
59+
- None currently documented
60+
61+
---
62+
63+
## Version History
64+
65+
- **1.0.0** (2024-09-04): Initial release with core migration functionality

0 commit comments

Comments
 (0)