Copy articles.min.js
or artciles.js
(former should be preferred for most users) into story JavaScript or equivalent.
<<a word>>
<<an word>>
Adds the appropriate indefinite article to the indicated word.
- Arguments:
word
: any word or group of words
<<A word>>
<<An word>>
Adds the appropriate indefinite article to the indicated word, capitalizing the resulting string.
- Arguments:
word
any word or group of words
Examples:
<<a 'box'>> /* a box */
<<an 'painting'>> /* a painting */
<<an 'organge'>> /* an organge */
<<A 'evil'>> /* An evil */
<<An 'UFO'>> /* A UFO */
<<A 'honor'>> /* An honor */
<<setarticle article word [caseSensitive]>>
Overides the indicated word or words with the indicated article, optionally doing so in a case sensitive way.
Warning: Article overrides need to be defined in StoryInit (or in JavaScript via the API). Failing to do so will cause an error.
- Arguments:
article
: must be'a'
or'an'
; the article this word or group of words should use.word
: a word or group of words to set the article forcasesensitive
: iftrue
or truthy, the override only works on strings with an exact case match.
Examples:
<<setarticle 'a' 'US' true>>
<<a 'US'>> citizen /* a US citizen */
<<a 'us'>>-vs-them situation /* an us-vs-them situation */
// getting article strings
setup.articles.run('pen') // -> 'a pen'
setup.articles.run('apple', true) // -> 'An apple'
// overrides
setup.articles.override('a', 'US', true);
Should break the words up and get the first one so irregular phrases work, eg
honest man
.