Talk:WikiPages

From FreeCAD Documentation
Jump to navigation Jump to search

Refinements

Here is a list of thing not mentioned or are mentioned but not particularly in enough detail:

Template Linting

Wikipedia writes the definition of Linting is:

lint, or a linter, is a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs.

Linting is this context is making sure the markup structure of the mediawiki formatting is correct and uniform.

  • Long templates like {{GuiCommand}} and {{Docnav}} need the following:
  • Capitalized names of the template: example: It's {{Docnav}} not {{docnav}}
  • Each variable in the the templates should be written on it's own separate line for readability.
Incorrect:
{{GuiCommand|Name:Part Box/Cube||Icon=Part_Box.svg||MenuLocation=Part → Primitives → Cube|Workbenches=[[Part Module|Part]]|SeeAlso=[[Part_CreatePrimitives|Part CreatePrimitives]]}}
Correct:
{{GuiCommand
|Name=Part Box/Cube
|Icon=Part_Box.svg
|MenuLocation=Part  Primitives  Cube
|Workbenches=[[Part Module|Part]]
|SeeAlso=[[Part_CreatePrimitives|Part CreatePrimitives]]
|Version=?
}}
  • Note: A common issue is the "|" (Verical bar or Pipe) character doesn't always mean to start a newline. See for example above: |SeeAlso=[[Part_CreatePrimitives|Part CreatePrimitives]] the "|" here is used to display the Part CreatePrimitives page without the underscore "_" in it's name (sidenote: which BTW is not necessary: [[Part CreatePrimitives|Part CreatePrimitives]] is perfectly legal as well, but we digress...), therefore it's important to make the distinction when the "|" is used.
  • The {{Docnav}} template (AKA Document Navigation or Navbar) on most of the pages it is used on, will be mentioned 2 times. One at the top of the page and one at the bottom. Sometimes Authors/Translators forget this. Please remember to address both {{Docnav}} templates
  • {{Docnav}} template in different contexts may look like it's missing fields. It most likely isn't since it may be that the page the Docnav is diplsaying is the beginning or the end of a sequence of pages.
Lets use the Part Box/Cube example. Looking at the source we see a solitary "|" (Vertical bar or Pipe) for the first field. Several lines down we also see the ❘IconL= ) (IconLeft) field doesn't have a value. This means that this page is the start of the list of commands available for the Part Workbench. Part Box/Cube is first in line and has no other Part commands preceding it. Therefore the navbar has the IconLeft field purposely omitted.
{{Docnav
|
|[[Part_Cone|Cone]]
|[[Part_Module|Part]]
|IconL=
|IconC=Workbench_Part.svg
|IconR=Part_Cone.svg
}}