Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Transclusion
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Including one data set inside another automatically}} {{For|transclusion on Wikipedia|Help:Transclusion|selfref=true}} {{More footnotes needed|date=January 2016}} [[File:Transclusion simple.svg|right|frame|In this example, the data of file ''B'' is transcluded into the document ''A''.]] In [[computer science]], '''transclusion''' is the inclusion of part or all of an [[electronic document]] into one or more other documents by [[Reference (computer science)|reference]] via [[hypertext]]. Transclusion is usually performed when the referencing document is displayed, and is normally automatic and transparent to the end user.<ref>{{cite book |editor-last=Glushko |editor-first=Robert J. |editor-link=Robert J. Glushko |date=2013 |title=The Discipline of Organizing |location=Cambridge, Massachusetts |publisher=MIT Press |page=231 |isbn=9780262518505 }}</ref> 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]] (using the "[[single source of truth]]" model, whether in [[data management|data]], [[software development|code]], or [[content (media)|content]]): a [[web resource|resource]] is stored once and distributed for reuse in multiple documents. Updates or corrections to a resource are then reflected in any [[reference (computer science)|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]]. Currently it is a common technique employed by textbook writers, where a single topic/subject needs to be discussed in multiple chapters. An advantage of this system in textbooks is that it helps data redundancy and keeps the book to a manageable size. ==Technical considerations== {{unsourced section|date=July 2024}} ===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 (text)|boilerplate]]. To help overcome [[context-sensitive (disambiguation)|context sensitivity issues]] such as those aforementioned,<!--[[WP:INTDAB]]--> systems capable of transclusion are often also capable of suppressing particular elements within the transcluded content. For example, Wikipedia can use tags such as "[[Help:Template#Inclusion control: noinclude, includeonly, and onlyinclude|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]] in 1960,<ref>{{Cite book|url=http://bitsavers.trailing-edge.com/pdf/codasyl/COBOL_Report_Apr60.pdf#page=56|title=Initial Specifications for a COMMON BUSINESS ORIENTED LANGUAGE (COBOL) for Programming Electronic Digital Computers|date=April 1960|publisher=Department of Defense|location=Washington|pages=V-27|quote=INCLUDE: Function: To save the programmer effort by automatically incorporating library subroutines into the source program.}}</ref> followed by [[BCPL]], [[PL/I]], [[C (programming language)|C]],<ref>{{Cite journal <!-- Citation bot bypass-->|last=Ritchie|first=Dennis M.|author-link=Dennis Ritchie|date=1993-03-01|title=The development of the C language|journal=ACM SIGPLAN Notices|language=EN|volume=28|issue=3|pages=201–208|doi=10.1145/155360.155580|url=https://dl.acm.org/doi/abs/10.1145/155360.155580|archive-url=https://web.archive.org/web/20200227090139/https://dl.acm.org/doi/abs/10.1145/155360.155580|archive-date=27 February 2020|quote=Many other changes occurred around 1972-3, but the most important was the introduction of the [[C preprocessor|preprocessor]], partly at the urging of Alan Snyder [Snyder 74], but also in recognition of the utility of the the[sic]<!--Original source has the duplicate word! --> file-inclusion mechanisms available in [[BCPL]] and [[PL/I]]. Its original version was exceedingly simple, and provided only included files and simple [[Sed#Substitution command|string replacements]]: [[Include directive|#include]] and #define of parameterless macros. Soon thereafter, it was extended, mostly by [[Mike Lesk]] and then by John Reiser, to incorporate [[Macro (computer science)#Parameterized macro|macros with arguments]] and [[conditional compilation]]. The preprocessor was originally considered an optional adjunct to the language itself.}} [http://www.jslint.com/chistory.html Alt URL] {{Webarchive|url=https://web.archive.org/web/20200204075428/http://jslint.com/chistory.html |date=2020-02-04 }}</ref> and by 1978, even [[Fortran#Transition to ANSI Standard Fortran|FORTRAN]]. An [[include directive]] allows common [[source code]] to be reused while avoiding the pitfalls of [[Copy-and-paste programming|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 [[Syntax error|error]]. [[Include guard]]s help solve this by, after a single inclusion of content, thereafter omitting the duplicate content.<ref>{{Cite book|last1=Stallman|first1=Richard M.|chapter-url=https://scicomp.ethz.ch/public/manual/gcc/6.3.0/cpp.pdf#page=14|title=The C Preprocessor: For gcc version 6.3.0 (GCC)|last2=Weinberg|first2=Zachary|pages=10–11|chapter=Header Files|quote=Alternatives to Wrapper #ifndef : [[C preprocessor|CPP]] supports two more ways of indicating that a header file should be read only once. Neither one is as portable as a wrapper ‘#ifndef’ and we recommend you do not use them in new programs, with the caveat that ‘#import’ is standard practice in [[Objective-C]]. [...] Another way to prevent a header file from being included more than once is with the ‘[[pragma once|#pragma once]]’ directive. If ‘#pragma once’ is seen when scanning a header file, that file will never be read again, no matter what.|author-link=Richard Stallman}}</ref> The idea of a single, reusable, source for information lead to concepts like: [[Don't repeat yourself]] and the [[Abstraction principle (computer programming)|abstraction principle]]. A further use was found to make programs more [[Software portability|portable]]. Portable source code uses an include directive to specify a [[C file input/output|standard library]], which contains system specific source code that varies with each computer environment.<ref>{{Cite journal|last1=Johnson|first1=S. C.|author-link=Stephen C. Johnson|last2=Ritchie|first2=D. M.|author-link2=Dennis Ritchie|date=July–August 1978|title=UNIX time-sharing system: Portability of C programs and the UNIX system|journal=The Bell System Technical Journal|volume=57|issue=6|pages=2021–2048|doi=10.1002/j.1538-7305.1978.tb02141.x|s2cid=17510065|issn=0005-8580|access-date=27 February 2020|url=https://ieeexplore.ieee.org/document/6770409|quote=Even before the advent of the [[Interdata 7/32 and 8/32|Interdata]] machine, it as realized, as mentioned above, that many programs depended to an undesirable degree not only on [[Unix|UNIX]] I/O conventions but on details of particularly favorable buffering strategies for the [[PDP-11]]. A package of routines, called the "[[C file input/output|portable I/O library]]," was written by [[Mike Lesk|M. E. Lesk]] and implemented on the [[Honeywell 6000 series|Honeywell]] and IBM machines as well as the PDP-11 in a generally successful effort to overcome the deficiencies of earlier packages|url-access=subscription}}</ref> ==History and implementation by Project Xanadu== Ted Nelson, who originated the words ''hypertext'' and ''[[hypermedia]]'', also coined the term ''transclusion'' in his 1980 book ''[[Literary Machines]]''. Part of his proposal was the idea that [[micropayment]]s 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]].<ref>Theodor H. Nelson, "A File Structure for the Complex, the Changing and the Indeterminate." Proceedings of the ACM 20th National Conference (1965), pp. 84-100</ref> 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 [[Project Xanadu|Xanadu Project]], support transclusion.<ref>{{Cite web|url=http://info.iicm.edu/iicm_papers/transclusions_in_HTML-based_environment.pdf|title=Transclusions in an HTML-Based Environment|last1=Kolbitsch|first1=Josef|last2=Maurer|first2=Hermann|date=January 27, 2017|access-date=January 27, 2017|archive-date=July 1, 2017|archive-url=https://web.archive.org/web/20170701160301/http://info.iicm.edu/iicm_papers/transclusions_in_HTML-based_environment.pdf|url-status=dead}}</ref> Nelson has delivered a demonstration of Web transclusion, the Little Transquoter (programmed to Nelson's specification by Andrew Pam in 2004–2005).<ref>[http://www.xanadu.com.au/transquoter/ The Little Transquoter] Xanadu.com.au</ref> 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]]: specifying a [[List of HTTP header fields#Range|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]] employs transclusion for nested directive operation.<ref>{{Cite web|url=https://docs.angularjs.org/api/ng/directive/ngTransclude|title=AngularJS|website=docs.angularjs.org|access-date=2016-08-11}}</ref> 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]] or [[Leeching (computing)|leeching]]. Other publishers may seek specifically to have their materials transcluded into other web sites, as in the form of [[web advertising]], or as [[Web widget|widgets]] like a [[hit counter]] or [[web bug]]. [[mashup (web application hybrid)|Mashups]] make use of transclusion to assemble resources or data into a new application, as by placing [[Geo-tagging|geo-tagged]] photos on an interactive map, or by displaying business metrics in an interactive [[Dashboard (business)|dashboard]]. ===Client-side HTML=== [[HTML]] defines elements for client-side transclusion of [[HTML element#Images and objects|images]], scripts, [[Style sheet (web development)|stylesheets]], [[Framing (World Wide Web)|other documents]], and [[HTML element#Images and objects|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 (programming)|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 [[SGML entity|entities]], [[XPointer]] document referencing, and [[XSLT]] manipulations. [[Proxy server]]s may employ transclusion to reduce redundant transmissions of commonly requested resources. A popular Front End Framework known as [[AngularJS]] 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]] and [[SGML entity|markup entity references]] resolved by the server software. It is a feature of [[Web template|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]]s increasingly provide for transclusion and substitution. [[Component content management system]]s, especially, aim to take the [[modular design]] 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 [[small and medium-sized enterprises|SMEs]]) that may not have the budget for other commercial options; for details, see ''[[Component content management system]]''. == Implementation in software development == {{unsourced section|date=July 2024}} A common feature in programming languages is the ability of one source code file to transclude, in whole or part, another source code file. The part transcluded is interpreted as if it were part of the transcluding file. Some of the methods are: * Include: Some programs will explicitly INCLUDE another file. The included file can consist of executable code, declarations, compiler instructions, and/or branching to later parts of the document, depending on compile-time variables. * Macro: [[Assembly language]]s, and some high-level programming languages, will typically provide for macros, special named instructions used to make definitions, generate executable code, provide looping and other decisions, and modify the document produced according to parameters supplied to the macro when the file is rendered. * Copy: The [[Cobol]] programming language has the COPY command, in which a copied file is inserted into the copying document, replacing the COPY command. Code and declarations in the copied file can be modified by a REPLACING argument as part of the copying command. ==See also== * {{annotated link|Compound document}} * {{annotated link|Cross-reference}} * {{annotated link|Darwin Information Typing Architecture#Content reuse|Darwin Information Typing Architecture (DITA)}} and ''content reuse'' * {{annotated link|Macro (computer science)}} * {{annotated link|Object Linking and Embedding|Object Linking and Embedding (OLE)}} * {{annotated link|Publish and Subscribe (Mac OS)}} * {{annotated link|Single-source publishing}} * {{annotated link|Subroutine}} * {{annotated link|XInclude}} ==References== {{Reflist}} ==Further reading== * {{cite conference | last1 = Di Iorio | first1 = A. | last2 = Vitali | first2 = F. | title = A Xanalogical Collaborative Editing Environment | book-title = Proceedings of the Second International Workshop of Web Document Analysis 2003 (WDA2003) |date=August 2003 | location = Edinburgh, UK | url = http://www.csc.liv.ac.uk/~wda2003/Papers/Section_III/Paper_11.pdf }} * {{cite journal |last1 = Kolbitsch |first1 = J. |last2 = Maurer |first2 = H. |title = Transclusions in an HTML-Based Environment |journal = Journal of Computing and Information Technology |volume = 14 |issue = 2 |pages = 161–174 |date = June 2006 |doi = 10.2498/cit.2006.02.07 |doi-access= free }} * {{cite journal | last = Kolbitsch | first = J. | title = Fine-Grained Transclusions of Multimedia Documents in HTML | journal = [[Journal of Universal Computer Science]] | volume = 11 | issue = 6 |date=June 2005 | url = http://www.jucs.org/jucs_11_6/fine_grained_transclusions_of/ }} * {{cite conference |first = H. |last = Krottmaier |title = Transcluded Documents: Advantages of Reusing Document Fragments |book-title = Proceedings of the 6th International ICCC/IFIP Conference on Electronic Publishing (ELPUB2002) |pages = 359–367 |publisher = Karlovy Vary |year = 2002 |location = Czech Republic |url = http://hkrott.iicm.edu/docs/publications/elpub-2002.pdf |url-status = dead |archive-url = https://web.archive.org/web/20050517185446/http://hkrott.iicm.edu/docs/publications/elpub-2002.pdf |archive-date = 2005-05-17 }} * {{cite conference | first1 = H. | last1 = Krottmaier | first2 = Helic | last2 = D. | title = Issues of Transclusions | book-title = Proceedings of the World Conference on E-Learning in Corporate, Government, Healthcare, & Higher Education (E-Learn 2002) | pages = 1730–1733 | year = 2002 | location = Montreal, Canada | url = http://coronet.iicm.edu/denis/pubs/elearn2002b.pdf | conference = | access-date = 2006-05-25 | archive-date = 2015-06-20 | archive-url = https://web.archive.org/web/20150620090533/http://coronet.iicm.edu/denis/pubs/elearn2002b.pdf | url-status = dead }} * {{cite journal | last1 = Krottmaier | first1 = H. | last2 = Maurer | first2 = H. | title = Transclusions in the 21st Century | journal = Journal of Universal Computer Science | volume = 7 | issue = 12 | pages = 1125–1136 |date=July 2001 | url = http://www.jucs.org/jucs_7_12/transclusions_in_the_21st/ | format = [[PDF]], [[HTML]], [[PostScript]] | citeseerx = 10.1.1.106.9923 }} * {{cite conference | first = A. | last = Moore | title = Personally tailored teaching in WHURLE using conditional translucion | book-title = Proceedings of the Twelfth ACM Conference on Hypertext and Hypermedia | pages = 163–164 | year = 2001 | location = Aarhus, Danmark |display-authors=etal}} * {{cite book | last = Nelson | first = T. H. | title = Literary Machines | publisher = Mindful Press | orig-year = 1980| year = 1993 }} * {{cite journal | first = T. H. | last = Nelson | title = The Heart of Connection: Hypermedia Unified by Transclusion | journal = Communications of the ACM | pages = 31–33 | issue = 8 | year = 1995 | doi = 10.1145/208344.208353 | volume = 38 | s2cid = 16604206 | doi-access = free }} * {{cite web | last = Nelson | first = T. H. | title = Generalized Links, Micropayment and Transcopyright | year = 1996 | url = http://www.almaden.ibm.com/almaden/npuc97/1996/tnelson.htm | publisher = [[Almaden Research Center]] | access-date = 2006-09-27 | archive-date = 2006-12-05 | archive-url = https://web.archive.org/web/20061205020749/http://almaden.ibm.com/almaden/npuc97/1996/tnelson.htm | url-status = dead }} * {{cite web | last = Nelson | first = T. H. | title = Transcopyright: Pre-Permission for Virtual Republishing | year = 1998 | url = http://www.aus.xanadu.com/xanadu/transcopy.html }} * {{cite journal | last = Nelson | first = T. H. | title = Xanalogical Structure, Needed Now More than Ever: Parallel Documents, Deep Links to Content, Deep Versioning and Deep Re-Use | journal = ACM Computing Surveys | volume = 31 | issue = 4es | pages = 33–es | year = 1999 | url = http://xanadu.com.au/ted/XUsurvey/xuDation.html | doi = 10.1145/345966.346033 | citeseerx = 10.1.1.418.7740 | s2cid = 12852736 }} * {{cite journal | last = Pam | first = A. | title = Fine-Grained Transclusion in the Hypertext Markup Language | journal = Internet Draft | year = 1997 | url = http://tools.ietf.org/html/draft-pam-html-fine-trans | format = Text }} * {{cite book | last1 = Wilde | first1 = E. | last2 = Lowe | first2= D. | chapter = Chapter 7: XML Linking Language | title = XPath, XLink, XPointer, and XML: A Practical Guide to Web Hyperlinking and Transclusion | publisher = Addison-Wesley Professional | year = 2002 | pages = 169–198 | isbn = 9780201703443 | chapter-url = https://books.google.com/books?id=_b4BG1GC7pgC&q=XPath%2C+XLink%2C+XPointer%2C+and+XML%3A+A+Practical+Guide+to+Web+Hyperlinking+and+Transclusion&pg=PR1 }} ==External links== {{Wiktionary|transclusion}} * Ted Nelson: ''Transclusion: Fixing Electronic Literature''—on Google Tech Talks, 29 January 2007. [[Category:HTML]] [[Category:Hypertext]] [[Category:Metadata]] [[Category:Ted Nelson]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Annotated link
(
edit
)
Template:Cite book
(
edit
)
Template:Cite conference
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:For
(
edit
)
Template:More footnotes needed
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Unsourced section
(
edit
)
Template:Webarchive
(
edit
)
Template:Wiktionary
(
edit
)