#epub #remarkable #mhtml

bin+lib repub-rs

Rust library and binary for converting mhtml webpages into remarkable-style summarized epubs

3 releases

new 0.1.2 Apr 24, 2024
0.1.1 Nov 20, 2023
0.1.0 Sep 5, 2023

#813 in Text processing

MIT license

38KB
792 lines

repub-rs

A rust library for converting mhtml webpages to epub articles.

To Do

  • Handling of byline and title is a bit manual, and it'd be better to expose more of those properties.

lib.rs:

A library for turning mhtml webpages into summarized epub articles

This is primarily intended for use in repub for reMarkable devices, but can be generally used for webpage summarization.

Examples

use repub::Repub;

let mhtml = // ...
# r#"From: <Saved by Blink>
# Snapshot-Content-Location: http://test
# Subject: title
# MIME-Version: 1.0
# Content-Type: multipart/related;
#    type="text/html";
#    boundary="boundary"
#
# --boundary
# Content-Type: text/html
# Content-ID: <frame-0@mhtml.blink>
# Content-Transfer-Encoding: quoted-printable
# Content-Location: http://test
#
# <html></html>
# --boundary--
# "#;
let mut buff = Vec::new();
Repub::default().mhtml_to_epub(mhtml, &mut buff).unwrap();

Dependencies

~12–27MB
~376K SLoC