Skip to content

examples: add {axum,poem,rocket,warp} by translating the actix-web example; book: add frameworks section #308

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

Merged
merged 6 commits into from
Jan 13, 2025

Conversation

Kijewski
Copy link
Member

@Kijewski Kijewski commented Jan 7, 2025

No description provided.

@Kijewski Kijewski changed the title Add axum example Add axum example by translating the actix-web example Jan 12, 2025
@Kijewski Kijewski marked this pull request as ready for review January 12, 2025 18:21
@Kijewski
Copy link
Member Author

I replaced the previous htmx example with the "greet-me" example. I think my htmx example may have been a good show case how to use htmx with axum, but a bad rinja example.

@Kijewski Kijewski changed the title Add axum example by translating the actix-web example Add axum and warp examples by translating the actix-web example Jan 12, 2025
@Kijewski Kijewski force-pushed the pr-axum-example branch 2 times, most recently from 0c039bb to ce61077 Compare January 12, 2025 21:54
@Kijewski Kijewski changed the title Add axum and warp examples by translating the actix-web example examples: add {axum,warp} by translating the actix-web example; book: add frameworks section Jan 12, 2025
@Kijewski Kijewski force-pushed the pr-axum-example branch 3 times, most recently from 0537c88 to 2316dae Compare January 12, 2025 22:03
@@ -0,0 +1,56 @@
{#-
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a valid css comment. ;)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, now I got it. You normally never inline CSS into HTML, very bad idea.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's mentioned in _layout.html, that normally you should not do that. :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put it in cap. :3


{#-
In a real application you most likely would want to link style sheets,
any JavaScripts etc. using e.g. `actix-files`, instead of embedding the content
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: find what to use in warp instead of actix-files.


{#-
In a real application you most likely would want to link style sheets,
any JavaScripts etc. using e.g. `actix-files`, instead of embedding the content
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: find what to use in axum instead of actix-files.

@Kijewski Kijewski changed the title examples: add {axum,warp} by translating the actix-web example; book: add frameworks section examples: add {axum,warp,rocket} by translating the actix-web example; book: add frameworks section Jan 13, 2025

## Actix-Web

To convert the `String` to an HTML response, you can use
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For each framework, we should link to their example in the repository.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Added.

@Kijewski Kijewski changed the title examples: add {axum,warp,rocket} by translating the actix-web example; book: add frameworks section examples: add {axum,poem,rocket,warp} by translating the actix-web example; book: add frameworks section Jan 13, 2025
@Kijewski
Copy link
Member Author

AFAICS, the only remaining big+active web-framework that is missing is salvo. But I guess this PR is more than big enough. And I don't want to read any more framework docs for a while. :)

@GuillaumeGomez
Copy link
Collaborator

Looks good to me, thanks a lot!

@GuillaumeGomez GuillaumeGomez merged commit f6cf374 into askama-rs:master Jan 13, 2025
35 checks passed
@Kijewski Kijewski deleted the pr-axum-example branch January 13, 2025 13:43
@Kijewski
Copy link
Member Author

There's a bug in readthedocs right now that prevents the build process: readthedocs/readthedocs.org#11912

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

Successfully merging this pull request may close these issues.

3 participants