~aw/mygit#39: 
simplify dependency tree

the biggest dependency is tide, followed by syntect and askama

I'm not really happy with any of these dependencies, but I don't think many good alternatives exist in the rust ecosystem.

https://github.com/tiny-http/tiny-http may be worth looking into

html templating can be done by hand with fmt strings, but that's far from ideal

Status
REPORTED
Submitter
~aw
Assigned to
No-one
Submitted
2 months ago
Updated
2 months ago
Labels
No labels applied.

Johann Galle 2 months ago · edit

On 2021-07-20, ~aw wrote:

the biggest dependency is tide, followed by syntect and askama

I'm not really happy with any of these dependencies, but I don't think many good alternatives exist in the rust ecosystem.

They are "good", but their focus is not on fast build times. Nevertheless replacing them should be considered.

https://github.com/tiny-http/tiny-http may be worth looking into

At first glance this does not seem like an adequate replacement, especially because the README contains this: "If you want to create a website in Rust, I strongly recommend using a framework instead of this library."

We would need to implement many parts of an http server ourselves, and I think many mistakes could be made there.

html templating can be done by hand with fmt strings, but that's far from ideal

I actually think that in some cases the templates can be more or less easily be implemented using the format! macro. In some cases it might even be nicer because askama sometimes does not recognize Rust syntax with bad error messages.

Also on syntect and going back to #28, replacing it with an external program would be desirable, thus also reducing dependencies.

Johann Galle 2 months ago · edit

also related/duplicate of #30

Johann Galle 2 months ago · edit

I managed to remove the askama dependency, and as suggested previously I do not think it is that bad.

The following changes since commit f9d2521512c06410ba68c8855747c9549a37f3e3:

Remove umused mail module (2021-07-20 20:48:11 -0700)

are available in the Git repository at:

git://qwertqwefsday.eu/mygit.git (branch no-askama)

for you to fetch changes up to 0c086f3da3ce0beb45b9f2a078c4452d5225ba21:

remove last askama holdouts (2021-07-25 23:17:13 +0200)

Please do not hesitate to contact me if you encounter any issues with this.


Johann150 (25): align numbers of last updated column format sourcecode convert index page from askama clean up index page convert repo page convert log page use same names for all pages convert refs page convert tree page make link more descriptive remove old code fix title for tree and file page reimplement checks and gitweb compatibility show author instead of committer convert tag page calculate timezone offset correctly remove leftover mailing list template convert commit page add trailing slashes in templates convert error page convert commits feed convert refs feed formatting, fix date format clean up filters, indentation remove last askama holdouts

Cargo.lock | 130 +---- Cargo.toml | 4 +- src/errorpage.rs | 35 +- src/filters.rs | 85 --- src/main.rs | 845 ++++----------------------- templates/base.html => src/pages/base_1.html | 15 +- src/pages/base_2.html | 7 + src/pages/commit.rs | 166 ++++++ src/pages/index.rs | 100 ++++ src/pages/log.rs | 112 ++++ src/pages/log_rss.rs | 93 +++ src/pages/mod.rs | 196 +++++++ src/pages/refs.rs | 131 +++++ src/pages/refs_rss.rs | 108 ++++ src/pages/repo.rs | 103 ++++ src/pages/tag.rs | 53 ++ src/pages/tree.rs | 215 +++++++ templates/commit-tr.html | 7 - templates/commit.html | 28 - templates/error.html | 9 - templates/file.html | 11 - templates/index.html | 16 - templates/last-commit.html | 9 - templates/list-threads.html | 8 - templates/log.html | 23 - templates/log.xml | 26 - templates/refs.html | 36 -- templates/refs.xml | 26 - templates/repo-navbar.html | 5 - templates/repo.html | 23 - templates/static/style.css | 4 +- templates/tag.html | 17 - templates/tree.html | 42 -- 33 files changed, 1429 insertions(+), 1259 deletions(-) delete mode 100644 src/filters.rs rename templates/base.html => src/pages/base_1.html (54%) create mode 100644 src/pages/base_2.html create mode 100644 src/pages/commit.rs create mode 100644 src/pages/index.rs create mode 100644 src/pages/log.rs create mode 100644 src/pages/log_rss.rs create mode 100644 src/pages/mod.rs create mode 100644 src/pages/refs.rs create mode 100644 src/pages/refs_rss.rs create mode 100644 src/pages/repo.rs create mode 100644 src/pages/tag.rs create mode 100644 src/pages/tree.rs delete mode 100644 templates/commit-tr.html delete mode 100644 templates/commit.html delete mode 100644 templates/error.html delete mode 100644 templates/file.html delete mode 100644 templates/index.html delete mode 100644 templates/last-commit.html delete mode 100644 templates/list-threads.html delete mode 100644 templates/log.html delete mode 100644 templates/log.xml delete mode 100644 templates/refs.html delete mode 100644 templates/refs.xml delete mode 100644 templates/repo-navbar.html delete mode 100644 templates/repo.html delete mode 100644 templates/tag.html delete mode 100644 templates/tree.html

~aw 2 months ago

Oh wow, ambitious! I’ll take a look when I have a chance. Thanks!

Register here or Log in to comment, or comment via email.