documentation.txt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From inside the client you can run:
  2. - docwritebaseref
  3. and
  4. - docwritetodoref
  5. By passing "1" it'll write all idents, but that includes stuff like "_CAS_serverpass" and "__DEFAULT_SCOREBOARD", so only look into that list if you feel something was missed without it.
  6. - docwritetodoref 1
  7. There's no real automation for incorporating these snippets, you will need to find the proper section to place them in and collect all the required properties.
  8. You may encounter html-like-entities, like "gt;" (not "&gt;"!) in the autogenerated lists – the reference.xml would have "gt;=" as '''<command name=">=">''' in plain.
  9. The established documentation does not adhere to any specific order of the properties; we would suggest to stick to one though and possibly fix the order if you see something not matching it.
  10. Here's a set of fictional fully expanded examples:
  11. <variable name="settingsvalue">
  12. <description>Keep the value of <i>that</i> setting.</description>
  13. <remarks>
  14. <remark>A value between negative and positive infinity.</remark>
  15. </remarks>
  16. <examples>
  17. <example>
  18. <code>-1001, -3.1415, -1, 2, 6.28, 2002, …</code>
  19. </example>
  20. </examples>
  21. <value token="A" description="apparently a number" minValue="-∞" maxValue="+∞" defaultValue="0"/>
  22. <references>
  23. <identifierReference identifier="valuesettings"/>
  24. </references>
  25. </variable>
  26. <scriptalias name="add2alias">
  27. <!-- like command below -->
  28. </scriptalias>
  29. <command name="workworkwork">
  30. <description>Performs some work.</description>
  31. <remarks>
  32. <remark>This takes the potential and releases it's energy.</remark>
  33. <remark>2nd law of thermodynamics applies.</remark>
  34. </remarks>
  35. <defaultKeys>
  36. <key alias="F123" description="please do not press this button again"/>
  37. </defaultKeys>
  38. <examples>
  39. <example>
  40. <code><![CDATA[echo (workworkwork 42)]]></code>
  41. <explanation>Output: 41</explanation>
  42. </example>
  43. </examples>
  44. <remarks>
  45. <remark>
  46. Example: echo the energy of 1kg of sugar is (workworkwork 123456 "sugar rush")
  47. </remark>
  48. </remarks>
  49. <arguments>
  50. <argument token="A" description="the energy"/>
  51. <argument token="B" description="some comment"/>
  52. </arguments>
  53. <return token="N" description="the energy"/>
  54. <references>
  55. <identifierReference identifier="lazysundayafternoon"/>
  56. </references>
  57. </command>
  58. For comparing established documentation and autogenerated I used this (on *nix):
  59. while read begriff; do
  60. zahl=$(grep -c "name=\"${begriff}\"" docs/reference.xml);
  61. if [ $zahl -eq 0 ]; then
  62. echo $begriff;
  63. fi;
  64. done < <(grep name= docs/autogenerated_base_reference.xml|sed 's/^.*name="\([^"]*\)".*$/\1/')