Commit 5dedb8d0 authored by Nicolas Peifer's avatar Nicolas Peifer

fixing readme markup

parent a2fa5364
......@@ -3,7 +3,7 @@ GutenbergUtils is a command-line tool which extracts book information from [Proj
- License: DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
- Source language: Java (runs great on Java 8 and 11 JVMs)
##Command-line interface
## Command-line interface
**--parse-rdf RDF_DIR DATABASE_FILE**
Parses all RDF files in the given directory and its subdirectories and stores the gained book information in the specified DATABASE_FILE. **Note**: Please use absolute paths.
......@@ -12,7 +12,7 @@ Creates HTML pages which list the books alphabetically by author (including an i
Furthermore, in order to elude copyright issues, the books are filtered automatically according to EU copyright laws so that the resulting HTML pages do NOT contain any copyrighted books.
##How to use GutenbergUtils
## How to use GutenbergUtils
### Prerequisites
1. Install Java (e. g. Java 8 or 11 will work).
2. Download the archive which contains one RDF/XML file for each book that is listed on Project Gutenberg. Go to [The Complete Project Gutenberg Catalog](https://www.gutenberg.org/wiki/Gutenberg:Feeds#The_Complete_Project_Gutenberg_Catalog) and choose one file (BZip2 or Zip). The BZip2 file is approx. 45 MB huge. It's probably a good idea to download the file from one of the mirrors when your IP is blocked, e. g. [http://gutenberg.readingroo.ms/cache/generated/feeds/rdf-files.tar.bz2](http://gutenberg.readingroo.ms/cache/generated/feeds/rdf-files.tar.bz2).
......@@ -35,9 +35,9 @@ Please make sure you have read the section about the command-line interface abov
2. At first, we will extract the meta informations about the books from the RDF/XML files and store them in a database file:
> java -cp gutenberg-utils-1.0.0.jar:/home/USER_X/.m2/repository/com/h2database/h2/1.4.197/h2-1.4.197.jar org.codecoop.iceflower.gutenbergutils.Start --parse-rdf "RDF_DIR" "DATABASE_FILE"
Please replace "USER_X" with your local user name "RDF_DIR" with the folder where the extracted RDF/XML lie and replace "DATABASE_FILE" with an arbitrary filename (the file-based database will be created automatically).
Please replace "USER_X" with your local user name "RDF_DIR" with the folder where the extracted RDF/XML lie and replace "DATABASE_FILE" with an arbitrary filename (the file-based database will be created automatically).
3. In the second step, we will use the database to create static HTML pages which will list the books in a clear way. The listing will contain several download links for each book which point to an existing mirror where you can actually download the book in different formats.
> java -cp gutenberg-utils-1.0.0.jar:/home/USER_X/.m2/repository/com/h2database/h2/1.4.197/h2-1.4.197.jar org.codecoop.iceflower.gutenbergutils.Start --create-html "TEMPLATE_DIR" "DATABASE_FILE" "OUTPUT_DIR" [LANGUAGE]
Please replace "USER_X" with your local user name and replace "TEMPLATE_DIR" with the path to "GutenbergUtils/config/" and replace DATABASE_FILE with the path to the database which was created in the previous step and replace "OUTPUT_DIR" with an empty folder. The language parameter (e. g. "en", "fr" or "es") is optional. If you specify it, the HTML pages will only contain books in that particular language (language filter).
Please replace "USER_X" with your local user name and replace "TEMPLATE_DIR" with the path to "GutenbergUtils/config/" and replace DATABASE_FILE with the path to the database which was created in the previous step and replace "OUTPUT_DIR" with an empty folder. The language parameter (e. g. "en", "fr" or "es") is optional. If you specify it, the HTML pages will only contain books in that particular language (language filter).
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment