Skip to content

Conversation

@nitanmarcel
Copy link
Contributor

@nitanmarcel nitanmarcel commented Mar 2, 2021

An year-ish ago I've made a small issue speaking about a documentation website for the library generated using Doxygen #918 and since then I forgot about it, oops.

Anyway, using Doxygen for the documentation wasn't such a good idea since the generated HTML files needed some changes to display as they should be.

A couple of days ago I found DocFx and I remembered about the documentation I've made for the library before.

The documentation is generated by DocFx each time a new tag is released which means it won't be available after merging it unless there's a new tag after the merge (the tag needs to start with v3 and also the gh-pages branch needs to be set as the main branch for GitHub pages) . But you can still test the theme here: https://nitanmarcel.github.io/scripthookvdotnet/index.html until it will be on this repo.

I'm using GitHub Actions to set up the documentation and it works in the following way:

If a new tag who's string matches "v3*" (eg. v3.1.1, v3.1.2, v3.x.x) will be release the workflow will start generating the documentation.

I tried to auto-generate everything that I could auto-generate starting from the index page which uses the README file, up to the changelog page which uses https://github.com/heinrichreimer/action-github-changelog-generator which generates changelog data between each available tag in a nicely printed way: eg. https://github.com/skywinder/ActionSheetPicker-3.0/blob/develop/CHANGELOG.md

The workflow will take care of everything except for deploying the GitHub page for the first time. It still requires a one-time activation from GitHub's repository settings. But after the workflow finished pushing the documentation to the gh-pages branch.

image

image

image

Copy link
Collaborator

@crosire crosire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool!
Do you still have links to where the template used came from? And would it maybe be possible to embed that somehow without adding all the files to this repository (e.g. via a submodule or just fetching it as part of the actions script)?

doc/docfx.json Outdated
"scripting_v2/**.yml",
"scripting_v3/**.yml",
"scripting_v2/api/**.yml",
"scripting_v3/api**.yml"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks unintentional (/ missing)?

Copy link
Contributor Author

@nitanmarcel nitanmarcel Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. DocFX uses glob for the paths so /scripthook_vx/ will point to /system-root/scripthook_vx

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean you have one line
"scripting_v2/api/**.yml"
and then
"scripting_v3/api**.yml"
which is inconsistent?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just do:
scripting_v*/**.yml and scripting_v*/api/**.yml to cover v2, v3, and any other future versions all in a single go?

@@ -0,0 +1,4 @@
ScriptHookVDotNet v2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v3, not v2 =)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, my bad. I noticed this I had like over 30 commits and I kept reverting them when things went wrong and I might delete the one that modified this

Copy link
Contributor Author

@nitanmarcel nitanmarcel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool!
Do you still have links to where the template used came from? And would it maybe be possible to embed that somehow without adding all the files to this repository (e.g. via a submodule or just fetching it as part of the actions script)?

https://github.com/steffen-wilke/darkfx

In the second part you mean without adding the doc directory here? I could simply make my own repo with the doc folder and clone it using GitHub actions

doc/docfx.json Outdated
"scripting_v2/**.yml",
"scripting_v3/**.yml",
"scripting_v2/api/**.yml",
"scripting_v3/api**.yml"
Copy link
Contributor Author

@nitanmarcel nitanmarcel Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. DocFX uses glob for the paths so /scripthook_vx/ will point to /system-root/scripthook_vx

@nitanmarcel
Copy link
Contributor Author

nitanmarcel commented Mar 2, 2021

@crosire I'm preparing a separate branch for the documentation so we can add it as a submodule or if you want or I'll clone it from inside github actions. I'll wait for an answer ^^

@nitanmarcel
Copy link
Contributor Author

nitanmarcel commented Mar 2, 2021

I've added the documentation as a submodule: https://github.com/nitanmarcel/scripthookvdotnet-doc which is a fork of the template used on the documentation.

Also I did some changes. The main page uses the Getting Started wiki page and the footer contains a link to the license which now will be generated as part of the website

Index

image

License

image

Added some more generated filesto .gitignore in case the documentation is generated locally
@crosire
Copy link
Collaborator

crosire commented Mar 3, 2021

Ah, sorry 🙃, I didn't mean it that drastic, was thinking that the template could have been a submodule to avoid adding all these files that have no relation to SHVDN. So a directory structure like this:

- docs
   - docfx.json
   - index.md
   - toc.yml
   - scripting_v2/
      - index.md
   - scripting_v3/
      - index.md
   - templates/
      - darkfx/ submodule pointing towards https://github.com/steffen-wilke/darkfx (since you can have Git submodules in sub directories, see "-path" argument to git submodule add)
      - memberpage/ submodule pointing towards where that came from

While adding the entire docs as a submodule may be advantageous too, the problem I'm seeing is that it breaks the link between the GitHub Actions script and the docs content. So would be better to keep those close together I think.

@nitanmarcel
Copy link
Contributor Author

Ah, sorry 🙃, I didn't mean it that drastic, was thinking that the template could have been a submodule to avoid adding all these files that have no relation to SHVDN. So a directory structure like this:

- docs
   - docfx.json
   - index.md
   - toc.yml
   - scripting_v2/
      - index.md
   - scripting_v3/
      - index.md
   - templates/
      - darkfx/ submodule pointing towards https://github.com/steffen-wilke/darkfx (since you can have Git submodules in sub directories, see "-path" argument to git submodule add)
      - memberpage/ submodule pointing towards where that came from

While adding the entire docs as a submodule may be advantageous too, the problem I'm seeing is that it breaks the link between the GitHub Actions script and the docs content. So would be better to keep those close together I think.

Ok, I'll see what I can do about it. Also the memberspage is a nuget package and I don't think it's built in in docfx like the default template but I will check :)

@chakibchemso
Copy link

Awesome work!!!

@nitanmarcel
Copy link
Contributor Author

Awesome work!!!

Thanks. Anyway this will be pushed forward because I'm waiting for docFX v3 to come stable

@kagikn
Copy link
Member

kagikn commented Jun 3, 2023

I didn't care about web documentation too much until I received full access to do what I want without external approvals, but now it's good time for me to make a proper web documentation since we'll officially deprecate the v2 SDK/API in v3.7.0 (3.5 year passed since the first v3 release though). I'll make another PR when I create the official web docs.

I heard Lemon got annoyed for not a few people asking for how to use LemonUI in scripts built against v2 API (not v3), and I'm disappointed at the fact a lot of people (maybe more than the half of script devs on 5mods?) use v2 SDK/API for new scripts even they don't reference to other scripts built against v2 API, too. I'll be willing to create the official web documentation for API(s) if more people will have their scripts migrate to v3 SDK/API.

@nitanmarcel
Copy link
Contributor Author

I totally forgot this existed. Oups xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants