Jump to content

User:Layer-09/Sandbox/Infobox Emacs: Difference between revisions

From NixOS Wiki
Layer-09 (talk | contribs)
No edit summary
Layer-09 (talk | contribs)
No edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
{{User:Layer-09/Sandbox/Infobox Emacs/Content
<div class="nix-wiki infobox" style="
   | clip   = {{{clip|}}}
  --infobox-color: rgb(82, 119, 195);
  | title   = {{{title|}}}
  --infobox-background: #f9f9f9;
  | image  = {{{image|}}}
 
  | content = {{{content|}}}
  --infobox-border-color: var(--infobox-color);
  | footer  = {{{footer|}}}
  --infobox-border-radius: 1rem;
}}
  --infobox-border-size: 3px;
 
  --infobox-title-color: var(--infobox-color);
  --infobox-title-size: 1rem;
  --infobox-title-weight: bold;
  --infobox-title-align: center;
 
  /* Define specific paddings for better control over spacing */
  --infobox-header-vertical-padding: 0.3rem;
  --infobox-content-vertical-padding: 0.3rem;
  --infobox-horizontal-padding: 1rem;
 
  --infobox-content-size: 90%;
  --infobox-content-title-color: var(--infobox-title-color);
 
  --infobox-separator-size: {{#if: {{{clip|}}} | 10px | 0}};
  --infobox-separator-clip: {{#if: {{{clip|}}} | polygon(0 0, 100% 100%, 0 100%) | none}};
 
  border: solid 3px var(--infobox-color);
  border-radius: var(--infobox-border-radius);
  overflow-y: hidden;
  width: 50em; /* Increased width */
  float: right;
  clear: right;
">
  <div class="nix-wiki infobox-header" style="
    padding: var(--infobox-header-vertical-padding) var(--infobox-horizontal-padding);
    text-align: center;
  ">
    <p class="nix-wiki infobox-title" style="
      color: var(--infobox-title-color);
      font-size: var(--infobox-title-size);
      font-weight: var(--infobox-title-weight);
      text-align: var(--infobox-title-align);
      margin-top: 0;
      margin-bottom: 0.5em;
    ">{{{title}}}</p>
    <div class="nix-wiki infobox-image" style="margin: 0 auto;">[[File:{{{image}}}|frameless|upright=0.45]]</div>
   </div>
 
  <div class="nix-wiki infobox-separator" style="
    height: var(--infobox-separator-size);
    width: 100%;
    background-color: #ffffff;
    clip-path: var(--infobox-separator-clip);
  "></div>
 
  <div class="nix-wiki infobox-content" style="
    padding: var(--infobox-content-vertical-padding) var(--infobox-horizontal-padding);
    background-color: var(--infobox-background);
    text-align: left;
    font-size: var(--infobox-content-size);
  ">
    <table style="width: 100%; border-collapse: collapse; background-color: transparent;">
      {{#if: {{{paradigm|}}} | <tr><th style="text-align: left; vertical-align: top; padding: 0.2em 1em 0.2em 0; color: var(--infobox-title-color); white-space: nowrap; width: 1px;">Paradigm</th><td style="padding: 0.2em 0;">{{{paradigm}}}</td></tr> }}
      {{#if: {{{family|}}} | <tr><th style="text-align: left; vertical-align: top; padding: 0.2em 1em 0.2em 0; color: var(--infobox-title-color); white-space: nowrap; width: 1px;">Family</th><td style="padding: 0.2em 0;">{{{family}}}</td></tr> }}
      {{#if: {{{designed_by|}}} | <tr><th style="text-align: left; vertical-align: top; padding: 0.2em 1em 0.2em 0; color: var(--infobox-title-color); white-space: nowrap; width: 1px;">Designed by</th><td style="padding: 0.2em 0;">{{{designed_by}}}</td></tr> }}
      {{#if: {{{developer|}}} | <tr><th style="text-align: left; vertical-align: top; padding: 0.2em 1em 0.2em 0; color: var(--infobox-title-color); white-space: nowrap; width: 1px;">Developer</th><td style="padding: 0.2em 0;">{{{developer}}}</td></tr> }}
      {{#if: {{{first_appeared|}}} | <tr><th style="text-align: left; vertical-align: top; padding: 0.2em 1em 0.2em 0; color: var(--infobox-title-color); white-space: nowrap; width: 1px;">First appeared</th><td style="padding: 0.2em 0;">{{{first_appeared}}}</td></tr> }}
      {{#if: {{{stable_release|}}} | <tr><th style="text-align: left; vertical-align: top; padding: 0.2em 1em 0.2em 0; color: var(--infobox-title-color); white-space: nowrap; width: 1px;">Stable release</th><td style="padding: 0.2em 0;">{{{stable_release}}}</td></tr> }}
      {{#if: {{{os|}}} | <tr><th style="text-align: left; vertical-align: top; padding: 0.2em 1em 0.2em 0; color: var(--infobox-title-color); white-space: nowrap; width: 1px;">OS</th><td style="padding: 0.2em 0;">{{{os}}}</td></tr> }}
      {{#if: {{{license|}}} | <tr><th style="text-align: left; vertical-align: top; padding: 0.2em 1em 0.2em 0; color: var(--infobox-title-color); white-space: nowrap; width: 1px;">License</th><td style="padding: 0.2em 0;">{{{license}}}</td></tr> }}
      {{#if: {{{filename_extensions|}}} | <tr><th style="text-align: left; vertical-align: top; padding: 0.2em 1em 0.2em 0; color: var(--infobox-title-color); white-space: nowrap; width: 1px;">Extensions</th><td style="padding: 0.2em 0;">{{{filename_extensions}}}</td></tr> }}
      {{#if: {{{website|}}} | <tr><th style="text-align: left; vertical-align: top; padding: 0.2em 1em 0.2em 0; color: var(--infobox-title-color);">Website</th><td style="padding: 0.2em 0;">{{{website}}}</td></tr> }}
    </table>
  </div>
</div>
</includeonly>
</includeonly>
<noinclude>
<noinclude>
<!--
== Example Usage ==
  This is the demo/documentation block.  It does NOT appear when another
Paste this into a page to see the infobox:
  page calls {{User:Layer-09/Sandbox/Infobox Emacs|…}}.
-->
 
== Usage Example ==
Paste this on any article (e.g. “Emacs”):


<pre>
<pre>
{{User:Layer-09/Sandbox/Infobox Emacs
{{User:Layer-09/Sandbox/Infobox Emacs
| clip    = 1
  | title                   = GNU Emacs
  | title   = Emacs
  | image                   = EmacsIcon.svg
  | image   = EmacsIcon.svg
  | paradigm                = Functional, meta, reflective
  | content =  
| family                  = Lisp
  <!-- replace this <ul>…</ul> with whatever HTML/wikitext content you need -->
| designed_by            = [[Richard Stallman]], [[Guy L. Steele, Jr.]]
  <ul>
| developer              = [[GNU Project]]
    <li>Developer: [[Free Software Foundation]]</li>
| first_appeared          = 1985; 40 years ago
    <li>Initial release: 1976</li>
| stable_release          = 29.4 / 22 June 2024; 11 months ago
    <li>Latest release: 29.2 (April 12 2024)</li>
| os                      = Cross-platform
    <li>Written in: C, Emacs Lisp</li>
| license                = [[GNU General Public License]]
    <li>OS: Cross‑platform</li>
| filename_extensions    = .el, .elc, .eln
    <li>License: [[GNU General Public License]]</li>
  | website                = [https://www.gnu.org/software/emacs gnu.org/emacs]
  </ul>
  | footer  = [https://www.gnu.org/software/emacs gnu.org/emacs]
}}
}}
</pre>
</pre>
*Notes:* 
1. The `clip` parameter controls whether the “slanted” separator appears (`clip` nonempty → clipped; blank/omitted → straight). 
2. Everything inside `<includeonly>…</includeonly>` is what actually gets transcluded; the `<noinclude>` block here is only visible if you open this page directly.
</noinclude>
</noinclude>

Latest revision as of 15:34, 5 June 2025


Example Usage

Paste this into a page to see the infobox:

{{User:Layer-09/Sandbox/Infobox Emacs
 | title                   = GNU Emacs
 | image                   = EmacsIcon.svg
 | paradigm                = Functional, meta, reflective
 | family                  = Lisp
 | designed_by             = [[Richard Stallman]], [[Guy L. Steele, Jr.]]
 | developer               = [[GNU Project]]
 | first_appeared          = 1985; 40 years ago
 | stable_release          = 29.4 / 22 June 2024; 11 months ago
 | os                      = Cross-platform
 | license                 = [[GNU General Public License]]
 | filename_extensions     = .el, .elc, .eln
 | website                 = [https://www.gnu.org/software/emacs gnu.org/emacs]
}}