Template:LiteraryForm: Difference between revisions

From Wikisum
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#switch: {{{1|}}}
<includeonly>{{#switch: {{lc:{{{1|}}}}}
| short story = {{#switch: {{{2|}}}
| short story = {{#switch: {{{2|}}}
     | title = a short story
     | title_article = a Short Story
     | Title = a Short Story
     | title_no_article = Short Story
     | plural = short stories
     | plural = short stories
    | #default = a short story
   }}
   }}
| essay = {{#switch: {{{2|}}}
| essay = {{#switch: {{{2|}}}
     | title = an essay
     | title_article = an Essay
     | Title = an Essay
     | title_no_article = Essay
     | plural = essays
     | plural = essays
    | #default = an essay
   }}
   }}
| #default = {{#ifeq: {{{2|}}}|plural|books|a book}}
| novel = {{#switch: {{{2|}}}
}}</includeonly><noinclude>
    | title_article = a Novel
This template takes a user input literary form and the format expected (for title or for categories) and returns the corresponding value or nothing if the genre is not in the table.
    | title_no_article = Novel
 
    | plural = novels
Usage:
  }}
{{LiteraryForm|user input|format}}
| play = {{#switch: {{{2|}}}
 
    | title_article = a Play
Example:
    | title_no_article = Play
{{LiteraryForm|short story|Title}} will return "a Short Story"
    | plural = plays
{{LiteraryForm|essay|plural}} will return "essays"
  }}
</noinclude>
| poem = {{#switch: {{{2|}}}
    | title_article = a Poem
    | title_no_article = Poem
    | plural = poems
  }}
| fairy tale = {{#switch: {{{2|}}}
    | title_article = a Fairy Tale
    | title_no_article = Fairy Tale
    | plural = fairy tales
  }}
| fable = {{#switch: {{{2|}}}
    | title_article = a Fable
    | title_no_article = Fable
    | plural = fables
  }}
| short story collection = {{#switch: {{{2|}}}
    | title_article = a Collection of Short Stories
    | title_no_article = Collection of Short Stories
    | plural = short story collections
  }}
}}</includeonly>

Latest revision as of 19:45, 27 May 2023