-
Notifications
You must be signed in to change notification settings - Fork 53
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
Documentation Generator / Sample App Integration #85
Conversation
common/CommunityToolkit.Labs.Core.SourceGenerators/ToolkitSampleMetadataGenerator.cs
Outdated
Show resolved
Hide resolved
I'll rebase this in the morning and try and add a fix for WinUI 3 as I hit microsoft/microsoft-ui-xaml#5315 I'm going to suggest once @Arlodotexe has a PR for the WASM fix for #37 (so I can test this on WASM as well), that we snap this PR in and leave making the Markdown pretty (the rest of the TODO list here) as another PR. |
a5d2709
to
e13b616
Compare
common/CommunityToolkit.Labs.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs
Outdated
Show resolved
Hide resolved
PR should be all ready to go now! Tested in VS Code for WASM in the experiment level, as well as VS with UWP/WinUI 3 and with the all solution generated: Now documentation files are the main source for driving the sample apps, and we have the sample pages embedded in them (with quick jump navigation as well). When running in the experiment mode you get a broken out Tab View with each individual sample page and then the doc page as you would see in the main sample app. More work can be done later still to improve the design/aesthetics of the sample app itself of course, but this is all the source generator infrastructure and UI back-bone required. |
common/CommunityToolkit.Labs.Core.SourceGenerators/Metadata/ToolkitSampleMetadata.cs
Show resolved
Hide resolved
.../CommunityToolkit.Labs.Core.SourceGenerators/ToolkitSampleMetadataGenerator.Documentation.cs
Outdated
Show resolved
Hide resolved
.../CommunityToolkit.Labs.Core.SourceGenerators/ToolkitSampleMetadataGenerator.Documentation.cs
Show resolved
Hide resolved
.../CommunityToolkit.Labs.Core.SourceGenerators/ToolkitSampleMetadataGenerator.Documentation.cs
Outdated
Show resolved
Hide resolved
.../CommunityToolkit.Labs.Core.SourceGenerators/ToolkitSampleMetadataGenerator.Documentation.cs
Show resolved
Hide resolved
common/CommunityToolkit.Labs.Core.SourceGenerators/ToolkitSampleMetadataGenerator.Sample.cs
Outdated
Show resolved
Hide resolved
common/CommunityToolkit.Labs.Shared/Renderers/ToolkitDocumentationRenderer.xaml
Show resolved
Hide resolved
common/CommunityToolkit.Labs.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs
Outdated
Show resolved
Hide resolved
common/CommunityToolkit.Labs.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs
Outdated
Show resolved
Hide resolved
@Arlodotexe we'll see what happens with the partial class comment in the CI, but otherwise everything should be good here, addressed all your feedback and opened new issues for tracking other bits. Let me know if that all looks good to you. |
…t registry generation
Detect if running all-samples or experiment with Compile Time constant in Labs.SampleRefs.props Make renderers able to take navigation or binding of metadata setups
…. the sample metadata Makes it a bit easier to follow and separate concerns before doing intermingled parts for checking sample ids in docs.
Converts SampleRegistry to Dictionary for quick access/lookup from id strings Centralizes Template Selector for Doc or Sample Updates Documentation Renderer to display inlines samples, as well as start of a sample index on right-hand side to quickly navigate to samples in docs
…le heads to work properly from non-clean environment
59bcacc
to
5b373f6
Compare
Did a rebase to clean-up the history a bit, will merge this in with the history when the CI finishes again. |
Fixes #5, #21
Just starting a PR here with the in progress documentation changes.
Have the Source Generator modified to spit out the documentation index. Need to start working on the Sample App shell changes next.
Will dig into the sample app view Monday.
Copied the TODO table over from my last comment:
AdditionalTextsProvider
in the source generators to detect Markdown files as the primary sourceUse YamlDotNet to parse the front-matter for the title/description and extra category metadata we have there for samples. Use that as the primary tree.Can't use YamlDotNet yet -> see Generators - analyzer using references causing problems CS8785 dotnet/roslyn#43903(unreferenced)
in their tab or something.Since WASM doesn't have the best Markdown support with our MarkdownTextBlock we can either, special case a solution for it, or use this same solution on all platforms for now:leverage @nickrandolph's markdown solution using marked.js from here for WASM for the individual blurbs CommunityToolkit/MVVM-Samples@911b355(Will clean-up Markdown parsing to display across UWP/WinAppSDK/WASM as a separate PR, everything else on the list is complete.)
We should just decide if we want to test WASM here first after #88 goes in, or vice-versa.