Transclude files as random slideshow testcases 3
   HOME

TheInfoList



OR:

In computer science, transclusion is the inclusion of part or all of an electronic document into one or more other documents by reference via
hypertext Hypertext is E-text, text displayed on a computer display or other electronic devices with references (hyperlinks) to other text that the reader can immediately access. Hypertext documents are interconnected by hyperlinks, which are typi ...
. Transclusion is usually performed when the referencing document is displayed, and is normally automatic and transparent to the end user. The result of transclusion is a single integrated document made of parts assembled dynamically from separate sources, possibly stored on different computers in disparate places. Transclusion facilitates
modular design Modular design, or modularity in design, is a design principle that subdivides a system into smaller parts called ''modules'' (such as modular process skids), which can be independently created, modified, replaced, or exchanged with other modules ...
(using the
single source of truth In information science and information technology, single source of truth (SSOT) architecture, or single point of truth (SPOT) architecture, for information systems is the practice of structuring information models and associated data schemas su ...
model, whether in data,
code In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication ...
, or content): a resource is stored once and distributed for reuse in multiple documents. Updates or corrections to a resource are then reflected in any referencing documents. In systems where transclusion is not available, and in some situations where it is available but not desirable, substitution is often the complementary option, whereby a static copy of the single source of truth is integrated into the relevant document. Examples of both are provided by the ways in which they are both used in creating the content of Wikipedia, for example (see '' Wikipedia:Transclusion'' and '' Wikipedia:Substitution'' for more information). Substituted static copies introduce a different set of considerations for version control than transclusion does, but they are sometimes necessary. Ted Nelson coined the term for his 1980 nonlinear book '' Literary Machines'', but the idea of ''master copy and occurrences'' was applied 17 years before, in Sketchpad.


Technical considerations


Context neutrality

Transclusion works better when transcluded sections of text are self-contained, so that the meaning and validity of the text is independent of context. For example, formulations like "as explained in the previous section" are problematic, because the transcluded section may appear in a different context, causing confusion. What constitutes "context-neutral" text varies, but often includes things like company information or boilerplate. To help overcome context sensitivity issues such as those aforementioned, systems capable of transclusion are often also capable of suppressing particular elements within the transcluded content. For example, Wikipedia can use tags such as "noinclude", "onlyinclude", and "includeonly" for this purpose. Typical examples of elements that often require such exceptions are document titles, footnotes, and cross-references; in this way, they can be automatically suppressed upon transclusion, without manual reworking for each instance.


Parameterization

Under some circumstances, and in some technical contexts, transcluded sections of text may not require strict adherence to the "context neutrality" principle, because the transcluded sections are capable of ''parameterization''. Parameterization implies the ability to modify certain portions or subsections of a transcluded text depending on exogenous variables that can be changed independently. This is customarily done by supplying a transcluded text with one or more ''substitution placeholders''. These placeholders are then replaced with the corresponding variable values prior to rendering the final transcluded output in context.


Origins

The concept of reusing file content began with computer programming languages:
COBOL COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural and, since 2002, object-oriented language. COBOL is primarily us ...
in 1960, followed by
BCPL BCPL ("Basic Combined Programming Language") is a procedural, imperative, and structured programming language. Originally intended for writing compilers for other languages, BCPL is no longer in common use. However, its influence is still ...
, PL/I, C, and by the 1990s, even FORTRAN.Alt URL
/ref> An include directive allows common source code to be reused while avoiding the pitfalls of Copy-and-paste-programming and hard coding of constants. As with many innovations, a problem developed. Multiple include directives may provide the same content as another include directive, inadvertently causing repetitions of the same source code into the final result, resulting in an error. Include guards help solve this by, after a single inclusion of content, thereafter omit the duplicate content. The idea of a single, reusable, source for information lead to concepts like:
Don't repeat yourself "Don't repeat yourself" (DRY) is a principle of software development aimed at reducing repetition of software patterns, replacing it with abstractions or using data normalization to avoid redundancy. The DRY principle is stated as "Every piece o ...
and the abstraction principle. A further use was found to make programs more portable. Portable source code uses an include directive to specify a
standard library In computer programming, a standard library is the library made available across implementations of a programming language. These libraries are conventionally described in programming language specifications; however, contents of a language's as ...
, which contains system specific source code that varies with each computer environment.


History and implementation by Project Xanadu

