Problem
: We are using Excel to coordinate and plan a list of events. When the planning is done we would like to move these events into Events in WordPress.
Solution
: Plan in excel, run this application and generate a CVS file that can be important into the WordPress Events module (quite easily)
- The Excel file need to be using XLSX format
- Clone this repository
- Do
npm install
- Read the configuration section in this document
- Update the configuration file in
./config/config.js
- Do
node app --help
to get started
Getting help
node app --help
Running a basic conversion
node app --xlsx <excelfilename.xlsx>
- --help
gives help
- --xlsx xlsxfilname
specify which Excelfile to read. Overrides whats defined in the configuration file
- --csv csvfilename
If used, file to save csv export. If not used, csv is not written to file. Overrides whats defined in configuration file
Configuration is stored in the ./config.config.js
file in two sections
excelFileName
, filename for excelfile to be convertedcsvFileName
, filename for csv to be written with converted results
Using the --xlsx and --csv command line options will override any settings in the exporter section.
eventSheetName
, name of the sheet containing eventseventRange
, the range in which to search for eventseventColCheck
: the column to check for an event. If this column is empty for a row, the event is not included.eventStartDateCol
, the column holding event start dateeventStartTimeCol
, the column holding event start timeeventNameCol
, the column holding event nameeventDescCol
, the column holding event descriptioneventLocationCol
, the column holding event location. Must be a valid existing event location in WordPress.eventShowMapLinkCol
, the column holding show link to map on event (TRUE, FALSE)eventTimeZone
, A valid time zone for all events.
Default values are defined in the configuration file as well as in the app code. Columns, and rows, start on 0.
- Linting of code:
npm run lint
- Running tests:
npm test
Image name we give is gwpcsv. Remember to update the config file according to your Excel file definition prior to building.
docker build -t gwpcsv .
Example:
Notice the volume where the app expects to read xlsx files
docker run --rm --name gwpcsv -v $PWD:/usr/src/app gwpcsv --xlsx ./(xlsx file)
Using the --csv (filename) to export will work fine. Provide a filename relative to the volume you mounted to Docker run.