Skip to content

Commit

Permalink
more templates
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Oct 16, 2023
1 parent 8a87a33 commit da149b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scratch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import wtf from './src/index.js'
console.log('start')

let str = `before {{literal translation|a|b}} after
let str = `before {{lit|a|b}} after
`

Expand Down
1 change: 1 addition & 0 deletions src/template/custom/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ let multi = {
'station link': ['amtk', 'cta', 'bts', 'mnrr', 'mtams', 'munis', 'njts', 'scax', 'wmata', 'rwsa'],
'video game release': ['vgrelease', 'video game release hlist', 'vgrtbl', 'vgrelease hlist', 'vgrh'],
aka: ['a.k.a.', 'also known as'],
'literal translation': ['lit', 'literal', 'literally'],
}

// - other languages -
Expand Down
12 changes: 12 additions & 0 deletions src/template/custom/text-only/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ export default {
return arr.join(', ')
},

// not perfect - https://en.m.wikipedia.org/wiki/Template:Interlinear
interlinear: (tmpl) => {
let arr = parse(tmpl).list || []
return arr.join('\n\n')
},

//actually rendering these links removes the text.
//https://en.wikipedia.org/wiki/Template:Catlist
catlist: (tmpl) => {
Expand Down Expand Up @@ -729,4 +735,10 @@ export default {
}
return ''
},

'literal translation': (tmpl) => {
let arr = parse(tmpl).list || []
arr = arr.map((str) => `'${str}'`)
return 'lit. ' + arr.join(' or ')
},
}

0 comments on commit da149b7

Please sign in to comment.