wiki_admin.adoc 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. = Wiki Admin
  2. :author: mitm
  3. :revnumber: 1.0
  4. :revdate: 2020/07/25
  5. == Overview
  6. The wiki consists of two repositories.
  7. * link:https://github.com/jMonkeyEngine/wiki[wiki]
  8. * link:https://github.com/jMonkeyEngine/wiki-ui[wiki-ui]
  9. The wiki repository holds all documentation while the wiki-ui repository is the user interface for the documentation.
  10. == Wiki
  11. The wiki repository has a workflow that will be triggered when any push is made to the repository or whenever the user interface issues a new release. Every build, all pages are deleted and re-created. The workflow will cache the user interface under the `menu:cache[antora]` directory if there are any changes. This cache allows the build process to run offline.
  12. The workflow can be configured to update the `package-lock` and `package.json` files by editing the `Install node` command, just as if you were running this from a local repo.
  13. DO NOT UPDATE OR PUSH THESE FILES UNLESS YOU DISCUSS IT WITH THE OTHER ADMINISTRATORS FIRST!
  14. The `supplemental-ui` folder holds the content for Anotra search, the header and footer for the ui. Edit these as needed in the wiki repository, but *do not edit* these same files on the `wiki-ui` repository.
  15. Technically, the entire ui can be configured from the wiki repo.
  16. The wiki is an link:https://docs.antora.org/antora/2.3/[Antora] site using the link:https://asciidoctor.org/docs/user-manual/[asciidoctor] syntax. A quick primer for syntax can be found link:https://docs.antora.org/antora/2.3/asciidoc/asciidoc/[here].
  17. == Source files
  18. The source structure is now modularized.
  19. * ROOT - holds content that introduces new users to the jMonkyEngine, installing and features.
  20. * core - this is the main module for any content that is *specific* to an existing jMonkeyEngine class. It maintains similar directories as are found in the jMonkeyEngine link:https://github.com/jMonkeyEngine/jmonkeyengine[repository].
  21. * networking - holds content *specific* to jMonkeyEngine networking.
  22. * physics - holds content *specific* to jMonkeyEngine physics.
  23. * tutorials - holds any content that is *not specific* to any jMonkeyEngine class, may be a generalized concept, may give direction on how to use the engine, or an article of some type about an engine feature.
  24. * sdk - sdk content only. This module may be moved to the sdk repository in the future.
  25. * contributions - existing user project pages. This is a deprecated module and will be removed in the near furture. Do not add new content to this module.
  26. You can decide if a page belongs in the core module by asking yourself a simple question.
  27. _Does the page explain an existing jMonkeyEngine class (excluding physics and networking) found in the jMonkeyEngine repository, without using an external application?_
  28. If yes, then it belongs, otherwise it needs to go someplace else.
  29. == Broken link checking
  30. There is a workflow that can be used to check for broken links.
  31. link:https://github.com/mitm001/link-checker/blob/master/.github/workflows/main.yml[link-checker]
  32. To use it, simply create a repository, paste a copy of the workflow into the `menu:github[workflows]` directory. Before commiting for the first time, set the link:https://github.com/mitm001/link-checker/blob/abddf3d5012b90186ae485073a8c1aaf15a3c447/.github/workflows/main.yml#L25[repo url] to point to the wiki.
  33. If there are any errors, a `linkchecker.md` or `unresolved.md` file will be committed to your repository under the `checked-links` directory. You may need to issue a pull request after a push because of this. The typical workflow consists of fixing reported broken links, deleting all `.md` files and pushing to the repo. Then issue a pull request to see if there are any remaining problems. These files will only be built if there are errors.
  34. If there are no files in the `link-checker` directory and you need to run a check, just create any new file in the `link-checker` directory and push it.
  35. The reason for two files is that the `peter-evans/link-checker@v1` action is not capable of reading relative links properly. This is the only action that is available currently. However, we are in luck in that the Anotora build will set a class on any relative link that fails named `class="page unresolved"`. We can then use a grep command to parse the gh-pages branch and find any file with this class and write it to file.
  36. This is an example of the output for a broken relative link.
  37. ```
  38. tutorials/beginner/hello_collision.html:1289:<p>For a detailed description of the separate jar files see
  39. <a href="#getting-started/jme3_source_structure.adoc#structure-of-jmonkeyengine3-jars"
  40. class="page unresolved">this list</a>.</p>
  41. ```
  42. This gives you the file name:
  43. ```
  44. tutorials/beginner/hello_collision.html
  45. ```
  46. and the name of the broken link to search for in the file:
  47. ```
  48. #getting-started/jme3_source_structure.adoc#structure-of-jmonkeyengine3-jars
  49. ```
  50. All broken links start with a kbd:[#] sign. In this instance, we have an inter document link thats broken as there are two pound signs.
  51. The `peterevans` action will locate all broken image and web urls. There is a problem though that prevents its full use, which is running this on a schedule and automatically opening issues. When Antora builds a site, it will build links from the "`nav-menu`" and "`Table of Contents`" into every page. This will lead to `Too Many Requests (HTTP error 429)` errors. The easiest way to get around this would be to filter the href attribute class for the `nav-link` class, since we know these links are good, and skip them. This is currently not possible using the `petereveans` action. To work around it, just search the `linkchecker.md` for `file or directory` errors.
  52. == User Interface
  53. The `wiki-ui` repository has two workflows. A workflow that will build on any push (main.yml), and one that builds on pushing a tag (release.yml). If you push any tag to the master branch, a release will be created, triggering the wiki build, thereby updating the wiki cache and user interface for the wiki.
  54. This will allow you to make changes to the ui without triggering a build unless you are ready.
  55. The user interface uses standard html in its templates so editing should be familiar to anyone who knows html.
  56. == Versioning
  57. The wiki uses branches for versioning. The current branch being used for the jMonkeyEngine is *always* the master branch of the wiki. This means you use the previous branch of the jMonkeyEngine for the new versioned branch name. If the current *wiki version* is targeting 3.3 and you are creating a new version, then the new version branch would be v3.3. Branch version names should only target major/minor releases, not the patch of a version.
  58. When it's time to cut a new version for the wiki, the process is as follows.
  59. IMPORTANT: A component module is a module that has an `antora.yml` file. A named module lives inside a component module. The version in the `antora.yml` file controls the version for the component module i.e. the wiki, not the version in the `wiki-playbook.yml`.
  60. . We do not want the Antora cache to be versioned so you need to first remove the cache from the `Commit Packages` command in the main.yml workflow, located in the `.github/workflows` directory.
  61. +
  62. ```
  63. # Commits these files to root if and only if there are changes.
  64. add: "package-lock.json package.json ./.cache/antora/*"
  65. ```
  66. . Next, delete the `.cache` folder.
  67. . Stage, commit and push your changes to the repository.
  68. . Create a new branch that matches the *current version* of the wiki. If master is currently targeting 3.2 for example, that would mean the branch name would be v3.2.
  69. . Push the branch to the repository.
  70. . On the `master` branch, edit these files:
  71. .. Add the newly created branch to the `branches:` array in wiki-playbook.yml.
  72. +
  73. .wiki-playbook.yml
  74. ```
  75. content:
  76. sources:
  77. - url: https://github.com/jMonkeyEngine/wiki.git
  78. branches: [HEAD, v3.2]
  79. ```
  80. .. Increment the version of any antora.yml file. At the time of this writing, there were two:
  81. +
  82. --
  83. .The docs antora.yml
  84. ```
  85. name: docs
  86. title: JME
  87. version: '3.3'
  88. ```
  89. and
  90. .The docs-wiki antora.yml
  91. ```
  92. name: docs-wiki
  93. title: Wiki Contribution
  94. version: '3.3'
  95. ```
  96. NOTE: The version value is enclosed in a set of single quote marks (') because it starts with a number. As was mentioned earlier, the versioning is controlled by the antora.yml file, not the playbook, so they do not have to match.
  97. --
  98. . Edit any links found in the `README.adoc`, located in the root of the repository, that are versioned, so they match the version value you just set in the `antora.yml` file.
  99. . Add `./.cache/antora/*` back to the `Commit Packages` command to rebuild the cache.
  100. . Stage, commit and push the changes to the repository.
  101. Things to know about versions and component modules.
  102. If a version isn't specified in the target page ID (pass:[xref:[email protected]][link text]), and the target and current pages belong to a different docs components, Antora will use the latest version of the target component to complete the page ID.
  103. At the time of this writing, we have two links in the `docs` module (documentation.adoc page) that link to the `docs-wiki` module and one that points from the `docs-wiki` module to the `docs` module license.
  104. Since this is a wiki module, we would want to point to the most current content so not versioning them is the best approach.