Template:DOI: Difference between revisions
Appearance
Created page with "<noinclude> = DOI Template = Displays internal and/or external DOIs for a paper/branch, and (optionally) stores them as Semantic MediaWiki properties. == Parameters == ; internal : Your TOE‑E internal DOI (e.g., 10.toe-e/0.0.3) ; external : External DOI from Zenodo / Crossref / DataCite (e.g., 10.5281/zenodo.1234567) ; store : yes/no (default yes). When "yes", sets Has internal DOI and Has external DOI. ; short : yes/no (default no). When "yes", renders..." |
No edit summary |
||
| Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
= DOI Template = | = DOI Template = | ||
Variables-free version. | |||
== | == Params == | ||
; internal : | ; internal : TOE‑E internal DOI (e.g., 10.toe-e/0.0.2) | ||
; external : External DOI | ; external : External DOI (e.g., 10.5281/zenodo.1234567) or "pending" | ||
; store : yes/no (default yes) | ; store : yes/no (default yes) → sets [[Has internal DOI]] / [[Has external DOI]] | ||
; short : yes/no (default no) | ; short : yes/no (default no) | ||
; label : | ; label : defaults to "DOI" | ||
== Properties to create once == | |||
* [[Property:Has internal DOI]] → [[Has type::Text]] | |||
* [[Property:Has external DOI]] → [[Has type::Text]] | |||
</noinclude><includeonly> | </noinclude><includeonly> | ||
<!-- | <!-- Semantic storage --> | ||
{{# | {{#if:{{{store|yes}}}| | ||
{{#if:{{{internal|}}}|[[Has internal DOI::{{{internal}}}]]}} | |||
{{#if:{{{external|}}}|[[Has external DOI::{{{external}}}]]}} | |||
}} | |||
{{# | |||
{{#if:{{ | |||
<!-- Derived | <!-- Derived pieces --> | ||
{{# | {{#if:{{{short|}}}| | ||
{{# | {{#ifeq:{{lc:{{{short|}}}}}|yes|<!-- short=yes --> | ||
{{# | {{#if:{{{internal|}}}{{{external|}}}| | ||
<span class="plainlinks"><b>{{{label|DOI}}}:</b> | |||
{{#if:{{{internal|}}}|<code>{{{internal}}}</code>{{#if:{{{external|}}}| • |}}}} | |||
{{#if:{{{external|}}}| | |||
< | {{#ifeq:{{lc:{{{external}}}}}|pending|<i>(external DOI pending)</i>|[https://doi.org/{{{external}}} {{{external}}}]}} | ||
}} | |||
</span> | |||
| <span style="color:#999;"><i>No DOI assigned.</i></span> | |||
}} | }} | ||
}} | | <!-- short != yes → fall through to box --> }} | ||
}} | }} | ||
{{#ifeq:{{lc:{{{short|}}}}}|yes|<!-- already rendered above -->| | |||
{{#ifeq:{{ | <div style="border:1px solid #ddd; background:#f9f9f9; padding:10px; margin:8px 0;"> | ||
<span style="font-weight:600;">{{{label|DOI}}}</span><br/> | |||
{{#if:{{{internal|}}|<div>🔖 <span style="color:#555;">Internal:</span> <code>{{{internal}}}</code></div>}} | |||
{{#if:{{{external|}}| | |||
<div>🌍 <span style="color:#555;">External:</span> | |||
{{#ifeq:{{lc:{{{external}}}}}|pending|<i>(pending)</i>|<span class="plainlinks">[https://doi.org/{{{external}}} {{{external}}}]</span>}} | |||
</div> | |||
}} | |||
{{#if:{{{internal|}}}{{{external|}}}||<div style="color:#999;"><i>No DOI assigned.</i></div>}} | |||
</div> | |||
}} | }} | ||
</includeonly> | </includeonly> | ||
Revision as of 21:38, 22 August 2025
DOI Template
Variables-free version.
Params
- internal
- TOE‑E internal DOI (e.g., 10.toe-e/0.0.2)
- external
- External DOI (e.g., 10.5281/zenodo.1234567) or "pending"
- store
- yes/no (default yes) → sets Has internal DOI / Has external DOI
- short
- yes/no (default no)
- label
- defaults to "DOI"
Properties to create once
- Property:Has internal DOI → Text
- Property:Has external DOI → Text