Also known as WSexport, Wikisource:WSexport, Wikisource:WS Export, Wikisource Book Export, Wikisource Export
Wikisource tool
WS Export is a tool for exporting Wikisource books to many formats, such as EPUB or PDF. For more information, see the following links: PHP 7.3 or above Composer The fc-list command The following fonts (optional, but required for development): fonts-freefont-ttf fonts-linuxlibertine fonts-dejavu-core fonts-gubbi fonts-opendyslexic This section deals with a full installation of WS Export on the local development machine. For Docker installation instructions, see below. A few PHP extensions are required; if these are not installed, Composer will let you know and you will need to install them with your operating system's package manager. For example, in Debian-based Linux distributions: Edit .env.local and set APP ENV=dev and APP SECRET to a random string of your choice. 4. Open your web browser to e.g. and the basic operations should be working with the following limitations: you can only export to EPUB format; and you must check the 'Exclude credits' option, to avoid querying the database for usernames. Calibre: In order to export to PDF, plain text, RTF, or Mobi formats you must install Calibre so that the tool can use the ebook-convert command. epubcheck: To validate exported ebooks (with the ./bin/console app:check command), you must install epubcheck. If it is installed at a location other than /usr/bin/epubcheck , then set the EPUBCHECK JAR environment variable to the correct path. Fonts: To run the integration tests, also install the fonts-linuxlibertine package. You can also install any other fonts you want to use for exporting books. 6. WS Export uses two database connections: firstly, to its own database to store download statistics; and secondly, it connects to the Wikimedia database replicas to fetch information about Wikisource contributors for the credits list that can be included at the end of exported books. For the statistics recording database you need to create the database and add connection details to .env.local : 8. To connect to the Wikimedia replicas, this tool uses the Toolforge Bundle, and connects to multiple databases. Set the replicas' credentials in your .env.local file according to the Bundle's documentation. Run epubcheck on books. With no options set, this will check 10 random books from English Wikisource. Note that the random 10 will be cached (for repeatability) unless you use --nocache . You only need to run the first command once, and the second one only when new migrations are created. Wikisource export can also be run for development using Docker Compose. (beta, only tested on linux) The default environment provides PHP, Apache, Calibre, Epubcheck and a MariaDB database. Modify or create .env.local . This config uses the database container defaults. Do the same for the test database at .env.test.local , but giving a different database name: Run the following command to add your user ID and group ID to your .env file: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . The PNG version in resources/Wikisource-logo.svg.png is the Commons auto-generated 160px raster version of the (original, non-optimized) SVG file.
Excerpt from the source-code README · 10,199 chars · not written by Vinony
via Wikidata · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).