#epub #remarkable #mhtml

bin+lib repub-rs

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

4 releases

new 0.2.1 Dec 12, 2024
0.2.0 May 2, 2024
0.1.2 Apr 24, 2024
0.1.1 Nov 20, 2023
0.1.0 Sep 5, 2023

#598 in Text processing

Download history 5/week @ 2024-09-23 2/week @ 2024-09-30 167/week @ 2024-12-09

167 downloads per month

MIT license

38KB
788 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–24MB
~345K SLoC