Skip to content

Commit

Permalink
Initial UPE Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarklord committed Jan 17, 2024
1 parent 02eda82 commit 25584ff
Show file tree
Hide file tree
Showing 14 changed files with 307 additions and 0 deletions.
127 changes: 127 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Build documentation

on:
# If specified, the workflow will be triggered automatically once you push to the `main` branch.
# Replace `main` with your branch’s name
push:
branches: ["gh-pages"]
# Specify to run a workflow manually from the Actions tab on GitHub
workflow_dispatch:

# Gives the workflow permissions to clone the repo and create a page deployment
permissions:
id-token: write
pages: write

env:
INSTANCE: Writerside/upe
ARTIFACT: webHelpUPE2-all.zip
# Writerside docker image version
DOCKER_VERSION: 233.4797

ALGOLIA_ARTIFACT: algolia-indexes-UPE.zip
ALGOLIA_APP_NAME: 5PWXFRPMT2
ALGOLIA_INDEX_NAME: UniversalPropertyEnhancer
ALGOLIA_KEY: ${{ secrets.ALGOLIA_KEY }}
CONFIG_JSON_PRODUCT: UPE

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build Writerside docs using Docker
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}

- name: Upload documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 7

# Add the step below to upload Algolia indexes
- name: Upload algolia-indexes
uses: actions/upload-artifact@v3
with:
name: algolia-indexes
path: artifacts/${{ env.ALGOLIA_ARTIFACT }}
retention-days: 7

# Add the job below and artifacts/report.json on Upload documentation step above if you want to fail the build when documentation contains errors
test:
# Requires build job results
needs: build
runs-on: ubuntu-latest

steps:
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: docs
path: artifacts

- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Requires the build job results
needs: test
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs

- name: Unzip artifact
run: unzip -O UTF-8 -qq ${{ env.ARTIFACT }} -d dir

- name: Setup Pages
uses: actions/configure-pages@v2

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: dir

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

publish-indexes:
# Requires the build-job results
needs: build
runs-on: ubuntu-latest
container:
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-2

steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: algolia-indexes
- name: Unzip artifact
run: |
unzip -O UTF-8 -qq ${{ env.ALGOLIA_ARTIFACT }} -d algolia-indexes
env "algolia-key=${{env.ALGOLIA_KEY}}" java -jar /opt/builder/help-publication-agent.jar \
update-index \
--application-name ${{env.ALGOLIA_APP_NAME}} \
--index-name ${{env.ALGOLIA_INDEX_NAME}} \
--product ${{env.CONFIG_JSON_PRODUCT}} \
--index-directory algolia-indexes/ \
2>&1 | tee algolia-update-index-log.txt
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/UPEDocs.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Writerside/c.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE categories SYSTEM "https://resources.jetbrains.com/writerside/1.0/categories.dtd">
<categories>
<category id="external" name="External resources" order="1"/>
<category id="features" name="Mod Features" order="2"/>
</categories>
19 changes: 19 additions & 0 deletions Writerside/cfg/buildprofiles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<buildprofiles xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-profiles.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<variables>
<algolia-api-key>27d4a07e94debd4132df703014b6e331</algolia-api-key>
</variables>
<build-profile instance="upe">
<variables>
<algolia-id>5PWXFRPMT2</algolia-id>
<algolia-index>UniversalPropertyEnhancer</algolia-index>
<noindex-content>false</noindex-content>
<web-root>https://zarklord.github.io</web-root>
<primary-color>strawberry</primary-color>
</variables>
<footer>
<copyright>Zarklord 2018-2024</copyright>
</footer>
</build-profile>
</buildprofiles>
12 changes: 12 additions & 0 deletions Writerside/topics/Documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Documentation

You can find developer documentation for Universal Property Enhancer here.

<seealso style="cards">
<category ref="features">
<a href="Property-Replacement.md"/>
<a href="Property-Postinits.md"/>
<a href="Property-List-Duplication.md"/>
<a href="Palette-Icons.md"/>
</category>
</seealso>
78 changes: 78 additions & 0 deletions Writerside/topics/Palette-Icons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Palette Icons
<link-summary>Use UPE to add custom palette icons to your part pages</link-summary>
<web-summary>Use UPE to add custom palette icons to your part pages</web-summary>
<card-summary>Use UPE to add custom palette icons to your part pages</card-summary>