Ted Nelson, who originated the words "hypertext" and "
hypermedia Hypermedia, an extension of the term hypertext, is a nonlinear medium of information that includes graphics, audio, video, plain text and hyperlinks. This designation contrasts with the broader term ''multimedia'', which may include non-interac ...
", also coined the term "transclusion", in his 1980 book '' Literary Machines''. Part of his proposal was the idea that micropayments could be automatically exacted from the reader for all the text, no matter how many snippets of content are taken from various places. However, according to Nelson, the concept of transclusion had already formed part of his 1965 description of
hypertext Hypertext is E-text, text displayed on a computer display or other electronic devices with references (hyperlinks) to other text that the reader can immediately access. Hypertext documents are interconnected by hyperlinks, which are typi ...
. Nelson defines transclusion as, "...the same content knowably in more than one place," setting it apart from more special cases, such as the inclusion of content from a different location (which he calls ''transdelivery'') or an explicit quotation that remains connected to its origins, (which he calls ''transquotation''). Some hypertext systems, including Ted Nelson's own
Xanadu Project Project Xanadu ( ) was the first hypertext project, founded in 1960 by Ted Nelson. Administrators of Project Xanadu have declared it superior to the World Wide Web, with the mission statement: "Today's popular software simulates paper. The World ...
, support transclusion. Nelson has delivered a demonstration of Web transclusion, the Little Transquoter (programmed to Nelson's specification by Andrew Pam in 2004-2005). It creates a new format built on portion addresses from Web pages; when dereferenced, each portion on the resulting page remains click-connected to its original context.


Implementation on the Web

HTTP, as a transmission protocol, has rudimentary support for transclusion via
byte serving Byte serving (other names: Range Requests; Byte Range Serving; Page on demand) is the process introduced in HTTP protocol 1.1 of sending only a portion of a message from a server to a client. Byte serving begins when an HTTP server advertises its ...
: specifying a byte range in an HTTP request message. Transclusion can occur either before (server-side) or after (client-side) transmission. For example: * An HTML document may be pre-composed by the server before delivery to the client using Server-Side Includes or another server-side application. * XML Entities or HTML Objects may be parsed by the client, which then requests the corresponding resources separately from the main document. * A web browser may cache elements using its own algorithms, which can operate without explicit directives in the document's markup. *
AngularJS AngularJS is a discontinued free and open-source JavaScript-based web framework for developing single-page applications. It was maintained mainly by Google and a community of individuals and corporations. It aimed to simplify both the development ...
employs transclusion for nested directive operation. Publishers of web content may object to the transclusion of material from their own web sites into other web sites, or they may require an agreement to do so. Critics of the practice may refer to various forms of inline linking as
bandwidth theft Inline linking (also known as hotlinking, leeching, piggy-backing, direct linking, offsite image grabs) is the use of a linked object, often an image, on one site by a web page belonging to a second site. One site is said to have an inline li ...
or leeching. Other publishers may seek specifically to have their materials transcluded into other web sites, as in the form of web advertising, or as widgets like a
hit counter A web counter or hit counter is a publicly displayed running tally of the number of visits a webpage has received. Web counters are usually displayed as an inline digital image or in plain text. Image rendering of digits may use a variety of ...
or web bug. Mashups make use of transclusion to assemble resources or data into a new application, as by placing geo-tagged photos on an interactive map, or by displaying business metrics in an interactive dashboard.


Client-side HTML

HTML defines elements for client-side transclusion of images, scripts, stylesheets, other documents, and other types of media. HTML has relied heavily on client-side transclusion from the earliest days of the Web (so web pages could be displayed more quickly before multimedia elements finished loading), rather than embedding the raw data for such objects inline into a web page's markup. Through techniques such as Ajax, scripts associated with an HTML document can instruct a web browser to modify the document in-place, as opposed to the earlier technique of having to pull an entirely new version of the page from the web server. Such scripts may transclude elements or documents from a server after the web browser has rendered the page, in response to user input or changing conditions, for example. Future versions of HTML may support deeper transclusion of portions of documents using XML technologies such as
entities An entity is something that exists as itself, as a subject or as an object, actually or potentially, concretely or abstractly, physically or not. It need not be of material existence. In particular, abstractions and legal fictions are usually ...
,
XPointer XPointer is a system for addressing components of XML-based Internet media. It is divided among four specifications: a "framework" that forms the basis for identifying XML fragments, a positional element addressing scheme, a scheme for namespaces, ...
document referencing, and
XSLT XSLT (Extensible Stylesheet Language Transformations) is a language originally designed for transforming XML documents into other XML documents, or other formats such as HTML for web pages, plain text or XSL Formatting Objects, which may subseque ...
manipulations. Proxy servers may employ transclusion to reduce redundant transmissions of commonly requested resources. A popular Front End Framework known as
AngularJS AngularJS is a discontinued free and open-source JavaScript-based web framework for developing single-page applications. It was maintained mainly by Google and a community of individuals and corporations. It aimed to simplify both the development ...
developed and maintained by Google has a directive callend ng-transclude that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.


Server-side transclusion

Transclusion can be accomplished on the server side, as through
Server Side Includes Server Side Includes (SSI) is a simple interpreted server-side scripting language used almost exclusively for the World Wide Web. It is most useful for including the contents of one or more files into a web page on a web server (see below), using i ...
and markup entity references resolved by the server software. It is a feature of substitution templates.


Transclusion of source code

Transclusion of source code into software design or reference materials lets source code be presented within the document, but not interpreted as part of the document, preserving the semantic consistency of the inserted code in relation to its source codebase.


Transclusion in content management

In content management for single-source publishing, top-class
content management system A content management system (CMS) is computer software used to manage the creation and modification of digital content (content management).''Managing Enterprise Content: A Unified Content Strategy''. Ann Rockley, Pamela Kostur, Steve Manning. New ...
s increasingly provide for transclusion and substitution.
Component content management system A component content management system (CCMS) is a content management system that manages content at a granular level (component) rather than at the document level. Each component represents a single topic, concept or asset (for example an image, ...
s, especially, aim to take the
modular design Modular design, or modularity in design, is a design principle that subdivides a system into smaller parts called ''modules'' (such as modular process skids), which can be independently created, modified, replaced, or exchanged with other modules ...
principle to its optimal degree. MediaWiki provides transclusion and substitution and is a good off-the-shelf option for many smaller organizations (such as smaller nonprofits and
SMEs Superconducting magnetic energy storage (SMES) systems store energy in the magnetic field created by the flow of direct current in a Superconductivity, superconducting coil which has been Cryogenics, cryogenically cooled to a temperature below ...
) that may not have the overhead budget for other commercial options; for details, see ''
Component content management system A component content management system (CCMS) is a content management system that manages content at a granular level (component) rather than at the document level. Each component represents a single topic, concept or asset (for example an image, ...
''.


See also

* * * and ''content reuse'' * * * * * *


References


Further reading

* * * * * * * * * * * * * *


External links

{{Wiktionary, transclusion * Ted Nelson:
Transclusion: Fixing Electronic Literature
'—on Google Tech Talks, 29 January 2007. HTML Hypertext Metadata Ted Nelson