Gildas Lormeau 4833a04d12 added example %!s(int64=7) %!d(string=hai) anos
..
back-ends e53124191e rollback %!s(int64=7) %!d(string=hai) anos
README.MD 4833a04d12 added example %!s(int64=7) %!d(string=hai) anos
package.json 5e7e3fad16 removed obsolete dependencies %!s(int64=7) %!d(string=hai) anos
single-file.js a0adb261ad fiexed option type %!s(int64=7) %!d(string=hai) anos

README.MD

SingleFile (MAFF to HTML)

Introduction

SingleFile can be launched from the command line to convert MAFF files into HTML files by running it into Firefox. It runs through Node.js as a standalone script injected into the web page instead of being embedded into a WebExtension. To connect to Firefox, it uses Selenium WebDriver.

Convert MAFF to HTML

Prerequisites

  • Node.js must be installed.
  • You must also install Firefox version 56.0.2 and Mozilla geckodriver version 0.20.1.
  • It is recommended that the Firefox binary can be found through the PATH environment variable or the maff2html folder. Otherwise you will need to set the --browser-executable-path option..
  • It is also recommended that the Mozilla geckodriver binary can be found through the PATH environment variable or the maff2html folder. Otherwise you will need to set the --web-driver-executable-path option.

Install

$ unzip master.zip .

  • Go into the maff2html directory.

$ cd maff2html

  • Install dependencies with npm (installed with Node.js).

$ npm install

  • Make single-file.js executable (Linux/Unix/BSD etc.).

$ chmod +x single-file.js

Run

  • Syntax

$ ./single-file.js <url> [output] [options ...] (Linux/Unix/BSD etc.)

> node single-file.js <url> [output] [options ...] (Windows)

  • Display help

$ ./single-file.js --help (Linux/Unix/BSD etc.)

> node single-file.js --help (Windows)

  • Examples

    • Convert wikipedia.maff (located in the user directory) into wikipedia.html

$ ./single-file.js file:///home/gildas/wikipedia.maff wikipedia.html (Linux/Unix/BSD etc.)

> node single-file.js file:///C:/Users/Gildas/wikipedia.maff wikipedia.html (Windows)

  • Convert wikipedia.maff (located in the user directory) into wikipedia.html with Firefox installed in the folder "~/firefox-56.0.2/" (Linux/Unix/BSD etc.) or "C:\Program Files\Mozilla Firefox 56.0.2\" (Windows)

$ ./single-file.js file:///home/gildas/wikipedia.maff wikipedia.html --browser-executable-path=~/firefox-56.0.2/firefox (Linux/Unix/BSD etc.)

> node single-file.js file:///C:/Users/Gildas/wikipedia.maff wikipedia.html --browser-executable-path="C:\Program Files\Mozilla Firefox 56.0.2\firefox" (Windows)

License

SingleFile is licensed under AGPL and GPL. Code derived from third-party projects is licensed under MIT. Please contact me at gildas.lormeau <at> gmail.com if you are interested in licensing the SingleFile code for a commercial service or product.