| 1 | >English< [Français](README-fr.md) |
| 2 | |
| 3 | # Fanfix |
| 4 | |
| 5 | Fanfix is a small Java program that can download stories from some supported websites and render them offline. |
| 6 | |
| 7 | (If you are interested in the recent changes, please check the [Changelog](changelog.md) -- note that starting from version 1.4.0, the changelog is checked at startup.) |
| 8 | |
| 9 | (A [TODO list](TODO.md) is also available to know what is expected to come in the future.) |
| 10 | |
| 11 | TODO: new screenshots + TUI screenshots |
| 12 | |
| 13 | ![Main GUI](screenshots/fanfix-1.3.2.png?raw=true "Main GUI") |
| 14 | |
| 15 | It will convert from a (supported) URL to an .epub file for stories or a .cbz file for comics (a few other output types are also available, like Plain Text, LaTeX, HTML...). |
| 16 | |
| 17 | To help organize your stories, it can also work as a local library so you can: |
| 18 | - Import a story from its URL (or just from a file) |
| 19 | - Export a story to a file (in any of the supported output types) |
| 20 | - Display a story from the local library in text format in the console |
| 21 | - Display a story from the local library graphically **by calling a native program to handle it** (though Fanfix can automatically process it into HTML so any browser can open it) |
| 22 | |
| 23 | ## Supported websites |
| 24 | |
| 25 | Currently, the following websites are supported: |
| 26 | - http://FimFiction.net/: fan fictions devoted to the My Little Pony show |
| 27 | - http://Fanfiction.net/: fan fictions of many, many different universes, from TV shows to novels to games |
| 28 | - http://mangafox.me/: a well filled repository of mangas, or, as their website states: most popular manga scanlations read online for free at mangafox, as well as a close-knit community to chat and make friends |
| 29 | - https://e621.net/: a Furry website supporting comics, including MLP |
| 30 | - https://sofurry.com/: same thing, but story-oriented |
| 31 | - https://e-hentai.org/: done upon request (so, feel free to ask for more websites!) |
| 32 | |
| 33 | ## A note about file support |
| 34 | |
| 35 | We support a few file types for local story conversion (both as input and as output): |
| 36 | - epub: .epub files created by this program (we do not support "all" .epub files, at least for now) |
| 37 | - text: local stories encoded in plain text format, with a few specific rules: |
| 38 | - the title must be on the first line |
| 39 | - the author (preceded by nothing, ```by ``` or ```©```) must be on the second line, possibly with the publication date in parenthesis (i.e., ```By Unknown (3rd October 1998)```) |
| 40 | - chapters must be declared with ```Chapter x``` or ```Chapter x: NAME OF THE CHAPTER```, where ```x``` is the chapter number |
| 41 | - a description of the story must be given as chapter number 0 |
| 42 | - a cover image may be present with the same filename as the story, but a .png, .jpeg or .jpg extension |
| 43 | - info_text: contains the same information as the text format, but with a companion .info file to store some metadata (the .info file is supposed to be created by Fanfix or compatible with it) |
| 44 | - cbz: .cbz (collection of images) files, preferably created with Fanfix (but any .cbz file is supported, though without most of Fanfix metadata, obviously) |
| 45 | - html: HTML files that you can open with any browser; note that it will create a directory structure with ```index.html``` as the main file -- we only support importing HTML files created by Fanfix |
| 46 | |
| 47 | ## Supported platforms |
| 48 | |
| 49 | Any platform with at lest Java 1.6 on it should be ok. |
| 50 | |
| 51 | It has been tested on Linux (Debian, Slackware, Ubuntu), MacOS X and Windows for now, but feel free to inform us if you try it on another system. |
| 52 | |
| 53 | If you have any problems to compile it with a supported Java version (1.6+), please contact us. |
| 54 | |
| 55 | ## Usage |
| 56 | |
| 57 | You can start the program in GUI mode (as in the screenshot on top): |
| 58 | - ```java -jar fanfix.jar``` |
| 59 | |
| 60 | The following arguments are also allowed: |
| 61 | - ```--import [URL]```: import the story at URL into the local library |
| 62 | - ```--export [id] [output_type] [target]```: export the story denoted by ID to the target file |
| 63 | - ```--convert [URL] [output_type] [target] (+info)```: convert the story at URL into target, and force-add the .info and cover if +info is passed |
| 64 | - ```--read [id] ([chapter number])```: read the given story denoted by ID from the library |
| 65 | - ```--read-url [URL] ([chapter number])```: convert on the fly and read the story at URL, without saving it |
| 66 | - ```--list```: list the stories present in the library and their associated IDs |
| 67 | - ```--set-reader [reader type]```: set the reader type to CLI, TUI or GUI for this command |
| 68 | - ```--server [key] [port]```: start a story server on this port |
| 69 | - ```--stop-server [key] [port]: stop the remote server running on this port (key must be set to the same value) |
| 70 | - ```--remote [key] [host] [port]```: contact this server instead of the usual library (key must be set to the same value) |
| 71 | - ```--help```: display the available options |
| 72 | - ```--version```: return the version of the program |
| 73 | |
| 74 | ### Environment variables |
| 75 | |
| 76 | Some environment variables are recognized by the program: |
| 77 | - ```LANG=en```: force the language to English |
| 78 | - ```CONFIG_DIR=$HOME/.fanfix```: use the given directory as a config directory (and copy the default configuration if needed) |
| 79 | - ```NOUTF=1```: try to fallback to non-unicode values when possible (can have an impact on the resulting files, not only on user messages) |
| 80 | - ```DEBUG=1```: force the ```DEBUG=true``` option of the configuration file (to show more information on errors) |
| 81 | |
| 82 | ## Compilation |
| 83 | |
| 84 | ```./configure.sh && make``` |
| 85 | |
| 86 | You can also import the java sources into, say, [Eclipse](https://eclipse.org/), and create a runnable JAR file from there. |
| 87 | |
| 88 | There are some unit tests you can run, too: |
| 89 | |
| 90 | ```./configure.sh && make build test run-test``` |
| 91 | |
| 92 | ### Dependant libraries (included) |
| 93 | |
| 94 | - libs/nikiroo-utils-sources.jar: some shared utility functions |
| 95 | - [libs/unbescape-sources.jar](https://github.com/unbescape/unbescape): a nice library to escape/unescape a lot of text formats; used here for HTML |
| 96 | - [libs/jexer-sources.jar](https://github.com/klamonte/jexer): a small library that offers TUI widgets |
| 97 | |
| 98 | Nothing else but Java 1.6+. |
| 99 | |
| 100 | Note that calling ```make libs``` will export the libraries into the src/ directory. |
| 101 | |