getodk / build2xlsform

service to convert odkbuild-form json to xlsform-compliant xlsx.
Other
2 stars 8 forks source link

⚠️ ODK Build is no longer being updated. Please use XLSForm instead. ⚠️

build2xlsform

docker

introduction

build2xlsform is a simple library and webservice that takes ODK Build form data and converts it to XLSForm-compatible XLSX files. It supports all features in ODK Build and is actively maintained to keep it such. In minor instances, this exceeds XLSForm's own expressivity of XForms features, and in such cases we export lossy information and leave a message in a 'Warnings' spreadsheet. It is currently actively deployed on the production Build instance.

compilation

The project depends on nodejs; we officially support version 16. Make sure you have node and npm correctly installed for your platform.

Once you have that, you should be able to simply make to trigger a build. The Makefile handles running npm install, but if you into issues performing that step on your own is a good troubleshooting start.

running

Run node lib/server.js to run the build2xlsform service. It runs on port 8686 by default, and on this port the development version of ODK Build will automatically proxy requests through to the service.

project

All the relevant code is in /src. There are only two files:

Tests are located in /spec/src. Each test file has some notes at the top indicating how it's organized. You can run the tests with make test. This will also recompile any main project files you may have changed.

about livescript

Livescript is a language that largely resembles and compiles down to Javascript. For the most part it should be very readable to any coder; here are a few tips to avoid stumbling:

integration with odkbuild

The Build webapp expects to be able to find this service when it POSTs to /convert. On the production Build instance in Apache, we accomplish this by capturing <Location /convert> and using ProxyPass to forward the request on to an instance of build2xlsform running on a local port.

contributing

Please submit pull requests for any code you'd like to push. As you do so, please keep in mind:

license

Apache 2.0