Component Reference
Reference to WSTR-specific Astro components
Using the components
Section titled “Using the components”To use these components, you need to:
- ensure your Markdown file uses the
.mdxextension - import the component(s) you want to use below the frontmatter section but before any other page content, using a declaration such as:
import Character from '/src/components/Character.astro';If your component content doesn’t show up on the rendered page, check it has the .mdx extension and that you’ve imported the component correctly.
Additional examples of using these components can be found in Component Coredata Examples.
Currently-recommended components
Section titled “Currently-recommended components”ArticlesList component
Section titled “ArticlesList component”Displays a list of articles associated with the given tag.
Required import
Section titled “Required import”import ArticlesList from '/src/components/ArticlesList.astro';Syntax
Section titled “Syntax”<ArticlesList [tag="..."] [subset="articlelibonly|topicsonly"] [header="..."] />| Property | Description |
|---|---|
| tag | optional tag to filter the articles listed |
| subset | optional subset of articles to display, either articlelibonly or topicsonly |
| header | optional header text to display above the list |
Unless subset is defined, the component lists contents from both the Article Library and Topic pages.
Example
Section titled “Example”Source
Section titled “Source”<ArticlesList tag="encoding" subset="articlelibonly" header="Encoding Articles" />Result
Section titled “Result”Encoding Articles
- Glyph Variant for open o - Description of glyph variants for the Latin character "open o" and their recommended use cases.
BibEntry component
Section titled “BibEntry component”Displays a single source in a format suitable for a formal bibliography. Used by the BibList component, but may also be used independently.
Required import
Section titled “Required import”import BibEntry from '/src/components/BibEntry.astro';Syntax
Section titled “Syntax”<BibEntry key="..." />| Property | Description |
|---|---|
| key | source record id in YAML file |
Example
Section titled “Example”Source
Section titled “Source”<BibEntry key="alone1946" />Result
Section titled “Result”BibList component
Section titled “BibList component”Displays a list of related sources in a format suitable for a formal bibliography.
Required import
Section titled “Required import”import BibList from '/src/components/BibList.astro';Syntax
Section titled “Syntax”<BibList tag="..." [header="..."] [entrytype="non-online|article|etc."]/>| Property | Description |
|---|---|
| tag | optional tag to filter the articles listed; all will display all items; if the tag is omitted nothing will be displayed |
| header | optional header text to display above the list |
| entrytype | type of sources to display; valid values are online, article, book, inbook, inproceedings, misc, non-online, all; defaults to all types |
Example
Section titled “Example”Source
Section titled “Source”<BibList tag='script-cham' header='Bibliography' entrytype='non-online' />Result
Section titled “Result”Bibliography
- Blood, Doris. “The ascendancy of the Cham script: how a literacy workshop became the catalyst”. International Journal of the Sociology of Language, vol. 2008, no. 192, 2008, pp. 45-55, http://dx.doi.org/10.1515/IJSL.2008.034.
- Brunelle, Marc. “Diglossia, Bilingualism, and the Revitalization of Written Eastern Cham”. 2008.
SourceLinksList
Section titled “SourceLinksList”Displays a list of related sources using an informal format.
Required import
Section titled “Required import”import SourceLinksList from '/src/components/SourceLinksList.astro';Syntax
Section titled “Syntax”<SourceLinksList tag="..." [header="..."] [entrytype="online|article|etc."]/>| Property | Description |
|---|---|
| tag | optional tag to filter the articles listed; ‘all’ will display all items; if the tag is omitted nothing will be displayed |
| header | optional header text to display above the list |
| entrytype | type of sources to display; valid values are online, article, book, inbook, inproceedings, misc, non-online, all; defaults to all types |
Example
Section titled “Example”Source
Section titled “Source”<SourceLinksList tag='script-gran' header='External Links' entrytype='online' />Result
Section titled “Result”External Links
- Grantha (ScriptSource)
- Grantha script (Wikipedia)
- Grantha Alphabet (Omniglot)
Character component
Section titled “Character component”Required import
Section titled “Required import”import Character from '/src/components/Character.astro';Syntax
Section titled “Syntax”<Character usv="XXXX"|char="a" [options="usv,char,name"]/>Note: Either usv or char must be provided.
| Property | Description |
|---|---|
| usv | The USV of the character to display |
| char | A literal character |
| options | A comma-separated list of options to display. Options are usv, char, and name. The default is all three. |
Inline examples
Section titled “Inline examples”This example uses the default options, where all three elements appear.
<Character usv="0634"/>Result: ش
This example uses just usv and char options:
<Character usv="0634" options="usv,char"/>Result: ش
List example
Section titled “List example”- ض
Combining marks
Section titled “Combining marks”Combining marks are automatically displayed with a dotted circle to indicate their combining nature.
<Character usv="0301"/>Result: ◌́
Directive syntax
Section titled “Directive syntax”:usv[XXXX]:char[a]:usv[XXXX]{usv char name}:char[a]{usv char name}These directives are able to work in both .md and .mdx files.
Please note the :char directive is a little more limited, and cannot accept any
whitespace, or certain meta characters without escaping \[, \{, or wrapping
in inline code quotes.
Astro processes directives after smart quote translation, so :char[']
produces U+2019 ’ RIGHT SINGLE QUOTATION MARK instead or the expected
U+0027 ' APOSTROPHE.
The following attributes are supported which correspond to the component’s options= attribute.
| Attribute | Description |
|---|---|
| usv | Display the USV |
| char | Display the character |
| name | Display the Unicode name |
No specified attributes displays all three by default
Inline examples
Section titled “Inline examples”This example uses the default options, where all three elements appear.
:usv[0634]Result: ش
This example uses just usv and char options:
:usv[0635]{usv char}Result: ص
This example shows the use of :char
:char[` `] and :char[@]{name char}Result: and @
List example
Section titled “List example”- ض
- $
Table example
Section titled “Table example”| USV | Char | Name | Phoneme |
|---|---|---|---|
| ب | /b/ | ||
| س | /s/ | ||
| ش | /ʃ/ | ||
| م | /m/ |
Components in development
Section titled “Components in development”CharacterTable component
Section titled “CharacterTable component”Required import
Section titled “Required import”import CharacterTable from '/src/components/CharacterTable.astro';Syntax
Section titled “Syntax”<CharacterTable startUsv="XXXX" endUsv="XXXX" [caption="..."]/>| Property | Description |
|---|---|
| startUsv | The Unicode scalar value of the first character to display |
| endUsv | The Unicode scalar value of the last character to display |
| caption | The caption to display below the table |
Examples
Section titled “Examples”Source
Section titled “Source”<CharacterTable startUsv = "0627" endUsv = "0632" caption = "Arabic characters 0627-0632"/>Result
Section titled “Result”| USV | Char | Unicode Character Name |
|---|---|---|
| U+0627 | ا | ARABIC LETTER ALEF |
| U+0628 | ب | ARABIC LETTER BEH |
| U+0629 | ة | ARABIC LETTER TEH MARBUTA |
| U+062A | ت | ARABIC LETTER TEH |
| U+062B | ث | ARABIC LETTER THEH |
| U+062C | ج | ARABIC LETTER JEEM |
| U+062D | ح | ARABIC LETTER HAH |
| U+062E | خ | ARABIC LETTER KHAH |
| U+062F | د | ARABIC LETTER DAL |
| U+0630 | ذ | ARABIC LETTER THAL |
| U+0631 | ر | ARABIC LETTER REH |
| U+0632 | ز | ARABIC LETTER ZAIN |