moved images/graphics resources to subfolder of markdown files location
This commit is contained in:
parent
9ffccfbeb7
commit
b5224937d2
BIN
ce1808db00914c9f9d60b0b18b9906da.png
Normal file
BIN
ce1808db00914c9f9d60b0b18b9906da.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
@ -136,7 +136,7 @@ class JoplinExporter:
|
|||||||
"""The main exporter class."""
|
"""The main exporter class."""
|
||||||
|
|
||||||
content_dir = Path("content")
|
content_dir = Path("content")
|
||||||
static_dir = Path("static/resources")
|
static_dir = Path("content/resources")
|
||||||
joplin_dir = Path.home() / ".config/joplin-desktop"
|
joplin_dir = Path.home() / ".config/joplin-desktop"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -192,13 +192,13 @@ class JoplinExporter:
|
|||||||
# Add the resource to the set of used resources, so we can only copy
|
# Add the resource to the set of used resources, so we can only copy
|
||||||
# the resources that are used.
|
# the resources that are used.
|
||||||
self.used_resources.add(resource_id)
|
self.used_resources.add(resource_id)
|
||||||
return "resources/" + resource_id + resource.derived_ext
|
return "content/resources/" + resource_id + resource.derived_ext
|
||||||
|
|
||||||
def copy_resources(self):
|
def copy_resources(self):
|
||||||
"""Copy all the used resources to the output directory."""
|
"""Copy all the used resources to the output directory."""
|
||||||
for resource_id in self.used_resources:
|
for resource_id in self.used_resources:
|
||||||
resource = self.resources[resource_id]
|
resource = self.resources[resource_id]
|
||||||
print(f"{resource_id}.{resource.extension}")
|
print(f"Exporting Resource: {resource_id}.{resource.extension}")
|
||||||
copy(
|
copy(
|
||||||
self.joplin_dir / "resources" / (f"{resource_id}.{resource.extension}"),
|
self.joplin_dir / "resources" / (f"{resource_id}.{resource.extension}"),
|
||||||
self.static_dir / f"{resource_id}{resource.derived_ext}",
|
self.static_dir / f"{resource_id}{resource.derived_ext}",
|
||||||
@ -358,7 +358,7 @@ class JoplinExporter:
|
|||||||
|
|
||||||
<p style="font-size:80%; font-style: italic">
|
<p style="font-size:80%; font-style: italic">
|
||||||
Last updated on {note.updated_time:%B %d, %Y}. For any questions/feedback,
|
Last updated on {note.updated_time:%B %d, %Y}. For any questions/feedback,
|
||||||
email me at <a href="mailto:hi@stavros.io">hi@stavros.io</a>.
|
email me at <a href="mailto:blog@zinchuk.xyz">blog@zinchuk.xyz</a>.
|
||||||
</p>
|
</p>
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user