-
Notifications
You must be signed in to change notification settings - Fork 7
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
Create the API generator tool #123
Comments
It seems like I should be able to generate a really rough API documentation generator. I am able to generate this for all the records in This is generated from the typed AST provided by FCS which means that I can also have access to TypeInference to documentation function, methods, etc. in the future. The first step is to be able to generate the documentation as shown above for the |
|
Hey 👋 I ended up taking the tool for a spin and here are my thoughts: TutorialI know, I know, it's a beta and such, but can always be better. I think it would be good to include a tutorial from install to setup/integration with a new nacara site. I found myself hitting edge cases with how menu.json/nacara.js.config, the base-url of the tool interact, and where to exactly output the files. API tool needs to know each projectWhile it makes sense that you need an entry point to start generating docs from, if you have multiple libraries, it might be nicer to be able to pass in a glob or a list and let the tool generate from them all. API tool should have a watch mode (and maybe handle the publish step for you)Going from XML comment -> to website involves a change to docs, a publish of that library, then a run of the api tool. It would be a smoother experience if the tool handled taking in the projects it needs to rebuild, publishing them on changes, and generating the markdown files from those changes. See here for an example of that flow. If nacara doesn't want to run Api Tool assumes third party dependencies to be on microsoft docs referencable.For example: Certain tags in the XML aren't displayedAren't rendered on the webpage. API Generation doesn't integrate nicely with the side-nav-barWhile regular documentation has a nice sidebar experience, the API does not. Fake does have a sidebar experience and would be nice to replicate it here since we already have this UX pattern. Knowing about certain attributesIt would be nice to know about References |
Hello thank you for taking the time of looking into Nacara API gen even if it is in really rough state.
Hum, depending on what the edge cases about About the generated structure of the files indeed this is something to improve. As I mentioned the API gen is really in early stage, I published it only because I needed to generate the Nacara API instead of writing it manually. If you think something is unclear in the Nacara documentation don't hesitate to tell me or send a PR.
This is complex to do because F# Formatting doesn't provide the real raw XML comment... That's why for now, I really on I need to experiment more to see if it is possible to start a single process to watch all the libraries or if I have to spawn one instance per library.
I agree that it should have a watch mode, it should be improved in future version with a better integration into Nacara config file too. I would love to be able to kind of generate the documentation of all the APIs of the project at once even for the dependencies to avoid invalid links etc. But for that, I need to find a way to get the raw comments. Either by finding the XML files or by forking/improving F# formatting to give me access to them.
I was going to write that this a limitation of F# formatting which is true because that part of the documentation if generated by it right now. But, while re-reading my comment: fsprojects/FSharp.Formatting#708 (comment) It seems like I had found a solution to get around it. I will have a look at it.
The This is because, I based myself on the C# XML recommendation examples. The The current parser force the order of the elements like that
The difficulty, is when something is not put inside of these top levels tags as recommanded by the C# XML "specification" right now it get skipped. One way, to solve it could be to make a second pass which removed all the the tags I listed above and if it found something, it happen it to the remarks section. This can still cause strange result if the user write his doc comments "poorly" but at least it will not strip content.
I do agree, this is something that will be hard to do correctly. The menu is kind of strongly related to which renderer is used for Nacara. For example, Also in case, you missed it there are some anchor generated on the API page
I agree with you, this is something I left out of the initial really but I need to add it.
|
Actually, the menu are auto generated by Nacara layout so in theory, if I generate |
Hey, I'd love to help ensure that the ApiDocsModel coming out of FSharp.Formatting is sufficient - I know there are issues like fsprojects/FSharp.Formatting#708 and I'd like to understand what you need. The visuals of your API Docs are also great and maybe it's feasible to fold that back into FSharp.Formatting too once mature, as an optional replacement for GenerateHtml.fs |
Hello, thank you for looking at the work done with Nacara :) I am still experimenting so I am unsure if my list will be exhaustive but what I need right now is:
This code, is not coming from the F# source but reconstructed from the type information coming from FCS from objects like The code is not pretty but I think this can gives you an idea of how I am generating the snippets. Nacara/src/Nacara.ApiGen/Source/Render.fs Lines 223 to 370 in 33dc6c6
What I mean by that, is that currently I need to run I understand that doing the DLLs/dependencies resolution is a complex thing but the IDEs are already doing it. So it would be nice if F# formatting could do the same. Doing
Thank you :) It would be nice indeed, it would be nice especially to benefit from features like The only thing is that Nacara needs to have a Markdown file to process with header at the top. Example:
When I have a stable layout and customisation system for the API layout. I would be happy to ping you to discuss about adding it back in F# Formatting if that still makes sense. PS: I know that you are working on fixing some of the issues I reported at the same time I write this message. |
Here is what API documentation could looks like:
For DU:
For record:
The text was updated successfully, but these errors were encountered: