ghwikipp icon indicating copy to clipboard operation
ghwikipp copied to clipboard

Add category sub-lists for enums and structs

Open zturtleman opened this issue 1 year ago • 0 comments

Add enum and struct sub-lists for category pages for SDL wiki.

Sub-lists are defined at the top of file as a list name (for <!-- BEGIN ENUM LIST -->) and category (CateoryEnum).

On category pages, pages that are also in a category of a sub-list are only displayed in the sub-list. The main list is all pages in the category that are not in a sub-list (e.g., CategoryEnum or CategoryStruct).

Page example:

## Enums
<!-- BEGIN ENUM LIST -->
<!-- END ENUM LIST -->

## Structs
<!-- BEGIN STRUCT LIST -->
<!-- END STRUCT LIST -->

## Functions
(everything else)
<!-- BEGIN CATEGORY LIST -->
<!-- END CATEGORY LIST -->

For local testing purposes, the following commands replace (most) MoinMoin list placeholders in sdlwiki. Afterward running ghwikipp build_categories.php will put (most) of the lists in the correct place on the page:

cd sdlwiki
sed -i "s/^<<FullSearchCached([^-]*CategoryEnum.*)>>$/<!-- BEGIN ENUM LIST -->\n<!-- END ENUM LIST -->/" SDL[23]/Category*
sed -i "s/^<<FullSearchCached([^-]*CategoryStruct.*)>>$/<!-- BEGIN STRUCT LIST -->\n<!-- END STRUCT LIST -->/" SDL[23]/Category*
# remove old function/default list placeholder
sed -i "s/^<<FullSearchCached(.*-CategoryEnum.*-CategoryStruct.*)>>$//" SDL[23]/Category*

zturtleman avatar Mar 25 '23 02:03 zturtleman