-
Notifications
You must be signed in to change notification settings - Fork 668
Node markdown generator tool #11725
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
Node markdown generator tool #11725
Conversation
|
@SHKnudsen - this PR looks to need work before review:
|
src/DocumentationBrowserViewExtension/DocumentationBrowserViewModel.cs
Outdated
Show resolved
Hide resolved
src/DocumentationBrowserViewExtension/PackageDocumentationManager.cs
Outdated
Show resolved
Hide resolved
|
@SHKnudsen was trying to build this and ran into the issue that |
@mjkkirschner updated the description and solved the merge conflict. Also made the changes that we discussed, and everything seems to work nicely now. |
|
@SHKnudsen thats great to hear, I am currently looking into creating a custom importModuleHandler that will either:
I'll send a PR to your fork if that works for you? |
|
@Amoursol can you please check in with legal again on the inclusion of imageMagik - with its custom license - we won't be able to finalize this without that approval - if needed we can back those changes out and add compression later I guess. |
Yep that sounds good, thanks! |
Will chase on this now @mjkkirschner, may have slipped my mind. Sorry for that! |
put clr into reflection mode when importing DS files fix classname for generated ds docs
fix issue with protogeometry format load error
|
@mjkkirschner merged your DS file changes so think this is getting close to being ready. I took out the tests on this PR so we can add everything test-related in a new PR. |
aparajit-pratap
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More comments to come ...
src/DocumentationBrowserViewExtension/PackageDocumentationManager.cs
Outdated
Show resolved
Hide resolved
src/DocumentationBrowserViewExtension/DocumentationBrowserViewExtension.cs
Outdated
Show resolved
Hide resolved
| /// <param name="t">Type to check</param> | ||
| /// <param name="nodeModelType">Type of NodeModel, this is needed to be sure we are comparing the same NodeModel type reference</param> | ||
| /// <returns></returns> | ||
| internal static bool IsNodeSubTypeReflectionLoaded(Type t, Type nodeModelType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the name of this method mean? Can we rename it to have a simpler meaning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this method is truly necessary, looks like there could be room to get rid of some code duplication between this and the IsNodeSubType method.
| IsHidden = attributes.OfType<IsVisibleInDynamoLibraryAttribute>().Any(attr => !attr.Visible); | ||
|
|
||
| var attribs = attributes.OfType<NodeNameAttribute>(); | ||
| if (attribs.Any() && !IsDeprecated && !IsMetaNode && IsDSCompatible && !IsHidden) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If an attribute is a NodeNameAttribute, how is there a possibility that any of the other flags, IsDeprecated, etc. will be true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure i fully understand the question?
The type can have both NodeNameAttribute and NodeDeprecatedAttribute and so on. I dont know the exact reason for making this check, but am simply following the logic of the original TypeLoadData constructor
https://github.com/DynamoDS/Dynamo/blob/master/src/DynamoCore/Graph/Nodes/TypeLoadData.cs#L43
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appears to me those other flags are checked above by checking other attributes.
| if ((retype.IsIndexable && mattrs.AllowRankReduction) | ||
| || (typeof(object).Equals(method.ReturnType))) | ||
| { | ||
| retype.rank = Constants.kArbitraryRank; | ||
| } | ||
|
|
||
| func.Signature = ParseArgumentSignature(method); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than GetProtoCoreType and isPropertyAccessor is this code also expected to throw in reflection-only mode? If not, we could probably move this out of the try-catch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess some of it might not be, but lots of its relying on the retype so if that fails i would say we dont want to execute this code either
| try | ||
| { | ||
| // if overriding object | ||
| var baseType = methodInfo.DeclaringType.BaseType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this method be recursive - base type of base type and so on until you find a matching methodInfo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did a little test with 3 classes ParentType, MiddelType and NestedType
(inheritance like this NestedType -> MiddelType -> ParentType) where ParentType has a virtual RandomProp which NestedType implements. In that scenario doing GetBaseDefinitionReflectionContext on NestedType.RandomProp will return the correct methodInfo from ParentType
src/Engine/ProtoCore/Reflection/MemberInfoReflectionExtensions.cs
Outdated
Show resolved
Hide resolved
| } | ||
| } | ||
|
|
||
| if (functionGroups.Count > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(functionGroups.Any()?
src/Tools/NodeDocumentationMarkdownGenerator/AssemblyHandler.cs
Outdated
Show resolved
Hide resolved
src/Tools/NodeDocumentationMarkdownGenerator/AssemblyHandler.cs
Outdated
Show resolved
Hide resolved
src/Tools/NodeDocumentationMarkdownGenerator/Commands/FromDirectoryCommand.cs
Outdated
Show resolved
Hide resolved
src/Tools/NodeDocumentationMarkdownGenerator/Commands/FromDirectoryCommand.cs
Outdated
Show resolved
Hide resolved
src/Tools/NodeDocumentationMarkdownGenerator/MarkdownHandler.cs
Outdated
Show resolved
Hide resolved
src/Tools/NodeDocumentationMarkdownGenerator/MarkdownHandler.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: michael kirschner <michael.kirschner@autodesk.com>
Co-authored-by: michael kirschner <michael.kirschner@autodesk.com>
add gif compression by quantization to 32k colors in debug leave console open until readline for easy log reading
* Dyn 3817 exit tour window popup (DynamoDS#11918) * DYN-3817-ExitTourWindow Popup I added the UI for the Exit Tour Window, but still having some issues in the layout * DYN-3817-ExitTourWindow-Popup I created the view for the Exit Tour Window and also the functionality of showing the ExitTour ( this is shown only when one of the steps is closed so the tour is not finished - this doesn't apply for the Survey popup). A resource string was added and is related to the ExitTour content so it can be localized later. * DYN-3817-ExitTourWindow-Popup Removing code not needed in DynamoView.xaml.cs * DYN-3817-ExitTourWindow-Popup Code Review The ExitTourWindow was renamed to RealTimeInfoWindow. I reorganized the RealTimeInfoWindow so doesn't depend of a Step (then it can be used in a more generic way). I created the properties Width, Height and TextContent inside the RealTimeInfoWindow so they can be set up from outside. The TextContent property contains the text that will be shown in the popup and it can be updated on runtime. * DYN-3817-ExitTourWindow-Popup Code Issues Fixing issues produced after merging the latest changes in master branch * DYN-3817-ExitTourWindow-Popup Code Review 2 The offset hardcoded values were changed to const double, also I reorganized the way the RealTimeInfoWindow object is created. Also I added some comments in the xaml file * Dyn-3640 - Recover execution after clearing cyclic dependency from graph (DynamoDS#11896) * cleanup * minor cleanup * clear cycles from dependency graph nodes for graph runs * cleanup * update failing test * clear node warnings for cleared cycles * do not include cyclic graph node as a redefined node of another graph node * add unit tests * fix one more case * review comments * add logging to intermittent pkgloader tests (DynamoDS#11925) * update tests * update xml summary add some logging to failing tests Co-authored-by: michael kirschner <michael.kirschner@autodesk.com> * pkg load test log typo (DynamoDS#11926) * update tests * update xml summary add some logging to failing tests * typo Co-authored-by: michael kirschner <michael.kirschner@autodesk.com> * Update UI (DynamoDS#11932) * Update searchMethod invocation in LibraryMSWebBrowserExtension (DynamoDS#11931) * Update searchMethod invocation Update searchMethod invocation to use correct number of parameters * Update SearchDictionary.cs * Add adsk fonts to extern folder with license terms. (DynamoDS#11890) * small adjustment * align titles * add names to buttons for ui automation tests * missing button name * new font folder for use in Dynamo only * Update readme.md * add font links to about box Co-authored-by: michael kirschner <michael.kirschner@autodesk.com> * check for null (DynamoDS#11930) * Prevent port measure crash (DynamoDS#11935) * CRASH: Delete node with right-click at the same time (DynamoDS#11927) * null checks * Add unit test * Fix For Loading Json File (DynamoDS#11934) * Fix For Loading Json File During the testing of the task https://jira.autodesk.com/browse/DYN-3817 Aabishkar reported that when trying to open the "Get Started" tour a message appear saying Could not find a part of the path 'C:\Windows\system32\UI\GuidedTour\dynamo_guides.json' Then I modified the code that is loading the json,file, in the past was a relative path and now we are using an absolute path. * Fix For Loading Json File Instead to have the json file path in the GuidesManager constructor I created two public properties that will contains the assembly path execution and the JSON files guides path, so we can verify in the unit testing that this paths exists and if the Guide will be created correctly. Also I added a unit test that will validate that the json guides file exists and that the Guides can be created. * Handle crash due to save path being too long Co-authored-by: Roberto T <61755417+RobertGlobant20@users.noreply.github.com> Co-authored-by: aparajit-pratap <aparajit.pratap@autodesk.com> Co-authored-by: michael kirschner <michael.kirschner@autodesk.com> Co-authored-by: Aaron (Qilong) <173288704@qq.com> Co-authored-by: Ashish Aggarwal <ashish.aggarwal@autodesk.com>
add new flag -g to compress gifs
Purpose
This pr adds a new NodeDocumentationGenerator tool to automatically generate node documentation markdown files, the tool creates markdown files which (if specified) will have content from the DynamoDictionary added. The tool has two different verbs one that creates documentation from dlls in a directory, this can be used to create docs for Dynamo Core and Dynamo hosts, and another that generates docs from a package.
The PR also adds new APIs to
ProtoCore.ProtoFFI.CLRDLLModuleto enable scanning dlls in reflection mode, along with this new reflection extensions have been added toProtoCore.Reflection.The tool does not require Dynamo to be running but it uses the same APIs to scan dlls, main difference is that it dosent load anything into Dynamo but simply gives us back a list of all node types in the assembly being scanned
Dynamo loads documentation from Core and hosts by looking in a
fallback_docsfolder in the root directory of core or the host (TBD). By default whenhelpis pressed on a node theDocumentationBrowserwill look for the help doc associated with that node in thePackageDocumentationManagerif no match is found it will first try and find a match in the hostfallback_docsand secondly in Coresfallback_docs.Besides that i made a slight modification to how the
PackageDocumentationManagerloads doc files, essentially i came across an issue where two packages was using the same namespace, this will cause an error on the manager. To address this i added the package name to the key ofnodeDocumentationFileLookup.Still need to add this to Dynamo.Mono, but lets touch base on that on our next call @mjkkirschner
Verbs
fromdirectory--includedyfsflag) in the input directoryfrompackage/dyffolder. All generated files gets saved inpath/to/package/docsfromdirectory - flags
-i--input-o--output-r--references-f--filter-c--includedyfs-d--dictionary-w--overwrite-y--recursive-scan-s--compress-images-x--layout-specfromdirectory - samples
frompackage - flags
-i--input-r--references-w--overwritefrompackage - samples
Docs in Revit
Declarations
Check these if you believe they are true
*.resxfilesReviewers
@mjkkirschner
FYIs
@Amoursol