|
|
| Line 1: |
Line 1: |
| <noinclude> | | <noinclude> |
| = DOI Template (safe, variables‑free) =
| | <includeonly> |
| Usage:
| | <!-- Semantic storage only (no visible output) --> |
| * Boxed (default):
| |
| {{DOI|internal=10.toe-e/0.0.2|external=pending|store=yes}}
| |
| * Short/inline:
| |
| {{DOI|internal=10.toe-e/0.0.2|external=10.5281/zenodo.12345|short=yes|label=DOI|store=yes}}
| |
| | |
| Optional params:
| |
| ; internal : your internal identifier (e.g., 10.toe-e/0.0.2)
| |
| ; external : Crossref/DataCite DOI (or "pending")
| |
| ; short : "yes" to render single-line inline variant
| |
| ; label : heading/label text (default "DOI")
| |
| ; store : "yes" to save to SMW properties (default yes)
| |
| | |
| Requires (create once):
| |
| * Property:Has internal DOI → [[Has type::Text]]
| |
| * Property:Has external DOI → [[Has type::Text]]
| |
| </noinclude><includeonly>
| |
| <!-- Store to SMW (optional) --> | |
| {{#if:{{{store|yes}}}| | | {{#if:{{{store|yes}}}| |
| {{#if:{{{internal|}}}|[[Has internal DOI::{{{internal}}}]]}} | | {{#if:{{{internal|}}}|[[Has internal DOI::{{{internal}}}]]}} |
| Line 24: |
Line 7: |
| }} | | }} |
|
| |
|
| <!-- SHORT / INLINE VARIANT --> | | <!-- Display box --> |
| {{#ifeq:{{lc:{{{short|}}}}}|yes|
| | <div style="border:1px solid #ddd; background:#f9f9f9; padding:10px; margin:8px 0; border-radius:6px;"> |
| {{#if:{{{internal|}}}{{{external|}}}| | | <span style="font-weight:600;">{{{label|DOI}}}</span><br/> |
| <span class="plainlinks"><b>{{{label|DOI}}}:</b> | | |
| {{#if:{{{internal|}}}| <code>{{{internal}}}</code>{{#if:{{{external|}}}| • |}} }}
| | {{#if:{{{internal|}}}| |
| {{#if:{{{external|}}}|
| | <div>🔖 <span style="color:#555;">Internal:</span> <code>{{{internal}}}</code></div> |
| {{#ifeq:{{lc:{{{external}}}}}|pending|
| | }} |
| <i>(external DOI pending)</i>
| | |
| | [https://doi.org/{{{external}}} {{{external}}}]
| | <div>🌍 <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> | | | <span style="color:#999;">(none)</span> |
| | <span style="color:#999;"><i>No DOI assigned.</i></span> }}
| |
| |
| |
| <!-- BOX VARIANT -->
| |
| <div style="border:1px solid #ddd; background:#f9f9f9; padding:10px; margin:8px 0; border-radius:6px;">
| |
| <div style="font-weight:600; margin-bottom:4px;">{{{label|DOI}}}</div>
| |
| {{#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> | | </div> |
| }} | | |
| | {{#if:{{{internal|}}}{{{external|}}}||<div style="color:#999;"><i>No DOI assigned.</i></div>}} |
| | </div> |
| </includeonly> | | </includeonly> |