MCPcopy
hub / github.com/Splidejs/splide / buildHtml

Function buildHtml

src/js/test/fixtures/html.ts:27–55  ·  view source on GitHub ↗
( args: BuildHtmlArgs = {} )

Source from the content-addressed store, hash-verified

25 * @return A built HTML.
26 */
27export function buildHtml( args: BuildHtmlArgs = {} ): string {
28 const {
29 tag = 'div',
30 id,
31 length = 10,
32 arrows,
33 progress,
34 autoplay,
35 src = true,
36 dataSrc,
37 dataSrcset,
38 dataInterval,
39 json,
40 } = args;
41
42 return `
43<${ tag } class="splide"${ id ? ` id=${ id }` : '' }${ json ? ` data-splide='${ json }'` : '' }>
44 <div class="splide__track">
45 <ul class="splide__list">
46 ${ generateSlides( length, src, dataSrc, dataSrcset, dataInterval ) }
47 </ul>
48 </div>
49
50 ${ arrows ? HTML_ARROWS : '' }
51 ${ progress ? HTML_PROGRESS : '' }
52 ${ autoplay ? HTML_AUTOPLAY : '' }
53</${ tag }>
54`;
55}
56
57/**
58 * Generates slides.

Callers 2

attributes.test.tsFile · 0.90
initFunction · 0.90

Calls 1

generateSlidesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…