All palette icon data is defined inside the <path>paletteicons</path> folder, so you must first create that folder in your mod.

Create a <path>.prop</path> file with a unique name in the <path>paletteicons</path> folder.
<warning>
<p>
Ensure that all prop files in the <path>paletteicons</path> folder have a unique name, if they share a name with another mod, it won't work.
</p>
</warning>
<tip>
<p>
It's usually a good idea to use your mod's name, to reduce the chance of conflicting with other mods.
</p>
</tip>

Add the following properties to that prop file:
<list type="bullet">
<li>
<code-block>
key paletteSetButtonBackgroundIcon common~!bgicon.png
</code-block>
<p>
Edit <code>common~!bgicon.png</code> to point to your icon background.
</p>
</li>
<li>
<code-block>
key paletteSetButtonIcon common~!icon.png
</code-block>
<p>
Edit <code>common~!icon.png</code> to point to your icon.
</p>
</li>
<li>
<code-block>
key paletteSetButtonLayout layouts~!0x98F661C7.layout
</code-block>
<p>
Usually, you don't need to edit this.
</p>
</li>
<li>
<code-block>
texts paletteSetName
&#x9;(0x0!0x0) ""
end
</code-block>
<p>
This is the text that appears when you hover, point it to your locale property and your text.
</p>
</li>
<li>
<code-block>
int32 paletteSetSequenceNumber 1025
</code-block>
<p>
This determines the ordering of palette icons in relation to each other
</p>
<warning>
<p>
This does not control the ordering of pages, so if this is set improperly,
its possible for your icon to appear out of order compared to the pages it's on.
</p>
</warning>
</li>
</list>

Then for every page you want to have your icon, add the following property:
<code-block>
int32 palettePageSetId hash(PALETTEICONPROP)
</code-block>
<p>
Edit <code>PALETTEICONPROP</code> to be the name of your palette icon prop file (excluding the file extension).
</p>
6 changes: 6 additions & 0 deletions Writerside/topics/Property-List-Duplication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Property List Duplication
<link-summary>Use UPE to duplicate property lists to new locations</link-summary>
<web-summary>Use UPE to duplicate property lists to new locations</web-summary>
<card-summary>Use UPE to duplicate property lists to new locations</card-summary>

TODO
6 changes: 6 additions & 0 deletions Writerside/topics/Property-Postinits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Property Postinits
<link-summary>Use UPE to modify existing property lists</link-summary>
<web-summary>Use UPE to modify existing property lists</web-summary>
<card-summary>Use UPE to modify existing property lists</card-summary>

TODO
6 changes: 6 additions & 0 deletions Writerside/topics/Property-Replacement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Property Replacement
<link-summary>Use UPE to universally replace properties</link-summary>
<web-summary>Use UPE to universally replace properties</web-summary>
<card-summary>Use UPE to universally replace properties</card-summary>

TODO
13 changes: 13 additions & 0 deletions Writerside/upe.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE instance-profile
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">

<instance-profile id="upe" name="Universal Property Enhancer"
start-page="Documentation.md">

<toc-element topic="Documentation.md" hidden="true"/>
<toc-element topic="Property-Replacement.md"/>
<toc-element topic="Property-Postinits.md"/>
<toc-element topic="Property-List-Duplication.md"/>
<toc-element topic="Palette-Icons.md"/>
</instance-profile>
9 changes: 9 additions & 0 deletions Writerside/writerside.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ihp SYSTEM "https://resources.jetbrains.com/writerside/1.0/ihp.dtd">

<ihp version="2.0">
<topics dir="topics"/>
<images dir="images" web-path="img/"/>
<instance src="upe.tree" web-path="UniversalPropertyEnhancer/"/>
<categories src="c.list"/>
</ihp>

0 comments on commit 25584ff

Please sign in to comment.