|
|
| (7 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| <noinclude> | | <noinclude> |
| = DOI Template =
| | Test with: <code>{{DOI|internal=10.toe-e/0.0.2|external=pending}}</code> |
| Variables-free version.
| | </noinclude><includeonly><div style="border:1px solid #ddd; background:#f9f9f9; padding:10px; margin:8px 0; border-radius:6px;"><b>DOI</b><br/>{{#if:{{{internal|}}}|🔖 <span style="color:#555;">Internal:</span> <code>{{{internal}}}</code><br/>}}🌍 <span style="color:#555;">External:</span>{{#if:{{{external|}}}|{{#ifeq:{{lc:{{{external}}}}}|pending|<span style="color:#999;">(pending)</span>|<span class="plainlinks">[https://doi.org/{{{external}}} {{{external}}}]</span>}}|<span style="color:#999;">(none)</span>}}</div></includeonly> |
| | |
| == 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]] → [[Has type::Text]]
| |
| * [[Property:Has external DOI]] → [[Has type::Text]]
| |
| </noinclude><includeonly>
| |
| <!-- Semantic storage -->
| |
| {{#if:{{{store|yes}}}|
| |
| {{#if:{{{internal|}}}|[[Has internal DOI::{{{internal}}}]]}}
| |
| {{#if:{{{external|}}}|[[Has external DOI::{{{external}}}]]}}
| |
| }}
| |
| | |
| <!-- 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 -->|
| |
| <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> | |
Test with:
DOI
🔖 Internal: 10.toe-e/0.0.2
🌍 External:(pending)