Merge commit '77d3a60869e7a780c6ae069e51530e1eacece5e2'
[fanfix.git] / README.md
... / ...
CommitLineData
1English [Français](README-fr.md)
2
3# Fanfix
4Fanfix is a small Java program that can download stories from some supported websites and render them offline.
5
6## Synopsis
7
8- ```fanfix``` --import [*URL*]
9- ```fanfix``` --export [*id*] [*output_type*] [*target*]
10- ```fanfix``` --convert [*URL*] [*output_type*] [*target*] (+info)
11- ```fanfix``` --read [*id*] ([*chapter number*])
12- ```fanfix``` --read-url [*URL*] ([*chapter number*])
13- ```fanfix``` --search
14- ```fanfix``` --search [*where*] [*keywords*] (page [*page*]) (item [*item*])
15- ```fanfix``` --search-tag
16- ```fanfix``` --search-tag [*index 1*]... (page [*page*]) (item [*item*])
17- ```fanfix``` --list
18- ```fanfix``` --set-reader [*GUI* | *TUI* | *CLI*]
19- ```fanfix``` --server [*key*] [*port*]
20- ```fanfix``` --stop-server [*key*] [*port*]
21- ```fanfix``` --remote [*key*] [*host*] [*port*]
22- ```fanfix``` --help
23
24## Description
25
26(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.)
27
28(A [TODO list](TODO.md) is also available to know what is expected to come in the future.)
29
30![Main GUI](screenshots/fanfix-1.3.2.png?raw=true "Main GUI")
31
32A screenshots cgallery an be found [here](screenshots/README.md).
33
34It 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...).
35
36To help organize your stories, it can also work as a local library so you can:
37
38- Import a story from its URL (or just from a file)
39- Export a story to a file (in any of the supported output types)
40- Display a story from the local library in text format in the console
41- Display a story from the local library graphically **natively** or **by calling a native program to handle it** (potentially converted into HTML before hand, so any browser can open it)
42
43### Supported websites
44
45Currently, the following websites are supported:
46
47- http://FimFiction.net/: fan fictions devoted to the My Little Pony show
48- http://Fanfiction.net/: fan fictions of many, many different universes, from TV shows to novels to games
49- 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
50- https://e621.net/: a Furry website supporting comics, including MLP
51- https://sofurry.com/: same thing, but story-oriented
52- https://e-hentai.org/: done upon request (so, feel free to ask for more websites!)
53- http://mangas-lecture-en-ligne.fr/: a website offering a lot of mangas (in French)
54
55### Support file types
56
57We support a few file types for local story conversion (both as input and as output):
58
59- epub: .epub files created by this program (we do not support "all" .epub files, at least for now)
60- text: local stories encoded in plain text format, with a few specific rules:
61 - the title must be on the first line
62 - 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)```)
63 - chapters must be declared with ```Chapter x``` or ```Chapter x: NAME OF THE CHAPTER```, where ```x``` is the chapter number
64 - a description of the story must be given as chapter number 0
65 - a cover image may be present with the same filename as the story, but a .png, .jpeg or .jpg extension
66- 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)
67- cbz: .cbz (collection of images) files, preferably created with Fanfix (but any .cbz file is supported, though without most of Fanfix metadata, obviously)
68- 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
69
70### Supported platforms
71
72Any platform with at lest Java 1.6 on it should be ok.
73
74It 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.
75
76If you have any problems to compile it with a supported Java version (1.6+), please contact us.
77
78## Options
79
80You can start the program in GUI mode (as in the screenshot on top):
81
82- ```java -jar fanfix.jar```
83- ```fanfix``` (if you used *make install*)
84
85The following arguments are also allowed:
86
87- ```--import [URL]```: import the story at URL into the local library
88- ```--export [id] [output_type] [target]```: export the story denoted by ID to the target file
89- ```--convert [URL] [output_type] [target] (+info)```: convert the story at URL into target, and force-add the .info and cover if +info is passed
90- ```--read [id] ([chapter number])```: read the given story denoted by ID from the library
91- ```--read-url [URL] ([chapter number])```: convert on the fly and read the story at URL, without saving it
92- ```--search```: list the supported websites (```where```)
93- ```--search [where] [keywords] (page [page]) (item [item])```: search on the supported website and display the given results page of stories it found, or the story details if asked
94- ```--tag [where]```: list all the tags supported by this website
95- ```--tag [index 1]... (page [page]) (item [item])```: search for the given stories or subtags, tag by tag, and display information about a specific page of results or about a specific item if requested
96- ```--list```: list the stories present in the library and their associated IDs
97- ```--set-reader [reader type]```: set the reader type to CLI, TUI or GUI for this command
98- ```--server [key] [port]```: start a story server on this port
99- ```--stop-server [key] [port]```: stop the remote server running on this port (key must be set to the same value)
100- ```--remote [key] [host] [port]```: contact this server instead of the usual library (key must be set to the same value)
101- ```--help```: display the available options
102- ```--version```: return the version of the program
103
104### Environment
105
106Some environment variables are recognized by the program:
107
108- ```LANG=en```: force the language to English
109- ```CONFIG_DIR=$HOME/.fanfix```: use the given directory as a config directory (and copy the default configuration if needed)
110- ```NOUTF=1```: try to fallback to non-unicode values when possible (can have an impact on the resulting files, not only on user messages)
111- ```DEBUG=1```: force the ```DEBUG=true``` option of the configuration file (to show more information on errors)
112
113## Compilation
114
115```./configure.sh && make```
116
117You can also import the java sources into, say, [Eclipse](https://eclipse.org/), and create a runnable JAR file from there.
118
119There are some unit tests you can run, too:
120
121```./configure.sh && make build test run-test```
122
123If you run the unit tests, note that some flag files can impact them:
124
125- ```test/VERBOSE``` : enable verbose mode
126- ```test/OFFLINE``` : to forbid any downloading
127- ```test/URLS``` : to allow testing URLs
128- ```test/FORCE_REFRESH```: to force a clear of the cache
129
130Note that ```test/CACHE``` can be kept, as it will contain all internet related files you need (if you allow URLs, run the test once which will populate the CACHE then go OFFLINE, it will still work).
131
132The test files will be:
133
134- ```test/*.url``` : URL to download in text format, content = URL
135- ```test/*.story```: text mode story, content = story
136
137
138### Dependant libraries (included)
139
140Required:
141
142- ```libs/nikiroo-utils-sources.jar```: some shared utility functions
143- [```libs/unbescape-sources.jar```](https://github.com/unbescape/unbescape): a nice library to escape/unescape a lot of text formats; used here for HTML
144- [```libs/jsoup-sources.jar```](https://jsoup.org/): a library to parse HTML
145
146Optional:
147
148- [```libs/jexer-sources.jar```](https://github.com/klamonte/jexer): a small library that offers TUI widgets
149- [```pandoc```](http://pandoc.org/): to generate the man pages from the README files
150
151Nothing else but Java 1.6+.
152
153Note that calling ```make libs``` will export the libraries into the src/ directory.
154
155## Author
156
157Fanfix was written by Niki Roo <niki@nikiroo.be>
158