Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing platform-specific API docs #58

Closed
KelsamGames opened this issue Jan 10, 2024 · 16 comments · Fixed by #85
Closed

Missing platform-specific API docs #58

KelsamGames opened this issue Jan 10, 2024 · 16 comments · Fixed by #85
Labels
documentation Improvements or additions to documentation

Comments

@KelsamGames
Copy link
Contributor

Link to Document

https://monogame.net/api/Microsoft.Xna.Framework.Input/

Description

Both KeyboardInput and MessageBox appear to be missing from the API docs for Microsoft.Xna.Framework.Input. Perhaps there are other platform-specific features like this missing too?

Also, it seems the navigation only open sub-pages now so the only way to get to the parent page (i.e. https://monogame.net/api/Microsoft.Xna.Framework.Input/) is by navigating to one of those first and then clicking on the parent in the breadcrumb at the top of the page.

@KelsamGames KelsamGames added the documentation Improvements or additions to documentation label Jan 10, 2024
@KelsamGames KelsamGames changed the title Missing mobile-specific API docs Missing platform-specific API docs Jan 10, 2024
@JakeLegendXIII
Copy link
Contributor

JakeLegendXIII commented Jan 14, 2024

Summary (TLDR): Looks like there is an issue with the ubuntu CI agent creating all of the API Reference docs. Local windows develop and using a GH Windows CI Server seem to create all 460 API reference docs. However, when using the Ubuntu CI agent only 274 or 275 of the docs are created.

Here's a bunch of notes about what I've been looking at:

Hey @AristurtleDev wanted to draw some attention here as there is actually a lot of the API docs missing in the deployed site. It looks like sitemap.xml in all the recent deployments (one example) is missing almost a 1000 lines compared to my local build (2509 on mine 1593 in the deployment). Granted it seems to be missing since the big change as even your temp site here is missing the same docs. Things like SpriteBatch, GraphicsDevice, and a ton of other docs are missing besides just the input stuff flagged here. I have like 50ish docs under the graphics namespace. There are only 20 on the website currently. Many of my fixes in the other PR are still going to 404s because of missing API reference pages.

Assuming it might be easier to test on your end with your temp site since you are currently able to do deployments. Locally it seems to build fine using Windows, but there may be some issue with the docfx stuff in the GitHub action? I can try and set something similar up, but figured you'd likely know better than me where to look!

It looks like the docfx export in GH actions is only generating 274 or 275 pages where as locally I see more like 460 pages. We're missing like 185ish pages of documentation.

It is currently only loading the MonoGame.Framework.Content.Pipeline.csproj data to the API docs? *Edit looks like pre the upgrade this weird loading behavior on the Ubuntu CI agent I show below was still present like in the build step here. Just previously during the build it was generating the 460 API docs. Not just the 275ish that it is doing now. So this may have been some pathing issue for some time or something, but the docs still got created/deployed previously.

GH Actions Output:

Restore was successful.
Using .NET Core SDK 7.0.405
Loading project /home/runner/work/monogame.github.io/monogame.github.io/external/MonoGame/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj
Determining projects to restore...
Restored /home/runner/work/monogame.github.io/monogame.github.io/external/MonoGame/MonoGame.Framework/MonoGame.Framework.DesktopGL.csproj (in 2.32 sec).
Restored /home/runner/work/monogame.github.io/monogame.github.io/external/MonoGame/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj (in 3.92 sec).

My Local Output:

Using .NET Core SDK 8.0.100
Loading project C:/fakepath/monogame-11ty/monogame-11ty/external/MonoGame/MonoGame.Framework/MonoGame.Framework.DesktopGL.csproj
Determining projects to restore...
All projects are up-to-date for restore.
Loading project C:/fakepath/monogame-11ty/monogame-11ty/external/MonoGame/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj
Determining projects to restore...
All projects are up-to-date for restore.

@AristurtleDev
Copy link
Contributor

Hey @JakeLegendXIII @KelsamGames just now seeing this, looking into it.

@AristurtleDev
Copy link
Contributor

This does seem to be an linux/ubuntu related issue. Changed the runner to use windows instead of ubuntu and it generated all docs fine (460 items). Investigating further why this is happening on ubuntu since the windows runner is incredibly slow

image

@AristurtleDev
Copy link
Contributor

From what I can tell, this may be a bug in Docfx, i have submitted the following issue with them dotnet/docfx#9618

In the meantime @mrhelmut since you are this months maintainer rotation I'll tag you. This can be resolved if the GitHub runner can be switched to windows-latest or macOS-latest. If going this route, I would suggest macOS-latest since the windows runner take a billion times longer to run.

@AristurtleDev
Copy link
Contributor

@mrhelmut fixed in the #83 merge. This can be closed.

@KelsamGames
Copy link
Contributor Author

@AristurtleDev KeyboardInput and MessageBox are still missing from Microsoft.Xna.Framework.Input.

@AristurtleDev
Copy link
Contributor

Sorry @KelsamGames i got caught up with the issue that it was only generating half the documentation that I skipped over those parts.

The docfx generation only generates documentation from two projects

  • MonoGame.Framework.DesktopGL.csproj
  • MonoGame.Framework.Content.Pipeline.csproj

These were the original settings so I just used those when converting the site to 11ty.

It looks like the DesktopGL project specifically removes those two namespaces in the csproj

image

Since they are removed, they aren't part of the generation. Going to have to add them in manually for docfx to include.

https://github.com/MonoGame/MonoGame/blob/6b8988fc19ec04015c7fa8279860932ba63b8ee4/MonoGame.Framework/MonoGame.Framework.DesktopGL.csproj#L42

@mrhelmut
Copy link
Contributor

This is because the documentation is based on the DesktopGL target, which has no implementation for KeyboardInput and MessageBox (as well as Video and VideoPlayer).

Two possible solutions:

  • base the documentation on WindowsDX instead (which would imply to build the website on Windows instead of Linux)
  • or add empty implementations of those classes to DesktopGL throwing NotImplementedException (this one has my preference)

@AristurtleDev
Copy link
Contributor

@mrhelmut I think we can add those two specific files to be included in the docfx settings along with the csprojs that we already have.

@mrhelmut
Copy link
Contributor

That's cool, though I think that we should add empty implementations. I think it is a better user experience to let developers know that it's not implemented than having them missing.

It's a quick fix, I can work that out.

@AristurtleDev
Copy link
Contributor

Ah yea that's a better solution 👍

@KelsamGames I was just rereading the original issue, can you open a separate issue for this part

Also, it seems the navigation only open sub-pages now so the only way to get to the parent page (i.e. https://monogame.net/api/Microsoft.Xna.Framework.Input/) is by navigating to one of those first and then clicking on the parent in the breadcrumb at the top of the page.

I believe I know why this is happening and it's a bug in the way the html/css interacts to make the drop downs expand collapse. It's eating the click for the link when the expand/collapse triggers.

@KelsamGames
Copy link
Contributor Author

Them being mentioned in any way (with that quick little blurb of what they're supposed to do) is my only goal. Back when I was making some mobile ports of past games, thumbing through the old docs had me stumble upon those 2 features that saved me GOBS of time with mobile keyboard handling and simple user alerts, so I'd really like them to be present in some way for others to notice the same way.

@KelsamGames
Copy link
Contributor Author

KelsamGames commented Jan 29, 2024

Ah yea that's a better solution 👍

@KelsamGames I was just rereading the original issue, can you open a separate issue for this part

Also, it seems the navigation only open sub-pages now so the only way to get to the parent page (i.e. https://monogame.net/api/Microsoft.Xna.Framework.Input/) is by navigating to one of those first and then clicking on the parent in the breadcrumb at the top of the page.

I believe I know why this is happening and it's a bug in the way the html/css interacts to make the drop downs expand collapse. It's eating the click for the link when the expand/collapse triggers.

Sure thing. Issue #84 opened.

@JakeLegendXIII
Copy link
Contributor

JakeLegendXIII commented Jan 29, 2024

Sorry @KelsamGames i got caught up with the issue that it was only generating half the documentation that I skipped over those parts.

The docfx generation only generates documentation from two projects

  • MonoGame.Framework.DesktopGL.csproj
  • MonoGame.Framework.Content.Pipeline.csproj

My bad @AristurtleDev ! I came out here to create an Issue for the missing Api docs and noticed this one was already created. So I tagged you and wrote my giant wall of text about the other issue that should have probably been a separate issue had I stopped to check if these were in DesktopGL or not.

Glad both issues are either fixed or have potential fixes in the works! Sorry for any confusion.

@mrhelmut
Copy link
Contributor

I'm just waiting for MonoGame/MonoGame#8142 to pass the build checks and I'll merge it. Then we can regenerate the documentation and have those types.

@mrhelmut
Copy link
Contributor

Here we go #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants