Feature request: customizable post template #5
Labels
No labels
bug
contribution welcome
duplicate
enhancement
good first issue
help wanted
invalid
question
upstream
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
marvin8/feed2fedi#5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Would be cool to let user change status template. For example something like
instead of
In
publish.pyline 54Good idea... I'll have a think about how to best to this. If you have any more thoughts on templating, I'd be very happy to hear them.
Here my (shitty) implementation https://codeberg.org/MrClon/feed2fedi/commits/branch/status_template_in_config.
Bad news:
item.contentislistofdict, and notstr(at least for Atom feeds), so it can't be directly used by such "template engine". My plan is add toitemcontent in html, plaintext and markdown formats, so user can choose what use in posts. Now code work for Atom feeds, not perfectly, but work.Problem is
items structure different for Atom and RSS feeds, so i need convert all relevant data from RSS and Atom to some format that can be used by template.Also client should somehow signal to server what format (markdown/plaintext/html) used in post. I have no idea how to do it. Now i just set default input type for profile
Did md/plaintext content for template, work for Atom and RSS, available in my repo. Code in
collect.pyis a mess, sorry. Also it add one dependence,markdownify, but i believe it worth itCurrent "template engine" (
str.format) is very basic. I see two way to make templates more powerful:eval(f"f'{template}'"). Looks like bad ideajinja2Personally i ok with
str.formatfor now, i can get all flexibility i need by patching code, but users may want good templates. For example to cut to long content, or format datetime valuesWow... looks like you are making great progress already. Unfortunately it will be a little while before I am able to implement this.
If you feel like it, I'd be happy with a PR to the
wipbranch.Thanks for the PR it will be included in the next release.
Still need to updated documentation before I release this and I'd like to address your other issue as well. For that I'm making a change to
minimal_activitypubfirst.Implemented in release 1.0.0