im_reader 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +14 -3
- data/app/controllers/im_reader/epub_reader_controller.rb +1 -11
- data/config/locales/de.yml +1 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/config/locales/fr.yml +1 -0
- data/config/locales/pt.yml +1 -0
- data/lib/im_reader/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f693637efa72f8b0c59dce1206e1e9716b3f5cac3335b2dac02bc1d6cc025548
|
|
4
|
+
data.tar.gz: feac962d03b51b08322c7beb9258be0f39b6811f2e1f0f848f3e1ab996797fd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '038aacfbf6507b20e57ce5cf156d0ceb4a666b1eb0e555595d2d719744e64ad3ddb88ec83ca5b62bfbb19e56ba35af5be9f394fa8da102f794c06a39fc434a65'
|
|
7
|
+
data.tar.gz: 746605c1a88fecbc0402082d58f5b54fcf93fced074182c20146da00d9d7aee7b8d756780b482c08592878e8350eece1566b2345fc02ddaf0f2c5871736e56b1
|
data/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# im_reader
|
|
2
2
|
|
|
3
|
-
**im_reader** is a mountable Ruby on Rails engine that
|
|
4
|
-
It
|
|
3
|
+
**im_reader** is a mountable Ruby on Rails engine that encapsulates the [`epub.js`](https://github.com/intity/epub-js) JavaScript library to provide an elegant in-browser EPUB reader.
|
|
4
|
+
It integrates [`Semantic UI`](https://github.com/Semantic-Org/Semantic-UI) for the user interface styling, offering a modern and responsive reading experience.
|
|
5
|
+
Designed to fit seamlessly into any Rails application, it allows users to read `.epub` files hosted remotely, with a built-in table of contents, cover display, and customizable UI labels.
|
|
5
6
|
|
|
6
7
|
---
|
|
7
8
|
|
|
@@ -48,7 +49,7 @@ This will expose the following route inside your application:
|
|
|
48
49
|
### Example usage
|
|
49
50
|
|
|
50
51
|
```
|
|
51
|
-
/reader/
|
|
52
|
+
/reader/epub?url=https://your-server.com/path/to/book.epub
|
|
52
53
|
```
|
|
53
54
|
|
|
54
55
|
This endpoint will download the EPUB file from the given URL, stream it securely to the client, and display it in the embedded reader.
|
|
@@ -76,6 +77,7 @@ fr:
|
|
|
76
77
|
start: "Commencer la lecture"
|
|
77
78
|
messages:
|
|
78
79
|
loading: "Chargement du livre ..."
|
|
80
|
+
reading_error: "Impossible de récupérer l’EPUB"
|
|
79
81
|
```
|
|
80
82
|
|
|
81
83
|
---
|
|
@@ -108,3 +110,12 @@ http://localhost:3000/reader/epub?url=https://your-server.com/path/to/book.epub
|
|
|
108
110
|
|
|
109
111
|
This project is distributed under the MIT License.
|
|
110
112
|
See the `LICENSE` file for more details.
|
|
113
|
+
|
|
114
|
+
## Credits
|
|
115
|
+
|
|
116
|
+
- **EPUB rendering:** [epub.js (Intity fork)](https://github.com/intity/epub-js)
|
|
117
|
+
Licensed under the BSD 2-Clause License.
|
|
118
|
+
- **UI framework:** [Semantic UI](https://github.com/Semantic-Org/Semantic-UI)
|
|
119
|
+
Licensed under the MIT License.
|
|
120
|
+
|
|
121
|
+
**im_reader** integrates and extends these open-source projects to provide a smooth EPUB reading experience inside Ruby on Rails.
|
|
@@ -4,32 +4,22 @@ module ImReader
|
|
|
4
4
|
|
|
5
5
|
def show
|
|
6
6
|
@remote_url = params[:url]
|
|
7
|
-
puts "#### PLOP ####"
|
|
8
7
|
@url = im_reader.remote_epub_reader_url(url: @remote_url)
|
|
9
|
-
puts "***** OK *****"
|
|
10
8
|
end
|
|
11
9
|
|
|
12
10
|
def remote
|
|
13
|
-
# Envoyer cette url depuis le BO immateriel
|
|
14
|
-
# @book.book_previews&.last&.download_url
|
|
15
|
-
puts "***** REMOTE 1 *****"
|
|
16
11
|
url = params[:url]
|
|
17
12
|
uri = URI.parse(url)
|
|
18
13
|
response = fetch_with_redirect(uri)
|
|
19
14
|
|
|
20
|
-
# on télécharge directement en mémoire
|
|
21
|
-
puts "***** REMOTE 2 *****"
|
|
22
|
-
|
|
23
15
|
if response.is_a?(Net::HTTPSuccess)
|
|
24
16
|
|
|
25
|
-
puts "***** REMOTE 3.1 *****"
|
|
26
17
|
send_data response.body,
|
|
27
18
|
filename: File.basename(uri.path.presence || "remote.epub"),
|
|
28
19
|
type: "application/epub+zip",
|
|
29
20
|
disposition: "inline"
|
|
30
21
|
else
|
|
31
|
-
|
|
32
|
-
render plain: "Impossible de récupérer l’EPUB", status: 404
|
|
22
|
+
render plain: I18n.t('im_reader.messages.reading_error'), status: 404
|
|
33
23
|
end
|
|
34
24
|
end
|
|
35
25
|
|
data/config/locales/de.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/locales/pt.yml
CHANGED
data/lib/im_reader/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: im_reader
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Elodie Ailleaume
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-10-
|
|
11
|
+
date: 2025-10-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sass
|