Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Transclusion

From Wikipedia, the free encyclopedia
Including one data set inside another automatically
For transclusion on Wikipedia, seeHelp:Transclusion.
This article includes a list ofgeneral references, butit lacks sufficient correspondinginline citations. Please help toimprove this article byintroducing more precise citations.(January 2016) (Learn how and when to remove this message)
In this example, the data of fileB is transcluded into the documentA.

Incomputer science,transclusion is the inclusion of part or all of anelectronic document into one or more other documents byreference viahypertext. Transclusion is usually performed when the referencing document is displayed, and is normally automatic and transparent to the end user.[1] 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 facilitatesmodular design (using the "single source of truth" model, whether indata,code, orcontent): aresource is stored once and distributed for reuse in multiple documents. Updates or corrections to a resource are then reflected in anyreferencing 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 (seeWikipedia:Transclusion andWikipedia:Substitution for more information). Substituted static copies introduce a different set of considerations forversion control than transclusion does, but they are sometimes necessary.

Ted Nelson coined the term for his 1980 nonlinear bookLiterary Machines, with the idea that each quotation could be connected to its original source, and texts could "transclude" (include these other sources).[2] However, the idea ofmaster copy and occurrences was applied 17 years before, inSketchpad. 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

[edit]
icon
This sectiondoes notcite anysources. Please helpimprove this section byadding citations to reliable sources. Unsourced material may be challenged andremoved.(July 2024) (Learn how and when to remove this message)

Context neutrality

[edit]

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 orboilerplate. To help overcomecontext 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

[edit]

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 ofparameterization. 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 moresubstitution placeholders. These placeholders are then replaced with the corresponding variable values prior to rendering the final transcluded output in context.

Origins

[edit]

The concept of reusing file content began with computer programming languages:COBOL in 1960,[3] followed byBCPL,PL/I,C,[4] and by 1978, evenFORTRAN. Aninclude directive allows commonsource code to be reused while avoiding the pitfalls ofcopy-and-paste-programming andhard 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 anerror.Include guards help solve this by, after a single inclusion of content, thereafter omitting the duplicate content.[5]

The idea of a single, reusable, source for information lead to concepts like:Don't repeat yourself and theabstraction principle. A further use was found to make programs moreportable. Portable source code uses an include directive to specify astandard library, which contains system specific source code that varies with each computer environment.[6]

History and implementation by Project Xanadu

[edit]

Ted Nelson, who originated the wordshypertext andhypermedia, also coined the termtransclusion in his 1980 bookLiterary Machines. Part of his proposal was the idea thatmicropayments 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 ofhypertext.[7] 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 callstransdelivery) or an explicitquotation that remains connected to its origins, (which he callstransquotation).

Some hypertext systems, including Ted Nelson's ownXanadu Project, support transclusion.[8]

Nelson has delivered a demonstration of Web transclusion, the Little Transquoter (programmed to Nelson's specification by Andrew Pam in 2004–2005).[9] 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

[edit]

HTTP, as a transmission protocol, has rudimentary support for transclusion viabyte serving: specifying abyte 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.[10]

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 ofinline linking asbandwidth theft orleeching.

Other publishers may seek specifically to have their materials transcluded into other web sites, as in the form ofweb advertising, or aswidgets like ahit counter orweb bug.

Mashups make use of transclusion to assemble resources or data into a new application, as by placinggeo-tagged photos on an interactive map, or by displaying business metrics in an interactivedashboard.

Client-side HTML

[edit]

HTML defines elements for client-side transclusion ofimages, scripts,stylesheets,other documents, andother 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 asAjax, 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 usingXML technologies such asentities,XPointer document referencing, andXSLT manipulations.

Proxy servers may employ transclusion to reduce redundant transmissions of commonly requested resources.

A popular Front End Framework known asAngularJS developed and maintained byGoogle 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

[edit]

Transclusion can be accomplished on the server side, as throughServer Side Includes andmarkup entity references resolved by the server software. It is a feature ofsubstitution templates.

Transclusion of source code

[edit]

Transclusion of source code intosoftware 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

[edit]

Incontent management forsingle-source publishing, top-classcontent management systems increasingly provide for transclusion and substitution.Component content management systems, especially, aim to take themodular 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 andSMEs) that may not have the budget for other commercial options; for details, seeComponent content management system.

