Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: New Field Recommendation: Jodit Editor #439

Closed
hasansezertasan opened this issue Dec 23, 2023 · 5 comments
Closed

Enhancement: New Field Recommendation: Jodit Editor #439

hasansezertasan opened this issue Dec 23, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@hasansezertasan
Copy link
Contributor

hasansezertasan commented Dec 23, 2023

Jodit Editor: Open Source WYSIWYG editor written in pure TypeScript

It has CDN support and is initialized by a single line of JavaScript.

I'm planning to implement a field that uses Jodit Editor. I have a lot more fields in mind.

Should I implement it and open a PR?

@hasansezertasan hasansezertasan added the enhancement New feature or request label Dec 23, 2023
@hasansezertasan
Copy link
Contributor Author

hasansezertasan commented Dec 23, 2023

@jowilf As I said, I have a lot more fields in mind, so you might think that creating a third-party package (something called 'starlette-admin-fields') is a better idea. If that is the case would you mention and reference this hypothetical package in the documentation and readme?

Also, help me a bit to build (I'm not sure how a third-party package would integrate with starlette-admin) it, the integration aspect is my blind spot.

Edit: Here is the list of the fields that I kept in mind...

Edit: #381, #380 and #379 are the fields that I wrote and pull requested.

@jowilf
Copy link
Owner

jowilf commented Dec 27, 2023

@jowilf As I said, I have a lot more fields in mind, so you might think that creating a third-party package (something called 'starlette-admin-fields') is a better idea.

I agree. I also think that it's a better idea.

If that is the case would you mention and reference this hypothetical package in the documentation and readme?

we can add a third-party packages section similar to https://www.starlette.io/third-party-packages/

@hasansezertasan
Copy link
Contributor Author

hasansezertasan commented Dec 27, 2023

I agree. I also think that it's a better idea.

Great, how do we proceed from here? What should we do next?

we can add a third-party packages section similar to https://www.starlette.io/third-party-packages/

Fantastic!

I believe we can add a parameter to the BaseAdmin class, something like extra_template_loaders, and users can extend the templates folder with third-party packages.

templates.env.loader = ChoiceLoader(
[
FileSystemLoader(self.templates_dir),
PackageLoader("starlette_admin", "templates"),
]
)

Example in mind:

    def _setup_templates(self) -> None:
        templates = Jinja2Templates(self.templates_dir, extensions=["jinja2.ext.i18n"])
        templates.env.loader = ChoiceLoader(
            [
                FileSystemLoader(self.templates_dir),
                *self.extra_template_loaders,
                PackageLoader("starlette_admin", "templates"),
            ]
        )
        ...

And I think we can follow the same pattern with the statics folder. I'm open to suggestions but this is the first way of doing this that popped into my mind.

WDYT of this design @jowilf?

@hasansezertasan
Copy link
Contributor Author

hasansezertasan commented Jan 15, 2024

Field Proposals: this is not exactly a proposal but these projects are inspirational...

@hasansezertasan
Copy link
Contributor Author

I started to build a third-party package to cover these fields: hasansezertasan/starlette-admin-fields: Extra fields to use with Starlette Admin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants