Module:Chapter/doc
< Module:Chapter
Revision as of 12:56, 27 January 2024 by Deltaneos (talk | contribs) (Live version of Template:Chapter is using this module now. Mention new arc attributes)
This is a documentation subpage for Module:Chapter. It contains usage information, categories and other content that is not part of the original module page. |
Module:Chapter is used for looking up and formatting information on manga chapters.
It is implemented by Template:Chapter and Template:Images by chapter category.
Table data[edit]
The module returns a table, referred to as a Chapter
table in this documentation. It has the following attributes:
- pageName
- The chapter's page name on this site
- seriesLink
- The chapter's series' page name on this site
- seriesName
- The name of the chapter's series
- subseries
- The name of the chapter's subseries (Yu-Gi-Oh! Duelist or Yu-Gi-Oh! Millennium World for relevant chapters of the original Yu-Gi-Oh!)
- arcLink
- The page name of the chapter's arc, if applicable
- arcName
- The name of the chapter's arc, if applicable
- number
- The chapter's number in the series
- subseriesNumber
- The chapter's number in the subseries, if applicable
- chapterWord
- The word used to describe chapters in the series e.g. "Duel" for Yu-Gi-Oh!, "Rank" for Yu-Gi-Oh! ZEXAL, etc. Special chapters may have their own chapter word.
- isSpecial
- If the chapter is a special chapter (one that doesn't follow the standard numbering)
- name
- The English name of the chapter
Table methods[edit]
- Chapter:new(args)
- Look up chapter information for the supplied arguments and return them as an instance of the
Chapter
table. - Arguments may be the series name and chapter number e.g.
{ series = 'Yu-Gi-Oh! GX', number = 5 }
or the page name e.g.{ page = 'Summon the Dark Ruler!!' }
- Chapter:formatAsName()
- Format the instance of the Chapter table as its English name. The name will link to the chapter's page and be enclosed in quotes.
- Chapter:formatAsNumber()
- Format the instance of the Chapter table as its chapter number, if it has one. The number will link to the chapter's page.
- Chapter:formatAsRef()
- Format the instance of the Chapter table as its name in reference format.
- Chapter:getImageCategoryName()
- Get the name that should be used for the category containing images for the chapter
- Chapter:formatImageCategoryNavLink
- Format the instance of the Chapter tale as a link to its image category as the link should be formatted in previous/next links in such a category's navigation menu
- Chapter:getPrev(prev)
- Get the previous chapter in the series as an instance of the
Chapter
table - If the
prev
param is unused, this will automatically get the previous numbered chapter in the series. - If
prev
is a number, this will look up details for the chapter in the same series of that number. - If
prev
is used and not a number, this will look up details for the chapter whose page name matches the value. - Chapter:getNext(next)
- Get the next chapter in the series as an instance of the
Chapter
table - If the
next
param is unused, this will automatically get the next numbered chapter in the series. - If
next
is a number, this will look up details for the chapter in the same series of that number. - If
next
is used and not a number, this will look up details for the chapter whose page name matches the value.
Template methods[edit]
These methods are meant to be invoked by templates whose parameters will be passed into them.
- Chapter.chapter(frame)
- Render a link to a chapter, with various formatting options. See Template:Chapter for more details.
- Chapter.imageCategory(frame)
- Render the page content for a category for images from a given chapter. See Template:Images by chapter category for more details.