diff --git a/README.md b/README.md index b5c17ec..39df98b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ $ npm install -g c3t-pad Once installed, you can get the most recent schedule and turn it into Etherpad files: ```sh -$ curl https://events.ccc.de/congress/2016/Fahrplan/schedule.xml | c3t-pad +$ curl https://events.ccc.de/congress/2017/Fahrplan/schedule.xml | c3t-pad ``` Of course, the XML doesn't have to come from curl; you can just as well pipe in a local file. diff --git a/index.js b/index.js index 4d9a183..77a40e9 100755 --- a/index.js +++ b/index.js @@ -16,7 +16,7 @@ const program = require('commander'); function logExamples() { console.log(' Examples:'); console.log(''); - console.log(' $ curl https://events.ccc.de/congress/2016/Fahrplan/schedule.xml | c3t-pad'); + console.log(' $ curl https://events.ccc.de/congress/2017/Fahrplan/schedule.xml | c3t-pad'); console.log(' $ c3t-pad -o myoutdir/ < schedule.xml'); console.log(''); } @@ -35,7 +35,7 @@ if (process.stdin.isTTY) { streamToPromise(process.stdin) .then(parse) - .then(({ title, version, days, acronym }) => { + .then(({ title, version, days, acronym, baseUrl }) => { // Find the most common event type. // It will get ignored in the template (this is useful because // nearly all events at CCC are set to "lecture"). @@ -47,7 +47,7 @@ streamToPromise(process.stdin) .maxBy(1)[0]; // Initialise the template - const dayTemplate = Template({ ignoreEventTypes: [ mostCommonEventType ], title, version, acronym }); + const dayTemplate = Template({ ignoreEventTypes: [ mostCommonEventType ], title, version, acronym, baseUrl }); try { fs.mkdirSync(program.outputDir); diff --git a/lib/parse.js b/lib/parse.js index 2844216..b12e477 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -8,6 +8,7 @@ module.exports = function parse(xml) { const version = $('schedule version').text(); const title = $('conference title').text(); const acronym = $('conference acronym').text(); + const baseUrl = $('conference base_url').text(); const days = $('day').map((i, day) => { const $day = $(day); @@ -58,5 +59,5 @@ module.exports = function parse(xml) { } }).get(); - return { days, title, version, acronym }; + return { days, title, version, acronym, baseUrl }; } diff --git a/lib/template.js b/lib/template.js index 1d2af0b..8f68e68 100644 --- a/lib/template.js +++ b/lib/template.js @@ -44,8 +44,8 @@ module.exports = function Template(options) { const type = o.ignoreEventTypes.includes(event.type) ? '' : ` (${_.upperFirst(event.type)})`; const targetLanguages = ({ - en: '→ de ', - de: '→ en ', + en: '→ de: ', + de: '→ en: ', })[language] || '→ '; // Yes, this is awful HTML, but its only job is to be parsed by EtherPad, @@ -55,7 +55,7 @@ module.exports = function Template(options) { [${language}] ${start} +${duration}, ${room}
${title}${type}
${speakers}
- Fahrplan: https://fahrplan.events.ccc.de/congress/2016/Fahrplan/events/${id}.html
+ Fahrplan: ${options.baseUrl}events/${id}.html
Slides (if available): https://speakers.c3lingo.org/talks/${guid}/
${targetLanguages}

diff --git a/package.json b/package.json index 652d440..6ff825c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "c3t-pad", - "version": "0.2.0", + "version": "0.2.1", "description": "Convert Chaos Communication Congress schedule into pads for the translation team", "main": "index.js", "scripts": {