wikipedia-entry-blockquote-inside.tmpl
This template generates the HTML structure for displaying Wikipedia article excerpts in popups and transclusions.
Read this when Use this page when tracing the HTML/Pandoc templates and include fragments that shape rendered gwern.net pages around wikipedia-entry-blockquote-inside.tmpl.
Overview
This template generates the HTML structure for displaying Wikipedia article excerpts in popups and transclusions. The "inside" designation (in contrast to the "outside" naming used by e.g. the annotation/tweet template families) means the <blockquote> element wraps only the entry content itself, not the entire container. The article title remains outside the blockquote, positioned above it as a separate <p> element with a colon suffix. This is the default template registered in content.js's wikipediaEntry content type, used for ordinary transclusions/embeds (the -not variant is used for pop-frames, and -title-not for annotation file includes).
This layout choice emphasizes the distinction between the title (metadata/attribution) and the quoted excerpt (content). It's semantically appropriate when you want the title to introduce the quotation rather than be part of it. The template also supports optional thumbnail images through conditional logic, which are placed inside the blockquote with the content.
The template is filled entirely client-side: content.js fetches the article extract in the browser from the Wikipedia REST API, and the template — bundled from template/include/ into transclude-templates-GENERATED.js by build/build_unified_assets.php — is populated by the JavaScript transclude template system and displayed by extracts.js. (The Haskell Annotation.hs only derives a title from Wikipedia URLs; it does not scrape article content.)
Template Variables
contentTypeClass- CSS class for content type styling (e.g.,content-transform-wikipedia)titleLine- The Wikipedia article titlethumbnailFigure- Optional<figure>element containing the Wikipedia article's thumbnail imageentryContent- The main excerpt/summary content from the Wikipedia article
Output Structure
The template produces this conditional structure:
<div class="content-transform [type-class]">
<p class="data-field title">[title]:</p>
<blockquote class="data-field entry-content">
<!-- If thumbnail exists: -->
<figure>[thumbnail]</figure>
<!-- Always: -->
[entry content]
</blockquote>
</div>
The title appears as an introduction with a colon, followed by a blockquote containing the optional thumbnail and the article excerpt. The <[IF thumbnailFigure]> conditional syntax is processed during template rendering to include or omit the thumbnail.
See Also
- wikipedia-entry-blockquote-not.tmpl - Variant without blockquote wrapper
- wikipedia-entry-blockquote-title-not.tmpl - Variant with blockquote but no title
- annotation-blockquote-not.tmpl - Similar pattern for general annotations
- Annotation.hs - Scrapes Wikipedia article content and metadata
- LinkMetadata.hs - Annotation database manager
- extracts.js - Popup/transclude content display coordinator
- popups.js - Popup rendering system
- content.js - Content type routing