User:Johan G/Template:Informative template with preloaded text: Difference between revisions

Jump to navigation Jump to search
*Intermediate break* trying to get correct parts rendering in correct circumstance and setting up error messages to help users troubleshoot
m (fix: Broken link to preload text)
(*Intermediate break* trying to get correct parts rendering in correct circumstance and setting up error messages to help users troubleshoot)
Line 1: Line 1:
<noinclude>
{{userpage draft|template|See also [[User talk:Johan G/Template:Informative template with preloaded text|discussion page]]}}
<!--
<!--


THIS IS HIGHLY EXPERIMENTAL
THIS IS EXPERIMENTAL


The main purpose (currently) is to see
Se discussion page
* If it is feasible to make a documentation template that allow for
  * One click loading of a new page with preloaded text with
    * A skeleton for writing documentation


If this _is_ feasible, the next question is:
-->
  * If it is feasible to rewrite current documentation (about 560 pages)?
<nowiki>1 is not empty
  * By hand or automated?
  use 1
  doc is empty
    /doc exist
      use /doc
    /doc do not exist
  doc is not empty
    doc point to /doc
      use doc
    doc do not point to /doc
      use doc
      throw error
1 is empty
  doc is empty
    /doc exist
      use /doc
    /doc do not exist
      encourage writing doc
  doc is not empty
    doc point to /doc
      use doc
    doc do not point to /doc
      use doc
      throw error</nowiki>
 
<nowiki>[[{{FULLPAGENAME}}/doc]]</nowiki>
[[{{FULLPAGENAME}}/doc]]
 
<nowiki>{{#ifexist: {{{doc|-{{FULLPAGENAME}}/doc}}} <!-- Does /doc or page in doc exist? -->
| Yes, /doc or page in doc exist
yes
| No, /doc or page in doc does not exist
no
}}</nowiki>
{{#ifexist: {{{doc|-{{FULLPAGENAME}}/doc}}}
|
yes
|
no
}}
 
  <nowiki>{{#ifeq: {{{doc|-{{FULLPAGENAME}}/doc}}} | {{FULLPAGENAME}}/doc <!-- If defined, does doc point to /doc? -->
|
equal
|
{{error|Page '''{{FULLPAGENAME}}/doc''' exist, but parameter '''doc''' points to '''{{{doc}}}'''|User:Johan G/Template:Informative template with preloaded text}}
}}</nowiki>
{{#ifeq: {{{doc|-{{FULLPAGENAME}}/doc}}} | {{FULLPAGENAME}}/doc
|
equal
|
{{error|Page '''{{FULLPAGENAME}}/doc''' exist, but parameter '''doc''' points to '''{{{doc}}}'''|User:Johan G/Template:Informative template with preloaded text}}
}}


