nhok0169 / Anime-Game-Remap

Anime Game Remap/Fix/Convert
https://anime-game-remap.readthedocs.io/en/latest/
Apache License 2.0
20 stars 13 forks source link

Add API Documentation #39

Closed Alex-Au1 closed 9 months ago

Alex-Au1 commented 9 months ago

For the few people who do use the fix in their own python projects, we want to be clear about what functions and classes are available for them to use instead of letting them do the hard work of reading our script's code.

We could use Read the Docs to maybe help us make the documentation (got inspired from discord.py's docs https://discordpy.readthedocs.io/en/stable/ ---> you can see the source code for their docs in their repo: https://github.com/Rapptz/discord.py)

Read the Docs will read all of our docstrings in our script to automatically generate the latest documentation, so that we do not need to do much work updating the documentation if we make a new change.

Alex-Au1 commented 9 months ago

putting this here to work on later

Alex-Au1 commented 9 months ago

some people from the server may find it useful

nhok0169 commented 9 months ago

you mean create a site like docs.raidenbossfix.github.io and put tutorial on it ?

Alex-Au1 commented 9 months ago

pretty much

We could put a tutorial there, but I think most people will be reading the README instead

my main concern is for the few developers who will be implementing our script into their own code

eg. Lets assume that I want to only fix the blend file named myRaidenBlend.buf without fixing the mod's .ini file, I would write these 2 lines in Python:

import FixRaidenBoss2 as FRB
FRB.Mod.blendCorrection("myRaidenBlend.buf", "myRaidenRemapBlend.buf")

Currently without API documentation, they would only know how to write that by reading lines 1307 to 1326 in FixRaidenBoss2.py

With documentation, they could get their desired function without reading what is going on behind the scenes in the code

Alex-Au1 commented 9 months ago

We could use Sphinx docs to make the documentation --> basically its making a bunch of READMES (.rst files) that become a website

To compile the website on your own computer

  1. navigate to the docs folder of our Repo
  2. run the command ./make.bat html ---> this creates a new folder called build in the docs folder

To run the website on your own computer

  1. After compiling, go to the folder docs/build/html
  2. click on index.html
Alex-Au1 commented 9 months ago

Although not yet finished, here is what the site looks like so far: https://fix-raiden-boss.readthedocs.io/en/latest/

nhok0169 commented 9 months ago

pretty much

We could put a tutorial there, but I think most people will be reading the README instead

I main concern is for the few developers who will be implementing our script into their own code

eg. Lets assume that I want to only fix the blend file named myRaidenBlend.buf without fixing the mod's .ini file, I would write these 2 lines in Python:

import FixRaidenBoss2 as FRB
FRB.Mod.blendCorrection("myRaidenBlend.buf", "myRaidenRemapBlend.buf")

Currently without API documentation, they would only know how to write that by reading lines 1307 to 1326 in FixRaidenBoss2.py

With documentation, they could get their desired function without reading what is going on behind the scenes in the code

the first basic code is : from line 8 - 77 on this file https://github.com/nhok0169/Fix-Raiden-Boss/commit/7345d0f81255db1dde2e5d9efb163b30ae93587f write by silent after he read my code on fix V1 is just basic rename vertex group name on the buf file and duplicate it to another file and used the boss hash for fix the error of pose. fun fact the dev of genshin to lazy to rename and fix the hash of boss. but the way to refix is very simple.

nhok0169 commented 9 months ago

Although not yet finished, here is what the site looks like so far: https://fix-raiden-boss.readthedocs.io/en/latest/

i thought you will used github page to post it lol

Alex-Au1 commented 9 months ago

the first basic code is : from line 8 - 77 on this file 7345d0f write by silent after he read my code on fix V1 is just basic rename vertex group name on the buf file and duplicate it to another file and used the boss hash for fix the error of pose. fun fact the dev of genshin to lazy to rename and fix the hash of boss. but the way to refix is very simple.

lol, yeah I used that example since I knew it would be simple (the first basic code from lines 8-77 ---> now is in the Mod.blendCorrection function at lines 1307-1326)

But even with the first basic code, the developer still needs to read and understand this file https://github.com/nhok0169/Fix-Raiden-Boss/commit/7345d0f81255db1dde2e5d9efb163b30ae93587f to know that they need to copy and paste lines 8-77

Point is: we don't want to overwhelm the developer to read our sea of code

Alex-Au1 commented 9 months ago

Although not yet finished, here is what the site looks like so far: https://fix-raiden-boss.readthedocs.io/en/latest/

i thought you will used github page to post it lol

better to use something that exists than to reinvent the wheel

Alex-Au1 commented 9 months ago

the basic code is : from line 8 - 77 on this file 7345d0f write by silent after he read my code on fix V1 is just basic rename vertex group name on the buf file and duplicate it to another file and used the boss hash for fix the error of pose. fun fact the dev of genshin to lazy to rename and fix the hash of boss. but the way to refix is very simple.

lol, lets hope genshin keeps that laziness up

Alex-Au1 commented 9 months ago

Completed: https://github.com/nhok0169/Fix-Raiden-Boss/pull/43

Link to API docs:

https://fix-raiden-boss.readthedocs.io/en/latest/