From: Niki Roo Date: Tue, 5 May 2020 20:40:52 +0000 (+0200) Subject: Merge branch 'subtree' X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=commitdiff_plain;h=509c7ce173c9d2f607cca22799d66ddb24a9aa29;hp=98b95fb81566ca8b04c8d891a02c8019d8bed63d Merge branch 'subtree' --- diff --git a/Makefile.base b/Makefile.base new file mode 100644 index 0000000..0d365b8 --- /dev/null +++ b/Makefile.base @@ -0,0 +1,243 @@ +# Makefile base template +# +# Version: +# - 1.0.0: add a version comment +# - 1.1.0: add 'help', 'sjar' +# - 1.2.0: add 'apk' +# - 1.2.1: improve 'apk' and add 'android' +# - 1.3.0: add 'man' for man(ual) pages +# - 1.4.0: remove android stuff (not working anyway) +# - 1.5.0: include sources and readme/changelog in jar +# - 1.5.1: include binaries from libs/bin/ into the jar + +# Required parameters (the commented out ones are supposed to be per project): + +#MAIN = path to main java source to compile +#MORE = path to supplementary needed resources not linked from MAIN +#NAME = name of project (used for jar output file) +#PREFIX = usually /usr/local (where to install the program) +#TEST = path to main test source to compile +#JAR_FLAGS += a list of things to pack, each usually prefixed with "-C bin/" +#SJAR_FLAGS += a list of things to pack, each usually prefixed with "-C src/", +# for *-sources.jar files +#TEST_PARAMS = any parameter to pass to the test runnable when "test-run" + +JAVAC = javac +JAVAC_FLAGS += -encoding UTF-8 -d ./bin/ -cp ./src/ +JAVA = java +JAVA_FLAGS += -cp ./bin/ +JAR = jar +RJAR = java +RJAR_FLAGS += -jar + +all: build jar man + +help: + @echo "Usual options:" + @echo "==============" + @echo " make : to build the jar file and man pages IF possible" + @echo " make help : to get this help screen" + @echo " make libs : to update the libraries into src/" + @echo " make build : to update the binaries (not the jar)" + @echo " make test : to update the test binaries" + @echo " make build jar : to update the binaries and jar file" + @echo " make sjar : to create the sources jar file" + @echo " make clean : to clean the directory of intermediate files" + @echo " make mrpropre : to clean the directory of all outputs" + @echo " make run : to run the program from the binaries" + @echo " make run-test : to run the test program from the binaries" + @echo " make jrun : to run the program from the jar file" + @echo " make install : to install the application into $$PREFIX" + @echo " make ifman : to make the manual pages (if pandoc is found)" + @echo " make man : to make the manual pages (requires pandoc)" + +.PHONY: all clean mrproper mrpropre build run jrun jar sjar resources test-resources install libs ifman man love + +bin: + @mkdir -p bin + +jar: $(NAME).jar + +sjar: $(NAME)-sources.jar + +build: resources + @echo Compiling program... + @echo " src/$(MAIN)" + @$(JAVAC) $(JAVAC_FLAGS) "src/$(MAIN).java" + @[ "$(MORE)" = "" ] || for sup in $(MORE); do \ + echo " src/$$sup" ;\ + $(JAVAC) $(JAVAC_FLAGS) "src/$$sup.java" ; \ + done + +test: test-resources + @[ -e bin/$(MAIN).class ] || echo You need to build the sources + @[ -e bin/$(MAIN).class ] + @echo Compiling test program... + @[ "$(TEST)" != "" ] || echo No test sources defined. + @[ "$(TEST)" = "" ] || for sup in $(TEST); do \ + echo " src/$$sup" ;\ + $(JAVAC) $(JAVAC_FLAGS) "src/$$sup.java" ; \ + done + +clean: + rm -rf bin/ + @echo Removing sources taken from libs... + @for lib in libs/*-sources.jar libs/*-sources.patch.jar; do \ + if [ "$$lib" != 'libs/*-sources.jar' -a "$$lib" != 'libs/*-sources.patch.jar' ]; then \ + basename "$$lib"; \ + jar tf "$$lib" | while read -r ln; do \ + [ -f "src/$$ln" ] && rm "src/$$ln"; \ + done; \ + jar tf "$$lib" | tac | while read -r ln; do \ + [ -d "src/$$ln" ] && rmdir "src/$$ln" 2>/dev/null || true; \ + done; \ + fi \ + done + +mrproper: mrpropre + +mrpropre: clean + rm -f $(NAME).jar + rm -f $(NAME)-sources.jar + rm -f $(NAME).apk + rm -f $(NAME)-debug.apk + [ ! -e VERSION ] || rm -f "$(NAME)-`cat VERSION`.jar" + [ ! -e VERSION ] || rm -f "$(NAME)-`cat VERSION`-sources.jar" + +love: + @echo " ...not war." + +resources: libs + @echo Copying resources into bin/... + @cd src && find . | grep -v '\.java$$' | grep -v '/test/' | while read -r ln; do \ + if [ -f "$$ln" ]; then \ + dir="`dirname "$$ln"`"; \ + mkdir -p "../bin/$$dir" ; \ + cp "$$ln" "../bin/$$ln" ; \ + fi ; \ + done + @cp VERSION bin/ + +test-resources: resources + @echo Copying test resources into bin/... + @cd src && find . | grep -v '\.java$$' | grep '/test/' | while read -r ln; do \ + if [ -f "$$ln" ]; then \ + dir="`dirname "$$ln"`"; \ + mkdir -p "../bin/$$dir" ; \ + cp "$$ln" "../bin/$$ln" ; \ + fi ; \ + done + +libs: bin + @[ -e bin/libs -o ! -d libs ] || echo Extracting sources from libs... + @[ -e bin/libs -o ! -d libs ] || (cd src && for lib in ../libs/*-sources.jar ../libs/*-sources.patch.jar; do \ + if [ "$$lib" != '../libs/*-sources.jar' -a "$$lib" != '../libs/*-sources.patch.jar' ]; then \ + basename "$$lib"; \ + jar xf "$$lib"; \ + fi \ + done ) + @[ ! -d libs ] || touch bin/libs + +$(NAME)-sources.jar: libs + @ls *.md >/dev/null || cp VERSION README.md + @echo Making sources JAR file... + @echo > bin/manifest + @[ "$(SJAR_FLAGS)" != "" ] || echo No sources JAR file defined, skipping + @[ "$(SJAR_FLAGS)" = "" ] || echo Creating $(NAME)-sources.jar... + @[ "$(SJAR_FLAGS)" = "" ] || $(JAR) cfm $(NAME)-sources.jar bin/manifest -C ./ *.md $(SJAR_FLAGS) + @[ "$(SJAR_FLAGS)" = "" ] || [ ! -e VERSION ] || echo Copying to "$(NAME)-`cat VERSION`-sources.jar"... + @[ "$(SJAR_FLAGS)" = "" ] || [ ! -e VERSION ] || cp $(NAME)-sources.jar "$(NAME)-`cat VERSION`-sources.jar" + +$(NAME).jar: resources + @[ -e bin/$(MAIN).class ] || echo You need to build the sources + @[ -e bin/$(MAIN).class ] + @ls *.md >/dev/null || cp VERSION README.md + @echo "Copying documentation into bin/..." + @cp -r *.md bin/ || cp VERSION bin/no-documentation.md + @[ ! -d libs/bin/ ] || echo "Copying additional binaries from libs/bin/ into bin/..." + @[ ! -d libs/bin/ ] || cp -r libs/bin/* bin/ + @echo "Copying sources into bin/..." + @cp -r src/* bin/ + @echo "Making jar..." + @echo "Main-Class: `echo "$(MAIN)" | sed 's:/:.:g'`" > bin/manifest + @echo >> bin/manifest + $(JAR) cfm $(NAME).jar bin/manifest -C ./ *.md $(JAR_FLAGS) + @[ ! -e VERSION ] || echo Copying to "$(NAME)-`cat VERSION`.jar"... + @[ ! -e VERSION ] || cp $(NAME).jar "$(NAME)-`cat VERSION`.jar" + +run: + @[ -e bin/$(MAIN).class ] || echo You need to build the sources + @[ -e bin/$(MAIN).class ] + @echo Running "$(NAME)"... + $(JAVA) $(JAVA_FLAGS) $(MAIN) + +jrun: + @[ -e $(NAME).jar ] || echo You need to build the jar + @[ -e $(NAME).jar ] + @echo Running "$(NAME).jar"... + $(RJAR) $(RJAR_FLAGS) $(NAME).jar + +run-test: + @[ "$(TEST)" = "" -o -e "bin/$(TEST).class" ] || echo You need to build the test sources + @[ "$(TEST)" = "" -o -e "bin/$(TEST).class" ] + @echo Running tests for "$(NAME)"... + @[ "$(TEST)" != "" ] || echo No test sources defined. + [ "$(TEST)" = "" ] || ( clear ; $(JAVA) $(JAVA_FLAGS) $(TEST) $(TEST_PARAMS) ) + +install: + @[ -e $(NAME).jar ] || echo You need to build the jar + @[ -e $(NAME).jar ] + mkdir -p "$(PREFIX)/lib" "$(PREFIX)/bin" + cp $(NAME).jar "$(PREFIX)/lib/" + echo "#!/bin/sh" > "$(PREFIX)/bin/$(NAME)" + echo "$(RJAR) $(RJAR_FLAGS) \"$(PREFIX)/lib/$(NAME).jar\" \"\$$@\"" >> "$(PREFIX)/bin/$(NAME)" + chmod a+rx "$(PREFIX)/bin/$(NAME)" + if [ -e "man/man1/$(NAME).1" ]; then \ + cp -r man/ "$(PREFIX)"/share/; \ + fi + +ifman: + @if pandoc -v >/dev/null 2>&1; then \ + make man; \ + else \ + echo "man pages not generated: "'`'"pandoc' required"; \ + fi + +man: + @echo Checking for possible manual pages... + @if [ -e README.md ]; then \ + echo Sources found for man pages; \ + if pandoc -v >/dev/null 2>&1; then \ + ls README*.md 2>/dev/null \ + | grep 'README\(-..\|\)\.md' \ + | while read man; do \ + echo " Processing page $$lang..."; \ + lang="`echo "$$man" \ + | sed 's:README\.md:en:' \ + | sed 's:README-\(.*\)\.md:\1:'`"; \ + mkdir -p man/"$$lang"/man1; \ + ( \ + echo ".TH \"${NAME}\" 1 `\ + date +%Y-%m-%d\ + ` \"version `cat VERSION`\""; \ + echo; \ + UNAME="`echo "${NAME}" \ + | sed 's:\(.*\):\U\1:g'`"; \ + ( \ + cat "$$man" | head -n1 \ + | sed 's:.*(README\(-fr\|\)\.md).*::g'; \ + cat "$$man" | tail -n+2; \ + ) | sed 's:^#\(#.*\):\1:g' \ + | sed 's:^\(#.*\):\U\1:g;s:# *'"$$UNAME"':# NAME\n'"${NAME}"' \\- :g' \ + | sed 's:--:——:g' \ + | pandoc -f markdown -t man | sed 's:——:--:g' ; \ + ) > man/"$$lang"/man1/"${NAME}.1"; \ + done; \ + mkdir -p "man/man1"; \ + cp man/en/man1/"${NAME}".1 man/man1/; \ + else \ + echo "man pages generation: pandoc required" >&2; \ + false; \ + fi; \ + fi; + diff --git a/README-fr.md b/README-fr.md new file mode 100644 index 0000000..d6dbd8e --- /dev/null +++ b/README-fr.md @@ -0,0 +1,157 @@ +[English](README.md) Français + +# Fanfix + +Fanfix est un petit programme Java qui peut télécharger des histoires sur internet et les afficher hors ligne. + +## 🔴 Ceci est le programme serveur et command-line + +Vous pouvez aussi utiliser : +- le client graphique [Fanfix-swing](https://github.com/nikiroo/fanfix-swing/) +- le client en mode TUI [Fanfix-jexer](https://github.com/nikiroo/fanfix-jexer/) + +## Synopsis + +- ```fanfix``` --import [*URL*] +- ```fanfix``` --export [*id*] [*output_type*] [*target*] +- ```fanfix``` --convert [*URL*] [*output_type*] [*target*] (+info) +- ```fanfix``` --read [*id*] ([*chapter number*]) +- ```fanfix``` --read-url [*URL*] ([*chapter number*]) +- ```fanfix``` --search +- ```fanfix``` --search [*where*] [*keywords*] (page [*page*]) (item [*item*]) +- ```fanfix``` --search-tag +- ```fanfix``` --search-tag [*index 1*]... (page [*page*]) (item [*item*]) +- ```fanfix``` --list +- ```fanfix``` --server [*key*] [*port*] +- ```fanfix``` --stop-server [*key*] [*port*] +- ```fanfix``` --remote [*key*] [*host*] [*port*] +- ```fanfix``` --help + +## Description + +(Si vous voulez juste voir les derniers changements, vous pouvez regarder le [Changelog](changelog-fr.md) -- remarquez que le programme affiche le changelog si une version plus récente est détectée depuis la version 1.4.0.) + +Le fonctionnement du programme est assez simple : il converti une URL venant d'un site supporté en un fichier .epub pour les histoires ou .cbz pour les comics (d'autres options d'enregistrement sont disponibles, comme du texte simple, du HTML...) + +Pour vous aider à organiser vos histoires, il peut aussi servir de bibliothèque locale vous permettant : + +- d'importer une histoire depuis son URL (ou depuis un fichier) +- d'exporter une histoire dans un des formats supportés vers un fichier +- d'afficher une histoire en mode texte +- via [fanfix-swing](https://github.com/nikiroo/fanfix-swing/): d'afficher une histoire en mode GUI **lui-même** ([fanfix-swing](https://github.com/nikiroo/fanfix-swing/)) ou **en appelant un programme natif pour lire le fichier** (potentiellement converti en HTML avant, pour que n'importe quel navigateur web puisse l'afficher) + +### Sites supportés + +Pour le moment, les sites suivants sont supportés : + +- http://FimFiction.net/ : fanfictions dévouées à la série My Little Pony +- http://Fanfiction.net/ : fanfictions venant d'une multitude d'univers différents, depuis les shows télévisés aux livres en passant par les jeux-vidéos +- http://mangahub.io/ : un site répertoriant une quantité non négligeable de mangas (English) +- https://e621.net/ : un site Furry proposant des comics, y compris de MLP +- https://sofurry.com/ : même chose, mais orienté sur les histoires plutôt que les images +- https://e-hentai.org/ : support ajouté sur demande : n'hésitez pas à demander un site ! +- http://mangas-lecture-en-ligne.fr/ : un site proposant beaucoup de mangas, en français + +### Types de fichiers supportés + +Nous supportons les types de fichiers suivants (aussi bien en entrée qu'en sortie) : + +- epub : les fichiers .epub créés avec Fanfix (nous ne supportons pas les autres fichiers .epub, du moins pour le moment) +- text : les histoires enregistrées en texte (.txt), avec quelques règles spécifiques : + - le titre doit être sur la première ligne + - l'auteur (précédé de rien, ```Par ```, ```De ``` ou ```©```) doit être sur la deuxième ligne, optionnellement suivi de la date de publication entre parenthèses (i.e., ```Par Quelqu'un (3 octobre 1998)```) + - les chapitres doivent être déclarés avec ```Chapitre x``` ou ```Chapitre x: NOM DU CHAPTITRE```, où ```x``` est le numéro du chapitre + - une description de l'histoire doit être donnée en tant que chaptire 0 + - une image de couverture peut être présente avec le même nom de fichier que l'histoire, mais une extension .png, .jpeg ou .jpg +- info_text : fort proche du format texte, mais avec un fichier .info accompagnant l'histoire pour y enregistrer quelques metadata (le fichier de metadata est supposé être créé par Fanfix, ou être compatible avec) +- cbz : les fichiers .cbz (une collection d'images zipées), de préférence créés avec Fanfix (même si les autres .cbz sont aussi supportés, mais sans la majorité des metadata de Fanfix dans ce cas) +- html : les fichiers HTML que vous pouvez ouvrir avec n'importe quel navigateur ; remarquez que Fanfix créera un répertoire pour y mettre les fichiers nécessaires, dont un fichier ```index.html``` pour afficher le tout -- nous ne supportons en entrée que les fichiers HTML créés par Fanfix + +### Plateformes supportées + +Toute plateforme supportant Java 1.6 devrait suffire. + +Le programme a été testé sur Linux (Debian, Slackware et Ubuntu), MacOS X et Windows pour le moment, mais n'hésitez pas à nous informer si vous l'essayez sur un autre système. + +Si vous avez des difficultés pour le compiler avec une version supportée de Java (1.6+), contactez-nous. + +## Options + +Vous pouvez démarrer le programme de deux façons : + +- ```java -jar fanfix.jar``` +- ```fanfix``` (si vous avez utilisé *make install*) + +Les arguments suivants sont supportés : + +- ```--import [URL]```: importer une histoire dans la librairie +- ```--export [id] [output_type] [target]```: exporter l'histoire "id" vers le fichier donné +- ```--convert [URL] [output_type] [target] (+info)```: convertir l'histoire vers le fichier donné, et forcer l'ajout d'un fichier .info si +info est utilisé +- ```--read [id] ([chapter number])```: afficher l'histoire "id" +- ```--read-url [URL] ([chapter number])```: convertir l'histoire et la lire à la volée, sans la sauver +- ```--search```: liste les sites supportés (```where```) +- ```--search [where] [keywords] (page [page]) (item [item])```: lance une recherche et affiche les résultats de la page ```page``` (page 1 par défaut), et de l'item ```item``` spécifique si demandé +- ```--tag [where]```: liste tous les tags supportés par ce site web +- ```--tag [index 1]... (page [page]) (item [item])```: affine la recherche, tag par tag, et affiche si besoin les sous-tags, les histoires ou les infos précises de l'histoire demandée +- ```--list```: lister les histoires presentes dans la librairie et leurs IDs +- ```--server [key] [port]```: démarrer un serveur d'histoires sur ce port +- ```--stop-server [key] [port]```: arrêter le serveur distant sur ce port (key doit avoir la même valeur) +- ```--remote [key] [host] [port]```: contacter ce server au lieu de la librairie habituelle (key doit avoir la même valeur) +- ```--help```: afficher la liste des options disponibles +- ```--version```: retourne la version du programme + +### Environnement + +Certaines variables d'environnement sont reconnues par le programme : + +- ```LANG=en```: forcer la langue du programme en anglais +- ```CONFIG_DIR=$HOME/.fanfix```: utilise ce répertoire pour les fichiers de configuration du programme (et copie les fichiers de configuration par défaut si besoin) +- ```NOUTF=1```: essaye d'utiliser des caractères non-unicode quand possible (cela peut avoir un impact sur les fichiers générés, pas uniquement sur les messages à l'utilisateur) +- ```DEBUG=1```: force l'option ```DEBUG=true``` du fichier de configuration (pour afficher plus d'information en cas d'erreur) + +## Compilation + +```./configure.sh && make``` + +Vous pouvez aussi importer les sources java dans, par exemple, [Eclipse](https://eclipse.org/), et faire un JAR exécutable depuis celui-ci. + +Quelques tests unitaires sont disponibles : + +```./configure.sh && make build test run-test``` + +Si vous faites tourner les tests unitaires, sachez que certains fichiers flags peuvent les impacter: + +- ```test/VERBOSE``` : active le mode verbeux pour les erreurs +- ```test/OFFLINE``` : ne permet pas au programme de télécharger des données +- ```test/URLS``` : permet au programme de tester des URLs +- ```test/FORCE_REFRESH```: force le nettoyage du cache + +Notez que le répertoire ```test/CACHE``` peut rester en place; il contient tous les fichiers téléchargés au moins une fois depuis le réseau par les tests unitaires (si vous autorisez les tests d'URLs, lancez les tests au moins une fois pour peupler le CACHE, puis activez le mode OFFLINE, ça marchera toujours). + +Les fichiers de test seront: + +- ```test/*.url``` : des URLs à télécharger en fichier texte (le contenu du fichier est l'URL) +- ```test/*.story```: des histoires en mode texte (le contenu du fichier est l'histoire) + +### Librairies dépendantes (incluses) + +Nécessaires : + +- ```libs/nikiroo-utils-sources.jar```: quelques utilitaires partagés +- [```libs/unbescape-sources.jar```](https://github.com/unbescape/unbescape): une librairie sympathique pour convertir du texte depuis/vers beaucoup de formats ; utilisée ici pour la partie HTML +- [```libs/jsoup-sources.jar```](https://jsoup.org/): une libraririe pour parser du HTML +- [```libs/JSON-java-20190722-sources.jar```](https://github.com/stleary/JSON-java): une libraririe pour parser du JSON + +Optionnelles : + +- [```libs/jexer-sources.jar```](https://github.com/klamonte/jexer): une petite librairie qui offre des widgets en mode TUI +- [```pandoc```](http://pandoc.org/): pour générer les man pages depuis les fichiers README + +Rien d'autre, si ce n'est Java 1.6+. + +À noter : ```make libs``` exporte ces librairies dans le répertoire src/. + +## Auteur + +Fanfix a été écrit par Niki Roo + diff --git a/README.md b/README.md new file mode 100644 index 0000000..1ad3339 --- /dev/null +++ b/README.md @@ -0,0 +1,158 @@ +English [Français](README-fr.md) + +# Fanfix + +Fanfix is a small Java program that can download stories from some supported websites and render them offline. + +## 🔴 This is the command line and server program + +You can also use: +- the graphical client [Fanfix-swing](https://github.com/nikiroo/fanfix-swing/) +- the TUI client [Fanfix-jexer](https://github.com/nikiroo/fanfix-jexer/) + +## Synopsis + +- ```fanfix``` --import [*URL*] +- ```fanfix``` --export [*id*] [*output_type*] [*target*] +- ```fanfix``` --convert [*URL*] [*output_type*] [*target*] (+info) +- ```fanfix``` --read [*id*] ([*chapter number*]) +- ```fanfix``` --read-url [*URL*] ([*chapter number*]) +- ```fanfix``` --search +- ```fanfix``` --search [*where*] [*keywords*] (page [*page*]) (item [*item*]) +- ```fanfix``` --search-tag +- ```fanfix``` --search-tag [*index 1*]... (page [*page*]) (item [*item*]) +- ```fanfix``` --list +- ```fanfix``` --server [*key*] [*port*] +- ```fanfix``` --stop-server [*key*] [*port*] +- ```fanfix``` --remote [*key*] [*host*] [*port*] +- ```fanfix``` --help + +## Description + +(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.) + +This program 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...). + +To help organize your stories, it can also work as a local library so you can: + +- Import a story from its URL (or just from a file) +- Export a story to a file (in any of the supported output types) +- Display a story from the local library in text format in the console +- Via [fanfix-swing](https://github.com/nikiroo/fanfix-swing/): Display a story from the local library graphically **by itself** ([fanfix-swing](https://github.com/nikiroo/fanfix-swing/)) or **by calling a native program to handle it** (potentially converted into HTML before hand, so any browser can open it) + +### Supported websites + +Currently, the following websites are supported: + +- http://FimFiction.net/: fan fictions devoted to the My Little Pony show +- http://Fanfiction.net/: fan fictions of many, many different universes, from TV shows to novels to games +- http://mangahub.io/: a well filled repository of mangas (English) +- https://e621.net/: a Furry website supporting comics, including MLP +- https://sofurry.com/: same thing, but story-oriented +- https://e-hentai.org/: done upon request (so, feel free to ask for more websites!) +- http://mangas-lecture-en-ligne.fr/: a website offering a lot of mangas (in French) + +### Support file types + +We support a few file types for local story conversion (both as input and as output): + +- epub: .epub files created by this program (we do not support "all" .epub files, at least for now) +- text: local stories encoded in plain text format, with a few specific rules: + - the title must be on the first line + - 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)```) + - chapters must be declared with ```Chapter x``` or ```Chapter x: NAME OF THE CHAPTER```, where ```x``` is the chapter number + - a description of the story must be given as chapter number 0 + - a cover image may be present with the same filename as the story, but a .png, .jpeg or .jpg extension +- 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) +- cbz: .cbz (collection of images) files, preferably created with Fanfix (but any .cbz file is supported, though without most of Fanfix metadata, obviously) +- 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 + +### Supported platforms + +Any platform with at lest Java 1.6 on it should be ok. + +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. + +If you have any problems to compile it with a supported Java version (1.6+), please contact us. + +## Options + +You can start the program in two ways: + +- ```java -jar fanfix.jar``` +- ```fanfix``` (if you used *make install*) + +The following arguments are allowed: + +- ```--import [URL]```: import the story at URL into the local library +- ```--export [id] [output_type] [target]```: export the story denoted by ID to the target file +- ```--convert [URL] [output_type] [target] (+info)```: convert the story at URL into target, and force-add the .info and cover if +info is passed +- ```--read [id] ([chapter number])```: read the given story denoted by ID from the library +- ```--read-url [URL] ([chapter number])```: convert on the fly and read the story at URL, without saving it +- ```--search```: list the supported websites (```where```) +- ```--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 +- ```--tag [where]```: list all the tags supported by this website +- ```--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 +- ```--list```: list the stories present in the library and their associated IDs +- ```--server [key] [port]```: start a story server on this port +- ```--stop-server [key] [port]```: stop the remote server running on this port (key must be set to the same value) +- ```--remote [key] [host] [port]```: contact this server instead of the usual library (key must be set to the same value) +- ```--help```: display the available options +- ```--version```: return the version of the program + +### Environment + +Some environment variables are recognized by the program: + +- ```LANG=en```: force the language to English +- ```CONFIG_DIR=$HOME/.fanfix```: use the given directory as a config directory (and copy the default configuration if needed) +- ```NOUTF=1```: try to fallback to non-unicode values when possible (can have an impact on the resulting files, not only on user messages) +- ```DEBUG=1```: force the ```DEBUG=true``` option of the configuration file (to show more information on errors) + +## Compilation + +```./configure.sh && make``` + +You can also import the java sources into, say, [Eclipse](https://eclipse.org/), and create a runnable JAR file from there. + +There are some unit tests you can run, too: + +```./configure.sh && make build test run-test``` + +If you run the unit tests, note that some flag files can impact them: + +- ```test/VERBOSE``` : enable verbose mode +- ```test/OFFLINE``` : to forbid any downloading +- ```test/URLS``` : to allow testing URLs +- ```test/FORCE_REFRESH```: to force a clear of the cache + +Note 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). + +The test files will be: + +- ```test/*.url``` : URL to download in text format, content = URL +- ```test/*.story```: text mode story, content = story + + +### Dependant libraries (included) + +Required: + +- ```libs/nikiroo-utils-sources.jar```: some shared utility functions +- [```libs/unbescape-sources.jar```](https://github.com/unbescape/unbescape): a nice library to escape/unescape a lot of text formats; used here for HTML +- [```libs/jsoup-sources.jar```](https://jsoup.org/): a library to parse HTML +- [```libs/JSON-java-20190722-sources.jar```](https://github.com/stleary/JSON-java): a library to parse JSON + +Optional: + +- [```libs/jexer-sources.jar```](https://github.com/klamonte/jexer): a small library that offers TUI widgets +- [```pandoc```](http://pandoc.org/): to generate the man pages from the README files + +Nothing else but Java 1.6+. + +Note that calling ```make libs``` will export the libraries into the src/ directory. + +## Author + +Fanfix was written by Niki Roo + diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..85f2deb --- /dev/null +++ b/TODO.md @@ -0,0 +1,106 @@ +My current planning for Fanfix (but not everything appears on this list): + +- [ ] Support new websites + - [x] YiffStar + - [ ] [Two Kinds](http://twokinds.keenspot.com/) + - [ ] [Slightly damned](http://www.sdamned.com/) + - [x] New API on FimFiction.net (faster) + - [x] Replace MangaFox which is causing issues all the time + - [ ] Others? Any ideas? I'm open for requests + - [x] [e-Hentai](https://e-hentai.org/) requested + - [x] Find some FR comics/manga websites + - [ ] Find more FR thingies +- [ ] Support videos (anime)? +- [x] A GUI library + - [x] Make one + - [x] Make it run when no args passed + - [x] Fix the UI, it is ugly + - [x] Work on the UI thread is BAD + - [x] Allow export + - [x] Allow delete/refresh + - [x] Show a list of types + - [x] ..in the menu + - [x] ..as a screen view + - [x] options screen + - [x] support progress events + - [x] Real menus + - [x] Store the long lists in [A-B], [BA-BB], ... +- [ ] A TUI library + - [x] Choose an output (Jexer) + - [x] Implement it from --set-reader to the actual window + - [x] List the stories + - [x] Fix the UI layout + - [x] Status bar + - [x] Real menus + - [ ] Store the long lists in [A-B], [BA-BB], ... + - [x] Open a story in the reader and/or natively + - [ ] Update the screenshots + - [ ] Remember the current chapter and current read status of stories + - [ ] Support progress events + - [x] Add a properties pages + - [ ] Deal with comics + - [x] properties page + - [x] external launcher + - [ ] jexer sixels? +- [ ] Move the GUI parts out of fanfix itself (see fanfix-swing) + - [x] Make new project: fanfix-swing + - [x] Fix the UI issues we had (UI thread) + - [x] Make it able to browse already downloaded stories + - [x] Make it able to download stories + - [ ] See what config options to use + - [ ] Import all previous menus end functions + - [ ] Feature parity with original GUI +- [ ] Move the TUI parts out of fanfix itself + - [ ] Make new project +- [x] Network support + - [x] A server that can send the stories + - [x] A network implementation of the Library + - [x] Write access to the library + - [x] Access rights (a simple "key") + - [x] More tests, especially with the GUI + - [x] ..even more + - [x] support progress events +- [x] Check if it can work on Android + - [x] First checks: it should work, but with changes + - [x] Adapt work on images :( + - [x] Partial/Conditional compilation + - [x] APK export +- [ ] Android + - [x] Android support + - [x] Show current stories + - [x] Download new stories + - [ ] Sort stories by Source/Author + - [ ] Fix UI + - [ ] support progress events + - [x] give up and ask a friend... +- [ ] Translations + - [x] i18n system in place + - [x] Make use of it in text + - [x] Make use of it in gui + - [ ] Make use of it in tui + - [ ] Use it for all user output + - [x] French translation + - [x] French manual/readme +- [x] Install a mechanism to handle stories import/export progress update + - [x] Progress system + - [x] in support classes (import) + - [x] in output classes (export) +- [x] Version + - [x] Use a version number + - [x] Show it in UI + - [x] A check-update feature + - [x] ..translated +- [ ] Improve GUI library + - [x] Allow launching a custom application instead of Desktop.start + - [ ] Add the resume next to the cover icon if available (as an option) + - [ ] Add the resume in the Properties page (maybe a second tab?) +- [ ] Bugs + - [x] Fix "Redownload also reset the source" + - [x] Fix "Redownload remote does not show the new item before restart of client app" + - [x] Fix eHentai "content warning" access (see 455) + - [ ] Fix the configuration system (for new or changed options, new or changed languages) + - [x] remote import also download the file in cache, why? + - [x] import file in remote mode tries to import remote file!! + - [ ] import file does not find author in cbz with SUMMARY file + - [x] import file:// creates a tmp without auto-deletion in /tmp/fanfic-... + diff --git a/changelog-fr.md b/changelog-fr.md new file mode 100644 index 0000000..bdcc91c --- /dev/null +++ b/changelog-fr.md @@ -0,0 +1,284 @@ +# Fanfix + +# Version 3.1.2 + +- fix: date de publication/création formatée +- e621: correction sur l'ordre, encore +- e621: possibilité d'utiliser un Login/API key pour éviter les blacklists +- e621: meilleures meta-data + +# Version 3.1.1 + +- e621: correction pour les chapitres des pools dans l'ordre inverse +- fix: trie les histores par nom et plus par date +- fix: affiche le nom de l'histoire dans les barres de progrès + +# Version 3.1.0 + +- MangaHub: un nouvau site de manga (English) +- MangaFox: retrait du support (site désagréable) +- e621: correction pour la cover non sauvée + +# Version 3.0.1 + +- fix: en cas d'URL non supportée, n'affiche plus un message d'erreur relatif à "file://" +- e621: update pour e621 (et ce n'est plus un BasicSupport_Deprecated) + +# Version 3.0.0 + +- new: maintenant compatible Android (voir [companion project](https://gitlab.com/Rayman22/fanfix-android)) +- new: recherche d'histoires (pas encore toutes les sources) +- new: support d'un proxy +- fix: support des CBZ contenant du texte +- fix: correction de DEBUG=0 +- fix: correction des histoires importées qui n'arrivent pas immédiatement à l'affichage +- gui: correction pour le focus +- gui: fix pour la couleur d'arrière plan +- gui: fix pour la navigation au clavier (haut et bas) +- gui: configuration beaucoup plus facile +- gui: peut maintenant télécharger toutes les histoires d'un groupe en cache en une fois +- MangaLEL: site web changé +- search: supporte MangaLEL +- search: supporte Fanfiction.net +- FimFictionAPI: correction d'une NPE +- remote: changement du chiffrement because Google +- remote: incompatible avec 2.x +- remote: moins bonnes perfs mais meilleure utilisation de la mémoire +- remote: le log inclus maintenant la date des évènements +- remote: le mot de passe se configure maintenant dans le fichier de configuration + +# Version 2.0.3 + +SoFurry: correction pour les histoires disponibles uniquement aux utilisateurs inscrits sur le site + +# Version 2.0.2 + +- i18n: changer la langue dans les options fonctionne aussi quand $LANG existe +- gui: traduction en français +- gui: ReDownloader ne supprime plus le livre original +- fix: corrections pour le visionneur interne +- fix: quelques corrections pour les traductions + +# Version 2.0.1 + +- core: un changement de titre/source/author n'était pas toujours visible en runtime +- gui: ne recharger les histoires que quand nécessaire + +# Version 2.0.0 + +- new: les sources peuvent contenir "/" (et utiliseront des sous-répertoires en fonction) +- gui: nouvelle page pour voir les propriétés d'une histoire +- gui: renommer les histoires, changer l'auteur +- gui: permet de lister les auteurs ou les sources en mode "tout" ou "listing" +- gui: lecteur intégré pour les histoires (texte et images) +- tui: fonctionne maintenant assez bien que pour être déclaré stable +- cli: permet maintenant de changer la source, le titre ou l'auteur +- remote: fix de setSourceCover (ce n'était pas vu par le client) +- remote: on peut maintenant importer un fichier local +- remote: meilleures perfs +- remote: incompatible avec 1.x +- fix: deadlock dans certains cas rares (nikiroo-utils) +- fix: le résumé n'était pas visibe dans certains cas +- fix: update de nikiroo-utils, meilleures perfs pour le remote +- fix: eHentai content warning + +# Version 1.8.1 + +- e621: les images étaient rangées à l'envers pour les recherches (/post/) +- e621: correction pour /post/search/ +- remote: correction de certains problèmes de timeout +- remote: amélioration des perfs +- fix: permettre les erreurs I/O pour les CBZ (ignore l'image) +- fix: corriger le répertoire des covers par défaut + +# Version 1.8.0 + +- FimfictionAPI: les noms des chapitres sont maintenant triés correctement +- e621: supporte aussi les recherches (/post/) +- remote: la cover est maintenant envoyée au client pour les imports +- MangaLel: support pour MangaLel + +# Version 1.7.1 + +- GUI: fichiers tmp supprimés trop vite en mode GUI +- fix: une histoire sans cover pouvait planter le programme +- ePub: erreur d'import pour un EPUB local sans cover + +# Version 1.7.0 + +- new: utilisation de jsoup pour parser le HTML (pas encore partout) +- update: mise à jour de nikiroo-utils +- android: compatibilité Android +- MangaFox: fix après une mise-à-jour du site +- MangaFox: l'ordre des tomes n'était pas toujours bon +- ePub: correction pour la compatibilité avec certains lecteurs ePub +- remote: correction pour l'utilisation du cache +- fix: TYPE= était parfois mauvais dans l'info-file +- fix: les guillemets n'étaient pas toujours bien ordonnés +- fix: amélioration du lanceur externe (lecteur natif) +- test: plus de tests unitaires +- doc: changelog disponible en français +- doc: man pages (en, fr) +- doc: SysV init script + +# Version 1.6.3 + +- fix: corrections de bugs +- remote: notification de l'état de progression des actions +- remote: possibilité d'envoyer des histoires volumineuses +- remote: détection de l'état du serveur +- remote: import and change source on server +- CBZ: meilleur support de certains CBZ (si SUMMARY ou URL est présent dans le CBZ) +- Library: correction pour les pages de couvertures qui n'étaient pas toujours effacées quand l'histoire l'était +- fix: correction pour certains cas où les images ne pouvaient pas être sauvées (quand on demande un jpeg mais que l'image n'est pas supportée, nous essayons maintenant ensuite en png) +- remote: correction pour certaines images de couvertures qui n'étaient pas trouvées (nikiroo-utils) +- remote: correction pour les images de couvertures qui n'étaient pas transmises + +## Version 1.6.2 + +- GUI: amélioration des barres de progression +- GUI: meilleures performances pour l'ouverture d'une histoire si le type de l'histoire est déjà le type demandé pour l'ouverture (CBZ -> CBZ ou HTML -> HTML par exemple) + +## Version 1.6.1 + +- GUI: nouvelle option (désactivée par défaut) pour afficher un élément par source (type) sur la page de démarrage au lieu de tous les éléments triés par source (type) +- fix: correction de la source (type) qui était remis à zéro après un re-téléchargement +- GUI: affichage du nombre d'images présentes au lieu du nombre de mots pour les histoires en images + +## Version 1.6.0 + +- TUI: un nouveau TUI (mode texte mais avec des fenêtres et des menus en texte) -- cette option n'est pas compilée par défaut (configure.sh) +- remote: un serveur pour offrir les histoires téléchargées sur le réseau +- remote: une Library qui reçoit les histoires depuis un serveur distant +- update: mise à jour de nikiroo-utils +- FimFiction: support for the new API +- new: mise à jour du cache (effacer le cache actuel serait une bonne idée) +- GUI: correction pour le déplacement d'une histoire qui n'est pas encore dans le cache + +## Version 1.5.3 + +- FimFiction: correction pour les tags dans les metadata et la gestion des chapitres pour certaines histoires + +## Version 1.5.2 + +- FimFiction: correction pour les tags dans les metadata + +## Version 1.5.1 + +- FimFiction: mise à jour pour supporter FimFiction 4 +- eHentai: correction pour quelques metadata qui n'étaient pas reprises + +## Version 1.5.0 + +- eHentai: nouveau site supporté sur demande (n'hésitez pas !) : e-hentai.org +- Library: amélioration des performances quand on récupère une histoire (la page de couverture n'est plus chargée quand cela n'est pas nécessaire) +- Library: correction pour les pages de couvertures qui n'étaient pas toujours effacées quand l'histoire l'était +- GUI: amélioration des performances pour l'affichage des histoires (la page de couverture est re-dimensionnée en cache) +- GUI: on peut maintenant éditer la source d'une histoire ("Déplacer vers...") + +## Version 1.4.2 + +- GUI: nouveau menu Options pour configurer le programme (très minimaliste pour le moment) +- new: gestion de la progression des actions plus fluide et avec plus de détails +- fix: meilleur support des couvertures pour les fichiers en cache + +## Version 1.4.1 + +- fix: correction de UpdateChecker qui affichait les nouveautés de TOUTES les versions du programme au lieu de se limiter aux versions plus récentes +- fix: correction de la gestion de certains sauts de ligne pour le support HTML (entre autres, FanFiction.net) +- GUI: les barres de progrès fonctionnent maintenant correctement +- update: mise à jour de nikiroo-utils pour récupérer toutes les étapes dans les barres de progrès +- ( --Fin des nouveautés de la version 1.4.1-- ) + +## Version 1.4.0 + +- new: sauvegarde du nombre de mots et de la date de création des histoires dans les fichiers mêmes +- GUI: nouvelle option pour afficher le nombre de mots plutôt que le nom de l'auteur sous le nom de l'histoire +- CBZ: la première page n'est plus doublée sur les sites n'offrant pas de page de couverture +- GUI: recherche de mise à jour (le programme cherche maintenant si une mise à jour est disponible pour en informer l'utilisateur) + +## Version 1.3.1 + +- GUI: on peut maintenant trier les histoires par auteur + +## Version 1.3.0 + +- YiffStar: le site YiffStar (SoFurry.com) est maintenant supporté +- new: support des sites avec login/password +- GUI: les URLs copiées (ctrl+C) sont maintenant directement proposées par défaut quand on importe une histoire +- GUI: la version est maintenant visible (elle peut aussi être récupérée avec --version) + +## Version 1.2.4 + +- GUI: nouvelle option re-télécharger +- GUI: les histoires sont maintenant triées (et ne changeront plus d'ordre après chaque re-téléchargement) +- fix: corrections sur l'utilisation des guillemets +- fix: corrections sur la détection des chapitres +- new: de nouveaux tests unitaires + +## Version 1.2.3 + +- HTML: les fichiers originaux (info_text) sont maintenant rajoutés quand on sauve +- HTML: support d'un nouveau type de fichiers à l'import: HTML (si fait par Fanfix) + +## Version 1.2.2 + +- GUI: nouvelle option "Sauver sous..." +- GUI: corrections (rafraîchissement des icônes) +- fix: correction de la gestion du caractère TAB dans les messages utilisateurs +- GUI: LocalReader supporte maintenant "--read" +- ePub: corrections sur le CSS + +## Version 1.2.1 + +- GUI: de nouvelles fonctions ont été ajoutées dans le menu +- GUI: popup avec un clic droit sur les histoires +- GUI: corrections, particulièrement pour LocalLibrary +- GUI: nouvelle icône (un rond vert) pour dénoter qu'une histoire est "cachée" (dans le LocalReader) + +## Version 1.2.0 + +- GUI: système de notification de la progression des actions +- ePub: changements sur le CSS +- new: de nouveaux tests unitaires +- GUI: de nouvelles fonctions ont été ajoutées dans le menu (supprimer, rafraîchir, un bouton exporter qui ne fonctionne pas encore) + +## Version 1.1.0 + +- CLI: nouveau système de notification de la progression des actions +- e621: correction pour les "pending pools" qui ne fonctionnaient pas avant +- new: système de tests unitaires ajouté (pas encore de tests propres à Fanfix) + +## Version 1.0.0 + +- GUI: état acceptable pour une 1.0.0 (l'export n'est encore disponible qu'en CLI) +- fix: bugs fixés +- GUI: (forte) amélioration +- new: niveau fonctionnel acceptable pour une 1.0.0 + +## Version 0.9.5 + +- fix: bugs fixés +- new: compatibilité avec WIN32 (testé sur Windows 10) + +## Version 0.9.4 + +- fix: (beaucoup de) bugs fixés +- new: amélioration des performances +- new: moins de fichiers cache utilisés +- GUI: amélioration (pas encore parfait, mais utilisable) + +## Version 0.9.3 + +- fix: (beaucoup de) bugs fixés +- GUI: première implémentation graphique (laide et buggée) + +## Version 0.9.2 + +- new: version minimum de la JVM : Java 1.6 (tous les JAR binaires ont été compilés en Java 1.6) +- fix: bugs fixés + +## Version 0.9.1 + +- version initiale + diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..cd63d1f --- /dev/null +++ b/changelog.md @@ -0,0 +1,284 @@ +# Fanfix + +# Version 3.1.2 + +- fix: publication/creation date formated +- e621: fix order again +- e621: option to use a Login/API key to evade blacklists +- e621: better metadata + +# Version 3.1.1 + +- e621: fix chapters in reverse order for pools +- fix: sort the stories by title and not by date +- fix: expose the story name on progress bars + +# Version 3.1.0 + +- MangaHub: a manga website (English) +- MangaFox: removed (too many unfriendly changes, bye) +- e621: fix cover not saved + +# Version 3.0.1 + +- fix: update for e621 (and it is no more a BasicSupport_Deprecated) +- fix: for unsupported URL, do not errors out with a "file://" related message + +# Version 3.0.0 + +- new: now Android-compatible (see [companion project](https://gitlab.com/Rayman22/fanfix-android)) +- new: story search (not all sources yet) +- new: proxy support +- fix: support hybrid CBZ (with text) +- fix: fix DEBUG=0 +- fix: fix imported stories that don't immediatly appear on screen +- gui: focus fix +- gui: bg colour fix +- gui: fix keyboard navigation support (up and down) +- gui: configuration is now much easier +- gui: can now prefetch to cache all the sories of a group at once +- MangaLEL: website has changed +- search: Fanfiction.net support +- search: MangaLEL support +- FimFictionAPI: fix NPE +- remote: encryption mode changed because Google +- remote: not compatible with 2.x +- remote: can now use password from config file +- remote: worse perfs but much better memory usage +- remote: log now includes the time of events + +# Version 2.0.3 + +SoFurry: fix for stories only available to registrated users + +# Version 2.0.2 + +- i18n: setting the language in the option panel now works even with $LANG set +- gui: translated into French +- gui: ReDownload does not delete the original book anymore +- gui: internal viewer fixes +- gui: some translation fixes + +# Version 2.0.1 + +- core: a change of title/source/author was not always visible at runtime +- gui: only reload the stoies when needed + +# Version 2.0.0 + +- new: sources can contain "/" (and will use subdirectories) +- gui: new Properties page for stories +- gui: rename stories, change author +- gui: allow "all" and "listing" modes for sources and authors +- gui: integrated viewer for stories (both text and images) +- tui: now working well enough to be considered stable +- cli: now allow changing the source, title and author +- remote: fix setSourceCover (was not seen by client) +- remote: can now import local files into a remote library +- remote: better perfs +- remote: not compatible with 1.x +- fix: deadlock in some rare cases (nikiroo-utils) +- fix: the resume was not visible in some cases +- fix: update nikiroo-utils, better remote perfs +- fix: eHentai content warning + +# Version 1.8.1 + +- e621: the images were stored in reverse order for searches (/post/) +- e621: fix for /post/search/ +- remote: fix some timeout issues +- remote: improve perfs +- fix: allow I/O errors on CBZ files (skip image) +- fix: fix the default covers directory + +# Version 1.8.0 + +- FimfictionAPI: chapter names are now correctly ordered +- e621: now supports searches (/post/) +- remote: cover is now sent over the network for imported stories +- MangaLel: new support for MangaLel + +# Version 1.7.1 + +- GUI: tmp files deleted too soon in GUI mode +- fix: unavailable cover could cause a crash +- ePub: local EPUB import error when no cover + +# Version 1.7.0 + +- new: use jsoup for parsing HTML (not everywhere yet) +- update nikiroo-utils +- android: Android compatibility +- MangaFox: fix after website update +- MangaFox: tomes order was not always correct +- ePub: fix for compatibility with some ePub viewers +- remote: cache usage fix +- fix: TYPE= not always correct in info-file +- fix: quotes error +- fix: improve external launcher (native viewer) +- test: more unit tests +- doc: changelog available in French +- doc: man pages (en, fr) +- doc: SysV init script + +# Version 1.6.3 + +- fix: bug fixes +- remote: progress report +- remote: can send large files +- remote: detect server state +- remote: import and change source on server +- CBZ: better support for some CBZ files (if SUMMARY or URL files are present in it) +- Library: fix cover images not deleted on story delete +- fix: some images not supported because not jpeg-able (now try again in png) +- remote: fix some covers not found over the wire (nikiroo-utils) +- remote: fix cover image files not sent over the wire + +## Version 1.6.2 + +- GUI: better progress bars +- GUI: can now open files much quicker if they are stored in both library and cache with the same output type + +## Version 1.6.1 + +- GUI: new option (disabled by default) to show one item per source type instead of one item per story when showing ALL sources (which is also the start page) +- fix: source/type reset when redownloading +- GUI: show the number of images instead of the number of words for images documents + +## Version 1.6.0 + +- TUI: new TUI (text with windows and menus) -- not compiled by default (configure.sh) +- remote: a server option to offer stories on the network +- remote: a remote library to get said stories from the network +- update to latest version of nikiroo-utils +- FimFiction: support for the new API +- new: cache update (you may want to clear your current cache) +- GUI: bug fixed (moving an unopened book does not fail any more) + +## Version 1.5.3 + +- FimFiction: Fix tags and chapter handling for some stories + +## Version 1.5.2 + +- FimFiction: Fix tags metadata on FimFiction 4 + +## Version 1.5.1 + +- FimFiction: Update to FimFiction 4 +- eHentai: Fix some meta data that were missing + +## Version 1.5.0 + +- eHentai: new website supported on request (do not hesitate!): e-hentai.org +- Library: perf improvement when retrieving the stories (cover not loaded when not needed) +- Library: fix the covers that were not always removed when deleting a story +- GUI: perf improvement when displaying books (cover resized then cached) +- GUI: sources are now editable ("Move to...") + +## Version 1.4.2 + +- GUI: new Options menu to configure the program (minimalist for now) +- new: improve progress reporting (smoother updates, more details) +- fix: better cover support for local files + +## Version 1.4.1 + +- fix: UpdateChecker which showed the changes of ALL versions instead of the newer ones only +- fix: some bad line breaks on HTML support (including FanFiction.net) +- GUI: progress bar now working correctly +- update: nikiroo-utils update to show all steps in the progress bars +- ( --End of changes for version 1.4.1-- ) + +## Version 1.4.0 + +- new: remember the word count and the date of creation of Fanfix stories +- GUI: option to show the word count instead of the author below the book title +- CBZ: do not include the first page twice anymore for no-cover websites +- GUI: update version check (we now check for new versions) + +## Version 1.3.1 + +- GUI: can now display books by Author + +## Version 1.3.0 + +- YiffStar: YiffStar (SoFurry.com) is now supported +- new: supports login/password websites +- GUI: copied URLs (ctrl+C) are selected by default when importing a URL +- GUI: version now visible (also with --version) + +## Version 1.2.4 + +- GUI: new option: Re-download +- GUI: books are now sorted (will not jump around after refresh/redownload) +- fix: quote character handling +- fix: chapter detection +- new: more tests included + +## Version 1.2.3 + +- HTML: include the original (info_text) files when saving +- HTML: new input type supported: HTML files made by Fanfix + +## Version 1.2.2 + +- GUI: new "Save as..." option +- GUI: fixes (icon refresh) +- fix: handling of TABs in user messages +- GUI: LocalReader can now be used with --read +- ePub: CSS style fixes + +## Version 1.2.1 + +- GUI: some menu functions added +- GUI: right-click popup menu added +- GUI: fixes, especially for the LocalReader library +- GUI: new green round icon to denote "cached" (into LocalReader library) files + +## Version 1.2.0 + +- GUI: progress reporting system +- ePub: CSS style changes +- new: unit tests added +- GUI: some menu functions added (delete, refresh, a place-holder for export) + +## Version 1.1.0 + +- CLI: new Progress reporting system +- e621: fix on "pending" pools, which were not downloaded before +- new: unit tests system added (but no test yet, as all tests were moved into nikiroo-utils) + +## Version 1.0.0 + +- GUI: it is now good enough to be released (export is still CLI-only though) +- fix: bug fixes +- GUI: improved (a lot) +- new: should be good enough for 1.0.0 + +## Version 0.9.5 + +- fix: bug fixes +- new: WIN32 compatibility (tested on Windows 10) + +## Version 0.9.4 + +- fix: bug fixes (lots of) +- new: perf improved +- new: use less cache files +- GUI: improvement (still not really OK, but OK enough I guess) + +## Version 0.9.3 + +- fix: bug fixes (lots of) +- GUI: first implementation (which is ugly and buggy -- the buggly GUI) + +## Version 0.9.2 + +- new: minimum JVM version: Java 1.6 (all binary JAR files will be released in 1.6) +- fix: bug fixes + +## Version 0.9.1 + +- initial version + diff --git a/configure.sh b/configure.sh new file mode 100755 index 0000000..1c1a529 --- /dev/null +++ b/configure.sh @@ -0,0 +1,71 @@ +#!/bin/sh + +# default: +PREFIX=/usr/local +PROGS="java javac jar make sed" + +IMG=be/nikiroo/utils/ui/ImageUtilsAwt + +valid=true +while [ "$*" != "" ]; do + key=`echo "$1" | cut -f1 -d=` + val=`echo "$1" | cut -f2 -d=` + case "$key" in + --) + ;; + --help) # This help message + echo The following arguments can be used: + cat "$0" | grep '^\s*--' | grep '#' | while read ln; do + cmd=`echo "$ln" | cut -f1 -d')'` + msg=`echo "$ln" | cut -f2 -d'#'` + echo " $cmd$msg" + done + ;; + --prefix) #=PATH Change the prefix to the given path + PREFIX="$val" + ;; + *) + echo "Unsupported parameter: '$1'" >&2 + echo >&2 + sh "$0" --help >&2 + valid=false + ;; + esac + shift +done + +[ $valid = false ] && exit 1 + +MESS="A required program cannot be found:" +for prog in $PROGS; do + out="`whereis -b "$prog" 2>/dev/null`" + if [ "$out" = "$prog:" ]; then + echo "$MESS $prog" >&2 + valid=false + fi +done + +[ $valid = false ] && exit 2 + +if [ "`whereis tput`" = "tput:" ]; then + ok='"[ ok ]"'; + ko='"[ !! ]"'; + cols=80; +else + #ok='"`tput bold`[`tput setf 2` OK `tput init``tput bold`]`tput init`"'; + #ko='"`tput bold`[`tput setf 4` !! `tput init``tput bold`]`tput init`"'; + ok='"`tput bold`[`tput setaf 2` OK `tput init``tput bold`]`tput init`"'; + ko='"`tput bold`[`tput setaf 1` !! `tput init``tput bold`]`tput init`"'; + cols='"`tput cols`"'; +fi; + +echo "MAIN = be/nikiroo/fanfix/Main" > Makefile +echo "MORE = $IMG" >> Makefile +echo "TEST = be/nikiroo/fanfix/test/Test" >> Makefile +echo "TEST_PARAMS = $cols $ok $ko" >> Makefile +echo "NAME = fanfix" >> Makefile +echo "PREFIX = $PREFIX" >> Makefile +echo "JAR_FLAGS += -C bin/ org -C bin/ be -C ./ LICENSE -C ./ VERSION -C libs/ licenses" >> Makefile + +cat Makefile.base >> Makefile + diff --git a/docs/android/android.md b/docs/android/android.md new file mode 100644 index 0000000..f3d2775 --- /dev/null +++ b/docs/android/android.md @@ -0,0 +1,289 @@ +# Android UI mock-up + +## Concepts + +### Story + +We have **Stories** in Fanfix, which represent a story (an "epub", ...) or a comics (a "CBZ" file, ...). + +A story is written by an author, comes from a source and is dentified by a LUID (Local Unique ID). +It can be a text story or an image story. + +The source can actually be changed by the user (this is the main sorting key). + +### Book + +We also have **Books**. + +Books can be used to display: + +- All the sources present in the library +- All the authors known in the lbrary +- Stories sharing a source or an author + +### All and Listing modes + +When representing sources or authors, books can be arranged in two modes: + +- "All" mode : all the sources/authors are represented by a book and displayed in the UI +- "Listing" mode : for each source/author, a group of books representing the corresponding story is present with the name of the source/author to group them (for instance, a JLabel on top of the group) + +Note: Listing mode can be left out of the Android version if needed (but the all mode is really needed). + +### Destination + +What I call here a destination is a specific group of books. + +Examples : + +- All the sources +- All the books of author "Tulipe, F." +- A listing of all the authors and their stories + +## Core + +### Library (main screen) + +![Main library](screens/main_lib.jpg) + +#### Header + +The header has a title, a navigation icon on the left and a search icon. + +Title can vary upon the current displayed books: + +- All sources +- Sources listing +- Source: xxx +- All authors +- Authors listing +- Author: xxx + +The navigation icon open the Navigation drawer. + +##### Search + +![Search/Filter](screens/search.jpg) + +The search icon is actually a filter: it will hide all the books that don't contain the given text (search on LUID, title and author). + +#### List + +This list will hold books. Each item will be represented by : + +- a cover image (which is provided by fanfix.jar) +- a main info, which can be: + - for stories, the story title + - for source books, the source name + - for author books, the author name +- a secondary info, which can vary via a setting (see the Options page) between: + - author name (for a book representing an author, it is left blank) + - a count (a word count for text stories, an image count for images stories, a stories count for sources and authors books) + +#### UI + +Material.IO: + +- Title, navigation icon, search icon : [App bar top](https://material.io/design/components/app-bars-top.html) +- List : [Cards](https://material.io/design/components/cards.html) + +A tap will open the target book in full-screen mode (i.e., the details about the card). + +On the detailed card, you will see the description (see Description Page) and 3 buttons : + +- Open +- Delete +- "..." for a menu + +### Navigation drawer + +![Navigation Drawer](screens/navigation.jpg) + +The navigation drawer will list 4 destinations: + +- All the sources +- Listing of the sources +- All the authors +- Listing of the authors +- By source + +...and 2 foldable "panels" with more destinations: + +- By source +- By author + +Those subpanels will either contain the sources/authors **or** sub-subpanels with sources/authors. +See fanfix.jar (BasicLibrary.getSourcesGrouped() and BasicLibrary.getAuthorsGrouped()). + +Note: if those last two cause problems, they can be removed; the first four options would be enough to cover the main use cases. + +#### UI + +Material.IO: + +- Navigation drawer: navigation drawer + +### Context menu + +![Context Menu](screens/menu.jpg) + +The context menu options are as follow for stories: + +- Open : open the book (= internal or external reader) +- Rename... : ask the user for a new title for the story (default is current name) +- Move to >> : show a "new source..." option as well as the current ones fo quick select (BasicLibrary.getSourcesGrouped() will return all the sources on only one level if their number is small enough) + - * + - [new source...] + - [A-H] + - Anima + - Fanfiction.NET + - [I-Z] + - MangaFox +- Change author to >> : show a "new author..." option as well as the current ones fo quick select (BasicLibrary.getAuthorsGrouped() will return all the authors on only one level if their number is small enough) + - * + - [new author...] + - [0-9] + - 5-stars + - [A-H] + - Albert + - Béatrice + - Hakan + - [I-Z] + - Irma + - Zoul +- Delete : delete the story +- Redownload : redownload the story (will **not** delete the original) +- Properties : open the properties page + +For other books (sources and authors): + +- Open: open the book (= go to the selected destination) + +#### UI + +Material.IO: + +- menu: [menu](https://developer.android.com/guide/topics/ui/menus.html) + +The menu will NOT use sublevels but link to a [list](https://material.io/design/components/lists.html) instead. + +### Description page + +![Description Page](screens/desc.jpg) + +#### Header + +Use the same cover image as the books, and the description key/values comes from BasicReader.getMetaDesc(MetaData). + +#### Description + +Simply display Story.getMeta().getResume(), without adding the chapter number (it is always 0 for description). + +An example can be seen in be.nikiroo.fanfix.ui.GuiReaderViewerTextOutput.java. + +### Options page + +![Options Page](screens/options.jpg) + +It consists of a "Remote Library" panel: + +- enable : an option to enable/disable the remote library (if disabled, use the local library instead) +- server : (only enabled if the remote library is) the remote server host +- port : (only enabled if the remote library is) the remote server port +- key : (only enabled if the remote library is) the remote server secret key + +...and 5 other options: + +- Open CBZ files internally : open CBZ files with the internal viewer +- Open epub files internally : open EPUB files with the internal viewer +- Show handles on image viewer : can hide the handles used as cues in the image viewer to know where to click +- Startup screen : select the destination to show on application startup +- Language : select the language to use + +#### Startup screen + +Can be: + +- Sources + - All + - Listing +- Authors + - All + - Listing + +...but will have to be presented in a better way to the user (i.e., better names). + +#### UI + +Material.IO: + +- the page itself : Temporary UI Region +- the options : Switch +- the languages : Exposed Dropdown Menu +- the text fields : the default for text fields +- the scret key field : the default for passwords (with * * * ) + +## Internal viewer + +The program will have an internal viewer that will be able to display the 2 kinds of stories (images and text). + +### Base viewer + +This is common to both of the viewer (this is **not** an architectural directives, I only speak about the concept here). + +![Base Viewer](screens/viewer.jpg) + +#### Header + +The title is the title of the story, shortened with "..." if too long. + +#### Content + +This area will host the text viewer or the image viewer. + +#### Navigator + +It contains 4 action buttons (first, previous, next and last chapter) and the title of the current chapter: + +- Descripton : for the properties page (same layout as the actual Properties page) +- Chapter X/Y: title : for the normal chapters (note that "Chapter X/Y" should be bold, and "X" should be coloured) + +#### UI + +Matrial.IO: + +- Header : Header +- Navigator : [Sheets bottom](https://material.io/design/components/sheets-bottom.html) + +### Text viewer + +![Text Viewer](screens/viewer-text.jpg) + +It will contain the content of the current chapter (Story.getChapters().get(index - 1)). + +Same layout as the Properties page uses for the resume, with just a small difference: the chapter name is now prefixed by "Chaper X: ". + +### Image viewer + +![Image Viewer](screens/viewer-image.jpg) + +#### Image + +Auto-zoom and fit (keep aspect ratio). + +#### Image counter + +Just display "Image X/Y" + +#### Handles + +This is a simple cue to show the user where to click. + +It can be hidden via the option "Show handles on image viewer" from the Options page. + +#### UI + +Pinch & Zoom should be allowed. + +Drag-to-pan should be allowed. + diff --git a/docs/android/screens/desc.jpg b/docs/android/screens/desc.jpg new file mode 100755 index 0000000..766b746 Binary files /dev/null and b/docs/android/screens/desc.jpg differ diff --git a/docs/android/screens/main_lib.jpg b/docs/android/screens/main_lib.jpg new file mode 100755 index 0000000..e105824 Binary files /dev/null and b/docs/android/screens/main_lib.jpg differ diff --git a/docs/android/screens/menu.jpg b/docs/android/screens/menu.jpg new file mode 100755 index 0000000..ea67163 Binary files /dev/null and b/docs/android/screens/menu.jpg differ diff --git a/docs/android/screens/navigation.jpg b/docs/android/screens/navigation.jpg new file mode 100755 index 0000000..997cb32 Binary files /dev/null and b/docs/android/screens/navigation.jpg differ diff --git a/docs/android/screens/options.jpg b/docs/android/screens/options.jpg new file mode 100755 index 0000000..b4ad836 Binary files /dev/null and b/docs/android/screens/options.jpg differ diff --git a/docs/android/screens/search.jpg b/docs/android/screens/search.jpg new file mode 100755 index 0000000..f32257e Binary files /dev/null and b/docs/android/screens/search.jpg differ diff --git a/docs/android/screens/viewer-image.jpg b/docs/android/screens/viewer-image.jpg new file mode 100755 index 0000000..8f5c742 Binary files /dev/null and b/docs/android/screens/viewer-image.jpg differ diff --git a/docs/android/screens/viewer-text.jpg b/docs/android/screens/viewer-text.jpg new file mode 100755 index 0000000..574f688 Binary files /dev/null and b/docs/android/screens/viewer-text.jpg differ diff --git a/docs/android/screens/viewer.jpg b/docs/android/screens/viewer.jpg new file mode 100755 index 0000000..d8b130a Binary files /dev/null and b/docs/android/screens/viewer.jpg differ diff --git a/fanfix.sysv b/fanfix.sysv new file mode 100755 index 0000000..5ab6912 --- /dev/null +++ b/fanfix.sysv @@ -0,0 +1,91 @@ +#!/bin/sh +# +# fanfix This starts the Fanfix remote service. +# +# description: Starts the Fanfix remote service +# +### BEGIN INIT INFO +# Default-Start: 3 4 5 +# Short-Description: Fanfix service +# Description: Starts the Fanfix remote service +### END INIT INFO + +ENABLED=true +USER=fanfix +JAR=/path/to/fanfix.jar + +FPID=/tmp/fanfix.pid +OUT=/var/log/fanfix +ERR=/var/log/fanfix.err + +if [ "$ENABLED" != true ]; then + [ "$1" != status ] + exit $? +fi + +if [ ! -e "$JAR" ]; then + echo "Canot find main jar file: $JAR" >&2 + exit 4 +fi + +case "$1" in +start) + if sh "$0" status --quiet; then + echo "Fanfix is already running." >&2 + false + else + [ -e "$OUT" ] && mv "$OUT" "$OUT".previous + [ -e "$ERR" ] && mv "$ERR" "$ERR".previous + sudo -u "$USER" -- java -jar "$JAR" --server > "$OUT" 2> "$ERR" & + echo $! > "$FPID" + fi + + sleep 0.1 + sh "$0" status --quiet +;; +stop) + if sh "$0" status --quiet; then + sudo -u "$USER" -- java -jar "$JAR" --stop-server + fi + + i=1 + while [ $i -lt 100 ]; do + if sh "$0" status --quiet; then + echo -n . >&2 + sleep 1 + fi + i=`expr $i + 1` + done + echo >&2 + + if sh "$0" status --quiet; then + echo "Process not responding, killing it..." >&2 + kill "`cat "$FPID"`" + sleep 10 + kill -9 "`cat "$FPID"`" 2>/dev/null + fi + + rm -f "$FPID" +;; +restart) + sh "$0" stop + sh "$0" start +;; +status) + if [ -e "$FPID" ]; then + if [ "$2" = "--quiet" ]; then + ps "`cat "$FPID"`" >/dev/null + else + ps "`cat "$FPID"`" >/dev/null \ + && echo service is running >&2 + fi + else + false + fi +;; +*) + echo $"Usage: $0 {start|stop|status|restart}" >&2 + false +;; +esac + diff --git a/icons/fanfix-alt.png b/icons/fanfix-alt.png new file mode 100644 index 0000000..4ab0957 Binary files /dev/null and b/icons/fanfix-alt.png differ diff --git a/icons/fanfix.png b/icons/fanfix.png new file mode 100644 index 0000000..983b344 Binary files /dev/null and b/icons/fanfix.png differ diff --git a/icons/mlpfim-icons.deviantart.com/janswer.deviantart.com/fanfix-d.png b/icons/mlpfim-icons.deviantart.com/janswer.deviantart.com/fanfix-d.png new file mode 100644 index 0000000..1798dd3 Binary files /dev/null and b/icons/mlpfim-icons.deviantart.com/janswer.deviantart.com/fanfix-d.png differ diff --git a/icons/mlpfim-icons.deviantart.com/laceofthemoon.deviantart.com/fanfix-e.png b/icons/mlpfim-icons.deviantart.com/laceofthemoon.deviantart.com/fanfix-e.png new file mode 100644 index 0000000..fb6fe0d Binary files /dev/null and b/icons/mlpfim-icons.deviantart.com/laceofthemoon.deviantart.com/fanfix-e.png differ diff --git a/icons/mlpfim-icons.deviantart.com/pink618.deviantart.com/fanfix-c.png b/icons/mlpfim-icons.deviantart.com/pink618.deviantart.com/fanfix-c.png new file mode 100644 index 0000000..a56a4d2 Binary files /dev/null and b/icons/mlpfim-icons.deviantart.com/pink618.deviantart.com/fanfix-c.png differ diff --git a/libs.txt b/libs.txt deleted file mode 100644 index 091daf5..0000000 --- a/libs.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Required librairies: - -They are available in the other branches if needed: -- libs/jsoup-1.10.3-sources.jar -- libs/unbescape-1.1.4-sources.jar - diff --git a/libs/JSON-java-20190722-sources.jar b/libs/JSON-java-20190722-sources.jar new file mode 100644 index 0000000..22a416d Binary files /dev/null and b/libs/JSON-java-20190722-sources.jar differ diff --git a/libs/jexer-0.0.4_README.md b/libs/jexer-0.0.4_README.md new file mode 100644 index 0000000..7cfe9b4 --- /dev/null +++ b/libs/jexer-0.0.4_README.md @@ -0,0 +1,220 @@ +Jexer - Java Text User Interface library +======================================== + +This library implements a text-based windowing system reminiscient of +Borland's [Turbo Vision](http://en.wikipedia.org/wiki/Turbo_Vision) +system. (For those wishing to use the actual C++ Turbo Vision +library, see [Sergio Sigala's C++ version based on the public domain +sources released by Borland.](http://tvision.sourceforge.net/) ) + +Jexer currently supports three backends: + +* System.in/out to a command-line ECMA-48 / ANSI X3.64 type terminal + (tested on Linux + xterm). I/O is handled through terminal escape + sequences generated by the library itself: ncurses is not required + or linked to. xterm mouse tracking using UTF8 and SGR coordinates + are supported. For the demo application, this is the default + backend on non-Windows/non-Mac platforms. + +* The same command-line ECMA-48 / ANSI X3.64 type terminal as above, + but to any general InputStream/OutputStream or Reader/Writer. See + the file jexer.demos.Demo2 for an example of running the demo over a + TCP socket. jexer.demos.Demo3 demonstrates how one might use a + character encoding than the default UTF-8. + +* Java Swing UI. This backend can be selected by setting + jexer.Swing=true. The default window size for Swing is 80x25, which + is set in jexer.session.SwingSession. For the demo application, + this is the default backend on Windows and Mac platforms. + +Additional backends can be created by subclassing +jexer.backend.Backend and passing it into the TApplication +constructor. + +The Jexer homepage, which includes additional information and binary +release downloads, is at: https://jexer.sourceforge.io . The Jexer +source code is hosted at: https://github.com/klamonte/jexer . + + + +License +------- + +This project is licensed under the MIT License. See the file LICENSE +for the full license text. + + + +Acknowledgements +---------------- + +Jexer makes use of the Terminus TrueType font [made available +here](http://files.ax86.net/terminus-ttf/) . + + + +Usage +----- + +Simply subclass TApplication and then run it in a new thread: + +```Java +import jexer.*; + +class MyApplication extends TApplication { + + public MyApplication() throws Exception { + super(BackendType.SWING); // Could also use BackendType.XTERM + + // Create standard menus for File and Window + addFileMenu(); + addWindowMenu(); + + // Add a custom window, see below for its code. + addWindow(new MyWindow(this)); + } + + public static void main(String [] args) { + try { + MyApplication app = new MyApplication(); + (new Thread(app)).start(); + } catch (Throwable t) { + t.printStackTrace(); + } + } +} +``` + +Similarly, subclass TWindow and add some widgets: + +```Java +class MyWindow extends TWindow { + + public MyWindow(TApplication application) { + // See TWindow's API for several constructors. This one uses the + // application, title, width, and height. Note that the window width + // and height include the borders. The widgets inside the window + // will see (0, 0) as the top-left corner inside the borders, + // i.e. what the window would see as (1, 1). + super(application, "My Window", 30, 20); + + // See TWidget's API for convenience methods to add various kinds of + // widgets. Note that ANY widget can be a container for other + // widgets: TRadioGroup for example has TRadioButtons as child + // widgets. + + // We will add a basic label, text entry field, and button. + addLabel("This is a label", 5, 3); + addField(5, 5, 20, false, "enter text here"); + // For the button, we will pop up a message box if the user presses + // it. + addButton("Press &Me!", 5, 8, new TAction() { + public void DO() { + MyWindow.this.messageBox("Box Title", "You pressed me, yay!"); + } + } ); + } +} +``` + +Put these into a file, compile it with jexer.jar in the classpath, run +it and you'll see an application like this: + +![The Example Code Above](/screenshots/readme_application.png?raw=true "The application in the text of README.md") + +See the files in jexer.demos for many more detailed examples showing +all of the existing UI controls. The demo can be run in three +different ways: + + * 'java -jar jexer.jar' . This will use System.in/out with + xterm-like sequences on non-Windows platforms. On Windows it will + use a Swing JFrame. + + * 'java -Djexer.Swing=true -jar jexer.jar' . This will always use + Swing on any platform. + + * 'java -cp jexer.jar jexer.demos.Demo2 PORT' (where PORT is a + number to run the TCP daemon on). This will use the telnet + protocol to establish an 8-bit clean channel and be aware of + screen size changes. + + + +More Screenshots +---------------- + +![Several Windows Open Including A Terminal](/screenshots/screenshot1.png?raw=true "Several Windows Open Including A Terminal") + +![Yo Dawg...](/screenshots/yodawg.png?raw=true "Yo Dawg, I heard you like text windowing systems, so I ran a text windowing system inside your text windowing system so you can have a terminal in your terminal.") + + + +System Properties +----------------- + +The following properties control features of Jexer: + + jexer.Swing + ----------- + + Used only by jexer.demos.Demo1. If true, use the Swing interface + for the demo application. Default: true on Windows platforms + (os.name starts with "Windows"), false on non-Windows platforms. + + jexer.Swing.cursorStyle + ----------------------- + + Used by jexer.io.SwingScreen. Selects the cursor style to draw. + Valid values are: underline, block, outline. Default: underline. + + + +Known Issues / Arbitrary Decisions +---------------------------------- + +Some arbitrary design decisions had to be made when either the +obviously expected behavior did not happen or when a specification was +ambiguous. This section describes such issues. + + - See jexer.tterminal.ECMA48 for more specifics of terminal + emulation limitations. + + - TTerminalWindow uses cmd.exe on Windows. Output will not be seen + until enter is pressed, due to cmd.exe's use of line-oriented + input (see the ENABLE_LINE_INPUT flag for GetConsoleMode() and + SetConsoleMode()). + + - TTerminalWindow launches 'script -fqe /dev/null' or 'script -q -F + /dev/null' on non-Windows platforms. This is a workaround for the + C library behavior of checking for a tty: script launches $SHELL + in a pseudo-tty. This works on Linux and Mac but might not on + other Posix-y platforms. + + - Closing a TTerminalWindow without exiting the process inside it + may result in a zombie 'script' process. + + - Java's InputStreamReader as used by the ECMA48 backend requires a + valid UTF-8 stream. The default X10 encoding for mouse + coordinates outside (160,94) can corrupt that stream, at best + putting garbage keyboard events in the input queue but at worst + causing the backend reader thread to throw an Exception and exit + and make the entire UI unusable. Mouse support therefore requires + a terminal that can deliver either UTF-8 coordinates (1005 mode) + or SGR coordinates (1006 mode). Most modern terminals can do + this. + + - jexer.session.TTYSession calls 'stty size' once every second to + check the current window size, performing the same function as + ioctl(TIOCGWINSZ) but without requiring a native library. + + - jexer.io.ECMA48Terminal calls 'stty' to perform the equivalent of + cfmakeraw() when using System.in/out. System.out is also + (blindly!) put in 'stty sane cooked' mode when exiting. + + + +Roadmap +------- + +Many tasks remain before calling this version 1.0. See docs/TODO.md +for the complete list of tasks. diff --git a/libs/jsoup-1.10.3-sources.jar b/libs/jsoup-1.10.3-sources.jar new file mode 100644 index 0000000..1fe0db4 Binary files /dev/null and b/libs/jsoup-1.10.3-sources.jar differ diff --git a/libs/licenses/JSON-java-20190722_LICENSE.txt b/libs/licenses/JSON-java-20190722_LICENSE.txt new file mode 100644 index 0000000..02ee0ef --- /dev/null +++ b/libs/licenses/JSON-java-20190722_LICENSE.txt @@ -0,0 +1,23 @@ +============================================================================ + +Copyright (c) 2002 JSON.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +The Software shall be used for Good, not Evil. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/libs/licenses/jexer-0.0.4_LICENSE.txt b/libs/licenses/jexer-0.0.4_LICENSE.txt new file mode 100644 index 0000000..09bbfe0 --- /dev/null +++ b/libs/licenses/jexer-0.0.4_LICENSE.txt @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2016 Kevin Lamonte + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/libs/licenses/unbescape-1.1.4_LICENSE.txt b/libs/licenses/unbescape-1.1.4_LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/libs/licenses/unbescape-1.1.4_LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/subtree.txt b/libs/subtree.txt similarity index 100% rename from subtree.txt rename to libs/subtree.txt diff --git a/libs/unbescape-1.1.4-sources.jar b/libs/unbescape-1.1.4-sources.jar new file mode 100644 index 0000000..01ddb56 Binary files /dev/null and b/libs/unbescape-1.1.4-sources.jar differ diff --git a/libs/unbescape-1.1.4_ChangeLog.txt b/libs/unbescape-1.1.4_ChangeLog.txt new file mode 100644 index 0000000..9cec6ec --- /dev/null +++ b/libs/unbescape-1.1.4_ChangeLog.txt @@ -0,0 +1,32 @@ +1.1.4.RELEASE +============= +- Added ampersand (&) to the list of characters to be escaped in LEVEL 1 for JSON, JavaScript and CSS literals + in order to make escaped code safe against code injection attacks in XHTML scenarios (browsers using XHTML + processing mode) performed by means of including XHTML escape codes in literals. + +1.1.3.RELEASE +============= +- Improved performance of String-based unescape methods for HTML, XML, JS, JSON and others when the + text to be unescaped actually needs no unescaping. + +1.1.2.RELEASE +============= +- Added support for stream-based (String-to-Writer and Reader-to-Writer) escape and unescape operations. + +1.1.1.RELEASE +============= +- Fixed HTML unescape for codepoints > U+10FFFF (was throwing IllegalArgumentException). +- Fixed HTML unescape for codepoints > Integer.MAX_VALUE (was throwing ArrayIndexOutOfBounds). +- Simplified and improved performance of codepoint-computing code by using Character.codePointAt(...) instead + of a complex conditional structure based on Character.isHighSurrogate(...) and Character.isLowSurrogate(...). +- [doc] Fixed description of MSExcel-compatible CSV files. + + +1.1.0.RELEASE +============= +- Added URI/URL escape and unescape operations. + + +1.0 +=== +- First release of unbescape. diff --git a/res/drawable-v24/ic_launcher_foreground.xml b/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..c7bd21d --- /dev/null +++ b/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/res/drawable/ic_launcher_background.xml b/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..01f0af0 --- /dev/null +++ b/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/layout/activity_main.xml b/res/layout/activity_main.xml new file mode 100644 index 0000000..e576892 --- /dev/null +++ b/res/layout/activity_main.xml @@ -0,0 +1,38 @@ + + + +