--><noinclude>
{{userpage draft|template|See also comments in the source}}
</noinclude><includeonly>
</noinclude><includeonly>
__NOEDITSECTION__
__NOEDITSECTION__
__NOTOC__
__NOTOC__
<div class="sjabdocnoot" style="color:grey; text-align:center; margin-top:1em;"><small>'''The following template description is not displayed when the template is inserted in an article.'''</small></div>
<div class="sjabdocnoot" style="color:grey; text-align:center; margin-top:1em;"><small>'''The following template description is not displayed when the template is inserted in an article.'''</small></div><!--
{{#if: {{{1|{{{doc|{{#ifexist: {{FULLPAGENAME}}/doc | yes}}}}}}}} <!-- Is both 1= and doc= empty and there is no /doc subpage? -->
 
   | <!-- No, at least one of them is is there. -->
-->1{{#if: {{{1|{{#ifexist: {{{doc|{{FULLPAGENAME}}/doc}}} | yes}} }}} <!-- Are 1 or doc defined or /doc exists? -->
   | <!-- Yes, 1 or doc defined or /doc exists -->
<div class="toccolours template-documentation" style="background: #FFFFEE; border: 1px solid #FFDAB9;font-size:100%">
<div class="toccolours template-documentation" style="background: #FFFFEE; border: 1px solid #FFDAB9;font-size:100%">
<div style="padding-bottom: 3px; border-bottom: 1px solid #aaa; margin-bottom: 1ex; line-height: 1.6">
<div style="padding-bottom: 3px; border-bottom: 1px solid #aaa; margin-bottom: 1ex; line-height: 1.6">
<span style="font-weight: bold; font-size: 125%">Template documentation</span>
<span style="font-weight: bold; font-size: 125%">Template documentation</span><!--
{{#if: {{{doc|}}} <!-- Is documentation transcluded from another page -->
-->3{{#ifexist: {{{doc|{{FULLPAGENAME}}/doc}}}  <!-- Is doc defined or /doc exists? -->
|  <!-- Yes, documentation is transluded form another page -->
  |  <!-- Yes, doc is defined or /doc exists -->
<span class="plainlinks" style="font-size: small">
<span class="plainlinks" style="font-size: small">
[
[
[{{{doc|{{fullurl:{{FULLPAGENAME}}/doc}}}}} View]
[{{{doc|{{fullurl:{{FULLPAGENAME}}/doc}} }}} View]
]
]
[
[
[{{{doc|{{fullurl:{{FULLPAGENAME}}/doc|action=edit}}}}} Edit]
[{{{doc|{{fullurl:{{FULLPAGENAME}}/doc|action=edit}} }}} Edit]
]
]
[
[
[{{{doc|{{fullurl:{{FULLPAGENAME}}/doc|action=history}}}}} History]
[{{{doc|{{fullurl:{{FULLPAGENAME}}/doc|action=history}} }}} History]
]
]
[
[
[{{{doc|{{fullurl:{{FULLPAGENAME}}/doc|action=purge}}}}} Purge]
[{{{doc|{{fullurl:{{FULLPAGENAME}}/doc|action=purge}} }}} Purge]
]</span>
]
}}
</span><!--
-->}}4
</div>
</div>
{{{1|}}}
{{{1|}}}
{{{{{doc|{{FULLPAGENAME}}/doc}}}}}
{{ {{{doc|{{FULLPAGENAME}}/doc}}} }}
</div>
</div>
{{#if: {{{doc|}}} <!-- Is documentation transcluded from another page -->
|  <!-- Yes, documentation is transluded form another page -->
<div class="toccolours template-documentation" style="background: #FFFFEE; border: 1px solid #FFDAB9;font-size:100%">
<div class="toccolours template-documentation" style="background: #FFFFEE; border: 1px solid #FFDAB9;font-size:100%">
The above documentation is transcluded from [[{{{doc|{{FULLPAGENAME}}/doc}}}]]. <span class="plainlinks">([{{{doc|{{fullurl:{{FULLPAGENAME}}/doc|action=edit}}}}} Edit] {{!}} [{{{doc|{{fullurl:{{FULLPAGENAME}}/doc|action=history}}}}} History])</span>
The above documentation is transcluded from [[{{{doc|{{FULLPAGENAME}}/doc}}}]]. <span class="plainlinks">([{{{doc|{{fullurl:{{FULLPAGENAME}}/doc|action=edit}} }}} Edit] {{!}} [{{{doc|{{fullurl:{{FULLPAGENAME}}/doc|action=history}} }}} History])</span><!--
{{#if: {{{link box|}}}
-->5{{#if: {{{link box|}}}
 
|
|
</br>
</br>
{{{link box}}}
{{{link box}}}<!--
}}
-->}}6
}}
  | <!-- No, neither 1 or doc defined or /doc exists, ask the reader to write documentation -->
</div>
<div class="toccolours template-documentation" style="background: #FFFFEE; border: 1px solid #FFDAB9;font-size:100%">
| <!-- Yes, none of them is there.  Throw a message to the reader. -->
<div class="toccolours template-documentation" style="background: #FFFFEE; border: 1px solid #FFDAB9;font-size:100%;">
[{{fullurl:{{FULLPAGENAME}}/doc|action=edit&preload=User:Johan_G/Template:Informative_template_with_preloaded_text/preload_text}} Click here to create documentation for this template].
[{{fullurl:{{FULLPAGENAME}}/doc|action=edit&preload=User:Johan_G/Template:Informative_template_with_preloaded_text/preload_text}} Click here to create documentation for this template].
</div>
</div>
}}
}}2</includeonly><noinclude>
 
</includeonly><noinclude>
{{User:Johan G/Template:Informative template with preloaded text}}
{{User:Johan G/Template:Informative template with preloaded text}}
</noinclude><!--
</noinclude>
TODO
 
* [{{fullurl:{{FULLPAGENAME}}/doc|action=edit&preload=User:Johan G/Template:Informative template with preloaded text/preloaded text}} Create documentation]
  See https://www.mediawiki.org/wiki/Manual:Creating_pages_with_preloaded_text#Loading_the_preload_file
  and https://www.mediawiki.org/wiki/Manual:Parameters_to_index.php#Options_affecting_the_edit_form
* Parameters 1, content= and link box=
* View, Edit, History and Purge buttons
* Separate documentation/style guide in either the documentation or as a separate page in the FlightGear wiki namespace.
* Unknowns
 
It seems that to be able to add documentation through preloading, you must add it as a separate page or as a new section.  Will this mean that all template documentation have to be painstakingly rewritten (that is about 560 pages currently)?  If so this will probably not be feasible. :-(
-->

Navigation menu