Implementation in software development

[edit]
icon
This sectiondoes notcite anysources. Please helpimprove this section byadding citations to reliable sources. Unsourced material may be challenged andremoved.(July 2024) (Learn how and when to remove this message)

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 languages, 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: TheCobol 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

[edit]

References

[edit]
  1. ^Glushko, Robert J., ed. (2013).The Discipline of Organizing. Cambridge, Massachusetts: MIT Press. p. 231.ISBN 9780262518505.
  2. ^Google TechTalks (2007-10-08).Transclusion: Fixing Electronic Literature. Retrieved2025-07-04 – via YouTube.{{cite AV media}}:|last= has generic name (help)
  3. ^Initial Specifications for a COMMON BUSINESS ORIENTED LANGUAGE (COBOL) for Programming Electronic Digital Computers(PDF). Washington: Department of Defense. April 1960. pp. V-27.INCLUDE: Function: To save the programmer effort by automatically incorporating library subroutines into the source program.
  4. ^Ritchie, Dennis M. (1993-03-01)."The development of the C language".ACM SIGPLAN Notices.28 (3):201–208.doi:10.1145/155360.155580. Archived fromthe original on 27 February 2020.Many other changes occurred around 1972-3, but the most important was the introduction of thepreprocessor, partly at the urging of Alan Snyder [Snyder 74], but also in recognition of the utility of the the[sic] file-inclusion mechanisms available inBCPL andPL/I. Its original version was exceedingly simple, and provided only included files and simplestring replacements:#include and #define of parameterless macros. Soon thereafter, it was extended, mostly byMike Lesk and then by John Reiser, to incorporatemacros with arguments andconditional compilation. The preprocessor was originally considered an optional adjunct to the language itself.Alt URLArchived 2020-02-04 at theWayback Machine
  5. ^Stallman, Richard M.; Weinberg, Zachary."Header Files"(PDF).The C Preprocessor: For gcc version 6.3.0 (GCC). pp. 10–11.Alternatives to Wrapper #ifndef :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 inObjective-C. [...] Another way to prevent a header file from being included more than once is with the '#pragma once' directive. If '#pragma once' is seen when scanning a header file, that file will never be read again, no matter what.
  6. ^Johnson, S. C.;Ritchie, D. M. (July–August 1978)."UNIX time-sharing system: Portability of C programs and the UNIX system".The Bell System Technical Journal.57 (6):2021–2048.doi:10.1002/j.1538-7305.1978.tb02141.x.ISSN 0005-8580.S2CID 17510065. Retrieved27 February 2020.Even before the advent of theInterdata machine, it as realized, as mentioned above, that many programs depended to an undesirable degree not only onUNIX I/O conventions but on details of particularly favorable buffering strategies for thePDP-11. A package of routines, called the "portable I/O library," was written byM. E. Lesk and implemented on theHoneywell and IBM machines as well as the PDP-11 in a generally successful effort to overcome the deficiencies of earlier packages
  7. ^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
  8. ^Kolbitsch, Josef; Maurer, Hermann (January 27, 2017)."Transclusions in an HTML-Based Environment"(PDF). Archived fromthe original(PDF) on July 1, 2017. RetrievedJanuary 27, 2017.
  9. ^The Little Transquoter Xanadu.com.au
  10. ^"AngularJS".docs.angularjs.org. Retrieved2016-08-11.

Further reading

[edit]

External links

[edit]
Look uptransclusion in Wiktionary, the free dictionary.
  • Ted Nelson:Transclusion: Fixing Electronic Literature—on Google Tech Talks, 29 January 2007.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Transclusion&oldid=1325468656"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp