Feat/17 refine the medium to obsidian flow#21
Open
edgarbc wants to merge 6 commits into
Open
Conversation
…-flow Add Obsidian output format with `--format` flag and tests
There was a problem hiding this comment.
Pull request overview
Adds an explicit Obsidian output mode to medium2md so Medium export conversions can produce either Hugo page bundles (existing default) or flat Obsidian vault notes, controlled via a new --format/-f CLI option.
Changes:
- Introduces
OutputFormatand extends the pipeline to support Obsidian note writing (write_note) and configurable image localization (images_dir,src_prefix). - Updates the CLI to route conversion to Hugo vs Obsidian layouts and to print the selected format.
- Adds a new pytest suite covering slugging, writers, conversion, discovery, and CLI end-to-end behavior; updates docs and dev dependencies accordingly.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
medium2md/pipeline.py |
Adds output-format enum, parameterizes image localization, and implements Obsidian note writer. |
medium2md/cli.py |
Adds --format option and branches conversion/writing for Hugo vs Obsidian output. |
tests/test_pipeline.py |
New pytest coverage for pipeline helpers and CLI end-to-end Hugo/Obsidian flows. |
tests/__init__.py |
Ensures tests are treated as a package (enables imports in some environments). |
pyproject.toml |
Adds pytest to dev optional dependencies. |
README.md |
Documents --format usage and describes Hugo vs Obsidian output structures/front matter. |
uv.lock |
Locks new dev dependency (pytest) and its transitive requirements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+225
to
+230
| def test_find_post_html_files_excludes_non_post_dirs(tmp_path): | ||
| for d in ("blocks", "bookmarks", "claps"): | ||
| (tmp_path / d).mkdir() | ||
| (tmp_path / d / "x.html").write_text("<html/>") | ||
| (tmp_path / "README.html").write_text("<html/>") | ||
| (tmp_path / "my-post.html").write_text("<html/>") |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.