66 */
77
88import { addId , getIntlData , norm , xmlEscape } from "./utils.js" ;
9+ import { biblio } from "./biblio.js" ;
910import css from "../styles/dfn-index.css.js" ;
1011import { getTermFromElement } from "./xref.js" ;
1112import { html } from "./import-maps.js" ;
@@ -21,48 +22,56 @@ const localizationStrings = {
2122 headingExternal : "Terms defined by reference" ,
2223 headingLocal : "Terms defined by this specification" ,
2324 dfnOf : "definition of" ,
25+ definesFollowing : "defines the following:" ,
2426 } ,
2527 cs : {
2628 heading : "Glosář" ,
2729 headingExternal : "Termíny definované odkazem" ,
2830 headingLocal : "Termíny definované touto specifikací" ,
2931 dfnOf : "definice" ,
32+ definesFollowing : "definuje následující:" ,
3033 } ,
3134 de : {
3235 heading : "Index" ,
3336 headingExternal : "Begriffe, die durch Verweis definiert sind" ,
3437 headingLocal : "Begriffe, die in dieser Spezifikation definiert sind" ,
3538 dfnOf : "Definition von" ,
39+ definesFollowing : "definiert Folgendes:" ,
3640 } ,
3741 es : {
3842 heading : "Índice" ,
3943 headingExternal : "Términos definidos por referencia" ,
4044 headingLocal : "Términos definidos por esta especificación" ,
4145 dfnOf : "definición de" ,
46+ definesFollowing : "define lo siguiente:" ,
4247 } ,
4348 ja : {
4449 heading : "索引" ,
4550 headingExternal : "参照によって定義された用語" ,
4651 headingLocal : "この仕様で定義された用語" ,
4752 dfnOf : "の定義" ,
53+ definesFollowing : "以下を定義します:" ,
4854 } ,
4955 ko : {
5056 heading : "색인" ,
5157 headingExternal : "참조로 정의된 용어" ,
5258 headingLocal : "이 명세서에서 정의된 용어" ,
5359 dfnOf : "정의" ,
60+ definesFollowing : "다음을 정의합니다:" ,
5461 } ,
5562 nl : {
5663 heading : "Index" ,
5764 headingExternal : "Termen gedefinieerd door verwijzing" ,
5865 headingLocal : "Termen gedefinieerd door deze specificatie" ,
5966 dfnOf : "definitie van" ,
67+ definesFollowing : "definieert het volgende:" ,
6068 } ,
6169 zh : {
6270 heading : "索引" ,
6371 headingExternal : "通过引用定义的术语" ,
6472 headingLocal : "由本规范定义的术语" ,
6573 dfnOf : "的定义" ,
74+ definesFollowing : "定义以下内容:" ,
6675 } ,
6776} ;
6877const l10n = getIntlData ( localizationStrings ) ;
@@ -283,10 +292,21 @@ function createExternalTermIndex() {
283292 const dataSortedBySpec = [ ...data . entries ( ) ] . sort ( ( [ specA ] , [ specB ] ) =>
284293 specA . localeCompare ( specB )
285294 ) ;
295+ const indexSection = document . querySelector ( "section#index" ) ;
296+ const useFullTitle = ! ! indexSection ?. classList . contains (
297+ "prefer-full-spec-title"
298+ ) ;
286299 return html `< ul class ="index ">
287300 ${ dataSortedBySpec . map ( ( [ spec , entries ] ) => {
301+ let citationElement ;
302+ if ( useFullTitle && biblio [ spec ] ?. title ) {
303+ citationElement = renderInlineCitation ( spec , biblio [ spec ] . title ) ;
304+ } else {
305+ citationElement = renderInlineCitation ( spec ) ;
306+ }
307+
288308 return html `< li data-spec ="${ spec } ">
289- ${ renderInlineCitation ( spec ) } defines the following:
309+ ${ citationElement } ${ l10n . definesFollowing }
290310 < ul >
291311 ${ entries
292312 . sort ( ( a , b ) => a . term . localeCompare ( b . term ) )
0 commit comments