I needed some functionality that I think would be valuable to the base project if you are interested in any of it. The 3 feature changes are pretty simple.
1) If a developer creates a markdownx field with a new attribute field_image_prefix="somepathstring" that prefix is appended to the path adding the ability for field level image separation.
2) If a content creator renames the image before dropping they can easily control the filename that is stored
This now gives developers and content creators 3 levels of customization without any overloading or extending this projects code.
The existing project level setting prefix MARKDOWNX_MEDIA_PATH + model/field level path prefix + imagename
3) Last, to prevent the number of duplicates and for easy url generation for existing images content creators can drop an existing image from the media folder location into a markdown field to create a link to an image that already exists.
I attempted to add the functionality with the least amount of changes or impact to existing or new installations.
if no attribute is included in the model there is no additional prefix appended and everything works like before
if no setting MARKDOWNX_USE_ORIGINAL_IMAGE_NAME = True in settings file the normal uuid always add functionality applies like before
I did not intend the comments to be kept but I thought it would be valuable during review to see why I think I needed each change.
I needed some functionality that I think would be valuable to the base project if you are interested in any of it. The 3 feature changes are pretty simple. 1) If a developer creates a markdownx field with a new attribute field_image_prefix="somepathstring" that prefix is appended to the path adding the ability for field level image separation. 2) If a content creator renames the image before dropping they can easily control the filename that is stored This now gives developers and content creators 3 levels of customization without any overloading or extending this projects code. The existing project level setting prefix MARKDOWNX_MEDIA_PATH + model/field level path prefix + imagename 3) Last, to prevent the number of duplicates and for easy url generation for existing images content creators can drop an existing image from the media folder location into a markdown field to create a link to an image that already exists.
I attempted to add the functionality with the least amount of changes or impact to existing or new installations.
I did not intend the comments to be kept but I thought it would be valuable during review to see why I think I needed each change.
An example of what a model field might look like:
An example of what a dropped image me.jpg final path might look like with the following settings:
/media/markdownx/2020/markdownpost/content/me.jpg
This is my first attempt at a pull request so if I did something wrong please let me know