Implement a basic encyclopedia page #6997

Open
Vantha wants to merge 4 commits from Vantha/0ad:encyclopedia into main
Member

Continuation from D5319

Continuation from [D5319](https://code.wildfiregames.com/D5319)
Vantha added 1 commit 2024-08-29 12:52:52 +02:00
Implement a basic encyclopedia page
Some checks failed
0ad-freebsd/pipeline/pr-main There was a failure building this commit
checkrefs / checkrefs (pull_request) Successful in 51s
pre-commit / build (pull_request) Successful in 1m6s
0ad-linux/pipeline/pr-main There was a failure building this commit
0ad-windows/pipeline/pr-main There was a failure building this commit
0ad-macos/pipeline/pr-main There was a failure building this commit
dfe5e5f369
Vantha requested review from Stan 2024-08-29 12:52:52 +02:00
Vantha requested review from Imarok 2024-08-29 12:52:52 +02:00
Vantha requested review from s0600204 2024-08-29 12:52:52 +02:00
Vantha requested review from wraitii 2024-08-29 12:52:52 +02:00
Vantha requested review from marder 2024-08-29 12:52:52 +02:00
Vantha requested review from wowgetoffyourcellphone 2024-08-29 12:52:52 +02:00
Vantha requested review from wackyserious 2024-08-29 12:52:52 +02:00
Vantha removed review request for wackyserious 2024-08-29 12:53:20 +02:00
Vantha removed review request for marder 2024-08-29 12:53:21 +02:00
Vantha removed review request for s0600204 2024-08-29 12:53:23 +02:00
Vantha removed review request for Stan 2024-08-29 12:53:24 +02:00
Vantha removed review request for wowgetoffyourcellphone 2024-08-29 12:53:29 +02:00
Vantha removed review request for wraitii 2024-08-29 12:53:31 +02:00
Vantha removed review request for Imarok 2024-08-29 12:53:32 +02:00
Vantha force-pushed encyclopedia from dfe5e5f369 to 46345299ac 2024-09-04 11:42:24 +02:00 Compare
Author
Member

Explanation (adopted from the diff on Phabrictor):

This diff contains a version of the encyclopedia page with the basic functionality of navigating through the directory tree and reading articles. It will likely not be committed here on Phabricator, but I want to open the discussion and get the stone rolling. After the migration to git, I will transfer the changes to a git pull request with a link to this diff.

Explanation of the code:

  • The encyclopedia directory tree is stored in EncyclopediaStructure.js. It is divided into three layers: categories (About this Encyclopedia, Nature and Environment, 0 A.D.'s civilizations, etc.), subcategories, and the articles themselves.

  • The NavigationPanel is the long bar on the right and contains buttons to select categories.

  • After doing so, the IntroductionPanel displays the individual category (with a title and an introduction) and provides buttons to select a subcategory. The civilization category is an exception: When opening it, no specific civilization is selected and no subcategory buttons are shown. Instead a civilization selection dropdown is given in the top right. Only after selecting one are subcategory options provided. (All that is still handled by the IntroductionPanel)

  • After selecting one, the subcategory's articles are listed in the SelectionPanel.

  • After double clicking one of article titles, the corresponding article is opened in the ArticlePanel (currently comprised of only a title and a text).

Some other notes:

  • at the moment only '0 A.D.'s civilizations' -> 'Athenians' -> 'military' actually contains articles. They are only included for testing purposes and will not be part of the commit. The articles will be added in a PR.
  • most strings are not being translated yet. If it's ok, I'll take care of that in a future diff / PR as well.
  • capitalization of title or button captions is currently somewhat inconsistent, I'm not sure what line to follow.
  • the color naming is not consistent (e.g. mattbrown vs lightbrown vs beige)
  • the number of JSON reading requests is not totally minimized: article files are actually read twice in the process of being opened - once in the SelectionPanel and once in the ArticlePanel. With regards to future features as well: How important is that?
  • storing the introduction texts in .txt files is suboptimal. I could convert them into JSONs, but some would stay really short, and from a logical standpoint, they currently don't need to be written in object notation. (I converted the into JSONs)
  • the JSON file type is not set into stone, I could quite easily convert them into XML if that's preferred.
  • the fonts were created with the fontbuilder tool.
### Explanation (adopted from the diff on Phabrictor): This diff contains a version of the encyclopedia page with the basic functionality of navigating through the directory tree and reading articles. ~~It will likely not be committed here on Phabricator, but I want to open the discussion and get the stone rolling. After the migration to git, I will transfer the changes to a git pull request with a link to this diff.~~ **Explanation of the code:** - The encyclopedia directory tree is stored in EncyclopediaStructure.js. It is divided into three layers: categories (About this Encyclopedia, Nature and Environment, 0 A.D.'s civilizations, etc.), subcategories, and the articles themselves. - The NavigationPanel is the long bar on the right and contains buttons to select categories. - After doing so, the IntroductionPanel displays the individual category (with a title and an introduction) and provides buttons to select a subcategory. The civilization category is an exception: When opening it, no specific civilization is selected and no subcategory buttons are shown. Instead a civilization selection dropdown is given in the top right. Only after selecting one are subcategory options provided. (All that is still handled by the IntroductionPanel) - After selecting one, the subcategory's articles are listed in the SelectionPanel. - After double clicking one of article titles, the corresponding article is opened in the ArticlePanel (currently comprised of only a title and a text). **Some other notes:** - at the moment only '0 A.D.'s civilizations' -> 'Athenians' -> 'military' actually contains articles. They are only included for testing purposes and will not be part of the commit. The articles will be added in a PR. - most strings are not being translated yet. If it's ok, I'll take care of that in a future diff / PR as well. - capitalization of title or button captions is currently somewhat inconsistent, I'm not sure what line to follow. - the color naming is not consistent (e.g. mattbrown vs lightbrown vs beige) - the number of JSON reading requests is not totally minimized: article files are actually read twice in the process of being opened - once in the SelectionPanel and once in the ArticlePanel. With regards to future features as well: How important is that? - ~~storing the introduction texts in .txt files is suboptimal. I could convert them into JSONs, but some would stay really short, and from a logical standpoint, they currently don't need to be written in object notation.~~ (I converted the into JSONs) - the JSON file type is not set into stone, I could quite easily convert them into XML if that's preferred. - the fonts were created with the fontbuilder tool.
Author
Member

Why are some pipelines failing? Does it have to do with the code? I can't tell from the logs.

Why are some pipelines failing? Does it have to do with the code? I can't tell from the logs.
Vantha added 1 commit 2024-09-05 23:52:11 +02:00
Cleaning some messed up files
Some checks failed
0ad-freebsd/pipeline/pr-main There was a failure building this commit
pre-commit / build (pull_request) Failing after 59s
checkrefs / checkrefs (pull_request) Successful in 56s
0ad-linux/pipeline/pr-main There was a failure building this commit
0ad-windows/pipeline/pr-main There was a failure building this commit
0ad-macos/pipeline/pr-main There was a failure building this commit
d05f0b0904
Author
Member

I know this pull request is huge... but could someone take some time to review the code?

I know this pull request is huge... but could someone take some time to review the code?
Vantha force-pushed encyclopedia from d05f0b0904 to 3eb27322ea 2024-09-10 12:46:06 +02:00 Compare
Vantha added the
Theme
UI & Simulation
label 2024-09-13 12:28:06 +02:00
Some checks failed
0ad-freebsd/pipeline/pr-main There was a failure building this commit
0ad-linux/pipeline/pr-main There was a failure building this commit
Required
Details
checkrefs / checkrefs (pull_request) Successful in 58s
Required
Details
0ad-macos/pipeline/pr-main There was a failure building this commit
pre-commit / build (pull_request) Failing after 1m3s
Required
Details
0ad-windows/pipeline/pr-main There was a failure building this commit
Some required checks were not successful.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u encyclopedia:Vantha-encyclopedia
git checkout Vantha-encyclopedia
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: 0ad/0ad#6997
No description provided.