Wikisource:WikiProject DNB/Transclusion

From Wikisource

Jump to: navigation, search
Wikisource:WikiProject DNB Transclusion

The use of transclusion became basic as soon as the project had djvu files posted. The text that is checked opposite the djvu of the DNB page on which it occurs can also be used as a component of an article in the main namespace. The overhead for doing this is not really very high.

[edit] Markup

There is more than one way to do the transclusion, but the markup doesn't depend on the method. The required text must be marked with <section begin="name"/> and <section end="name"/> at the start and finish. For articles on a single printed page, that is all there is to it. The chosen "name" is required in the transclusion syntax for the created page. It is otherwise an arbitrary choice; except that the names for sections on a given page must be distinct. (That is, you must disambiguate sections on a page. Names derived from article titles are natural, and those also must be disambiguated. If you just use the article title you'll have good disambiguation but longish names that are easy for others to understand. Just a thought, not a rule.) NB If you leave a space in front of the section name, transclusion fails. This is very easy to do.

One can think of the entire text we are working on as segmented by various markers: to demarcate volumes, pages and sections. There is some flexibility in the section markup, but it is good practice to close any section by the end of the page. We should really avoid assumptions about how current templates for transclusion operate, in the markup, to make future upgrades work smoothly.

That said, if a whole page will form part of an article, then it doesn't need section markup. And an article that stretches over several pages, like section-page-page-section, may use different section names on the initial and final pages, if required. But both of those pages should carry the begin and end section markers.

[edit] Templates

The state of the art transclusion template is {{DNBset}}, but there is a simpler transclusion method using {{DNB00}} plus the #section method, or just no transclusion at all (all three types coexist at present).

{{DNBset}} should be used as {{subst:DNBset}}: copy the form to fill in from the Template page and paste it into the page you want to create, complete and save. This is certainly the best way to create long articles, since it takes the initial and final page numbers and adds everything in between. In this template the volume numbers must be two digits, so enter volume 7 as 07. The section name goes in the "section" field, assuming it is the same at the beginning and end. As rendered, this template becomes the {{DNB00}} standard template on top of the required transclusion message.

Transclusion can also be done pagewise with {{#section: (pagename) | (section name)}}. This is a universal method for transcluding the named section of the named page into the target page. You create one line for each page, leaving the section field blank to transclude the entire page.

[edit] Transclusion artefacts

Where there is a break at the end of the page, how does transclusion handle this? If the page ends at the end of the word, you might not notice (if the section marker is directly after the end of the word, that is). If the final word of the page is hyphenated, as DNB style allows, there will be a space after the hyphen before the second half of the word. If the page break is in the middle of the references section in small type, there is a compulsory newline.

There is a way to get round some of this, in fact: see {{hyphenated word start}}, and its documentation and partner template {{hyphenated word end}}. And a way to deal with the newline: example at Page:Dictionary of National Biography volume 34.djvu/374 to Page:Dictionary of National Biography volume 34.djvu/375. Currently cleaning these blemishes up is not being treated as a priority, since there is no impact on information rather than aesthetics.