Commit graph

62 commits

Author SHA1 Message Date
Jeremy Benoist 6aca334d53
Move to controller as a service
Mostly using autowiring to inject deps.
The only tricky part was for import because all producer use the same class and have a different alias. So we must write them down in the service definition, autowiring doesn't work in that case.

Usually:
- if a controller has a constructor, it means injected services are at least re-used once in actions
- otherwise, service are injected per action
2022-12-19 10:38:08 +01:00
Jeremy Benoist b7dba18cb2
Cleanup 2022-11-23 15:51:33 +01:00
JT Smith 6da76ffaae Typofixes 2022-10-03 18:31:43 -06:00
Jérémy Benoist 974062f749
Merge pull request #5647 from wallabag/fix/epub-language 2022-03-21 22:40:01 +01:00
Kevin Decherf 1608bf5a4e Replace iconv() calls with Transliterator
See https://stackoverflow.com/a/35178027/954513

Closes #5377

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2022-03-21 22:12:11 +01:00
Jeremy Benoist 2c870423c4
Fix epub language
Ensure language has `_` instead of `-`
And update wallabag/phpepub
2022-03-21 20:56:29 +01:00
Nicolas Lœuillet ff1c4f6090 Fixed reading time in epub/pdf exports 2021-10-23 13:29:27 +02:00
Nicolas Lœuillet 0bddd34847
Added publication date on epub export 2020-04-06 16:14:36 +02:00
Kevin Decherf 41d476d7e7 epub: fix exception when articles have the same title
This commit fixes an exception occuring when exporting as epub several
articles with the same title. The chapter filename is now derived from
title and url.

Fixes #3642

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-03-17 23:36:10 +01:00
Kevin Decherf 9a7a0e1e6b epub export: fix missing cover image, only for exports of one article
Fixes #3602

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-02-18 00:16:05 +01:00
Kevin Decherf 5e1f27767b EntriesExport: avoid else on $authors
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-09 16:26:19 +01:00
Kevin Decherf dac93644e8 EntriesExport: sanitize filename and fix tests
Filename will now only use a-zA-Z0-9-' and space.

Fixes remaining filename issue on #3811

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-08 15:13:35 +01:00
Kevin Decherf ad5ef8bca0 EntriesExport/pdf: move notice to the end, add metadata cover
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 23:36:41 +01:00
Kevin Decherf 4944703edc EntriesExport/epub: add metadata to each entry's cover
Add metadata to the cover of each entry:

- Publishers
- Estimated reading time
- Date of creation ("Added on")
- Address (URL)

Related to #2821

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 21:44:14 +01:00
Kevin Decherf f810834623 EntriesExport: change authors and title when not single entry export
Change '{method} authors' (which gives 'Tag_entries authors' when
exporting a tag) to 'Various authors'.

When exporting a tag (tag_entries), change the title from 'Tag_entries
articles' to 'Tag {tag} articles'.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 21:44:14 +01:00
Kevin Decherf 30cf72bf55 EntriesExport/epub: revert c779373f, move exportinfo to the end of the book
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 21:43:16 +01:00
Kevin Decherf edd1825b58 EntriesExport/epub: use sha1 sums for filenames, fix and rename title chapters
This commit renames entry chapters file using a sha1 sum of their title
for simplicity. Also we fix the 'Title' chapter duplicate issue by using
the hash of the related entry and the suffix '_title'.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 21:41:12 +01:00
Kevin Decherf 063d5e7bda EntriesExport/epub: remove TOC page
This change only remove the rendered page of the TOC at the end of the
book, the TOC remains available to readers.

Fixes #3603

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 21:11:05 +01:00
Kevin Decherf bf22266a62 EntriesExport/epub: replace epub identifier with unique urn
We replace the title used as the unique identifier of the epub file with
a urn following the format:

  urn:wallabag:{sha1("wallabagUrl:listOfEntryIdsSeparatedByComma")}

This format is repeatable: it always gives the same uid for the same
list of entries.

Fixes #3811

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-06 23:29:32 +01:00
Kevin Decherf 2a1ceb67b4 php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 14:25:32 +02:00
Jeremy Benoist 15a6402f75
Properly run php-cs-fixer 2017-10-28 20:16:43 +02:00
Martin Trigaux 385e651684 php-cs-fixer
php bin/php-cs-fixer fix src/Wallabag/CoreBundle/Helper/EntriesExport.php
2017-10-28 17:17:22 +02:00
Martin Trigaux c779373f2c Set the title in a separated chapter
Set the export option on the same page, same as done in producePdf
Move the ToC at the end of the book so the title page is the first one
2017-10-28 14:49:14 +02:00
Martin Trigaux a6e9ad0b7d add a title page
The first page of the book is the title
2017-10-28 10:45:37 +02:00
Jeremy Benoist 9dd67fa342
CS 2017-10-11 10:43:36 +02:00
Nicolas Lœuillet 8f187e280f
Fixed @j0k3r's review 2017-10-11 10:43:19 +02:00
Nicolas Lœuillet dc7fa8dfc6
Fixed @tcitworld's review 2017-10-11 10:43:19 +02:00
Nicolas Lœuillet b1428a1cf8
Translated first page of exported article 2017-10-11 10:43:19 +02:00
Nicolas Hart c660878388 better entry txt export using html2text 2017-08-27 00:04:21 +02:00
Nicolas Hart 52b84c11a5 Fix some namespaces and phpdoc 2017-07-29 22:51:50 +02:00
Étienne Gilli eeabca8090 Make updateAuthor code simpler to read 2017-07-10 10:08:20 +02:00
Étienne Gilli c57f69d967 Use the article publisher as author for export
When exporting an entry, use the publishedBy field as author name for
epub, mobi and pdf formats. Fallback to domain name if empty.
2017-07-09 18:33:14 +02:00
Étienne Gilli 07320a2bd2 Use the article domain as author for export files
When exporting an entry, use the domain name as author name for epub,
mobi and pdf formats, instead of 'wallabag'.
Change the author from array to string, because for now, there is always
only one author.
2017-07-08 19:53:43 +02:00
Jeremy Benoist f808b01692
Add a real configuration for CS-Fixer 2017-07-01 09:52:38 +02:00
Martin Trigaux 1b70990b01 Add export notice at the end of the epub
The text "Produced by wallabag with PHPePub" is the first page of any epub.

On ebooks reader, it is common (e.g. kobo) to use the first page as the cover of
unread books, which makes it more difficult to differentiate the books.

Move the Notices chapter at the end of the book.
2017-04-05 09:24:48 +02:00
Thomas Citharel 8303b037fb add cli export
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2017-01-22 12:51:14 +01:00
Jeremy Benoist 4b3c983ab8
Inject parameter instead of service
We are injecting CraueConfig service when we only need to retrieve one or two values from it.
Instead I discovered we can directly inject a value from a service in the service definition!
2016-10-30 20:27:41 +01:00
Jeremy Benoist 74e1f7433a
Fix tag test 2016-10-07 07:43:48 +02:00
Jeremy Benoist b0458874c8
Fix relations export for Entry
Tags & Annotations weren’t really well exported.
This is now fixed (+ tests)
2016-10-07 07:43:19 +02:00
Jeremy Benoist 77557d289b
Merge remote-tracking branch 'origin/master' into 2.1 2016-10-02 17:37:41 +02:00
Paulino Michelazzo ffcd91ec6c Remove error message when creating ePub versions
Trying to create a ePub version, the first page shows a message of a
“missing >”. This change solve this problem (and, for sure, in any
download version that’s use HTML).
2016-10-02 13:16:12 +02:00
Jeremy Benoist d7b4b2c72c
Merge remote-tracking branch 'origin/master' into 2.1 2016-09-19 11:23:07 +02:00
Étienne Gilli 45d94a98f7 Fix issue #2296: epub export with + in the title. 2016-09-18 14:43:54 +02:00
Jeremy Benoist 9401696fe4
Export dates from entries 2016-09-08 16:49:21 +02:00
Jeremy Benoist 4094ea4771 Convert array + phpDoc
Thanks for https://github.com/thomasbachem/php-short-array-syntax-converter
2016-04-12 12:25:29 +02:00
Jeremy Benoist 0e49487bb0 Remove some complexicity in InstallCommand 2016-03-28 14:18:50 +02:00
Jeremy Benoist 8f336fda64 Tags were not imported in wallabag v2 import
Also, simplify exportAs matching format
2016-03-27 23:58:37 +02:00
Nicolas Lœuillet f898102c85 Exported entries were added twice in export file 2016-02-05 13:35:59 +01:00
Jeremy Benoist d3f31ec485 CS 2016-02-04 20:31:26 +01:00
Thomas Citharel f161122412 put the equals bar outside the loop 2016-02-04 20:31:26 +01:00