docs: add VitePress documentation site#157
Conversation
|
It looks like the package.json file may be missing. Possibly filtered out of the git? |
f2e0087 to
33ca82f
Compare
dc4ae50 to
68a5453
Compare
ae35d66 to
903215a
Compare
408f944 to
655f7c8
Compare
189a4b6 to
53b0ae4
Compare
The InvalidDeviceAdded event family added in PR TrakHound#169 introduced a new OnInvalidDeviceAdded method on MTConnectAgent. After rebasing TrakHound#157 (CS1591 promoted to error) onto the integration tip, this method needs an <inheritdoc /> tag matching the documented interface method.
796c0f3 to
783bf1b
Compare
The InvalidDeviceAdded event family added in PR TrakHound#169 introduced a new OnInvalidDeviceAdded method on MTConnectAgent. After rebasing TrakHound#157 (CS1591 promoted to error) onto the integration tip, this method needs an <inheritdoc /> tag matching the documented interface method.
The InvalidDeviceAdded event family added in PR TrakHound#169 introduced a new OnInvalidDeviceAdded method on MTConnectAgent. After rebasing TrakHound#157 (CS1591 promoted to error) onto the integration tip, this method needs an <inheritdoc /> tag matching the documented interface method.
1ea4df6 to
24d603f
Compare
The InvalidDeviceAdded event family added in PR TrakHound#169 introduced a new OnInvalidDeviceAdded method on MTConnectAgent. After rebasing TrakHound#157 (CS1591 promoted to error) onto the integration tip, this method needs an <inheritdoc /> tag matching the documented interface method.
The InvalidDeviceAdded event family added in PR TrakHound#169 introduced a new OnInvalidDeviceAdded method on MTConnectAgent. After rebasing TrakHound#157 (CS1591 promoted to error) onto the integration tip, this method needs an <inheritdoc /> tag matching the documented interface method.
24d603f to
e37b1fb
Compare
The InvalidDeviceAdded event family added in PR TrakHound#169 introduced a new OnInvalidDeviceAdded method on MTConnectAgent. After rebasing TrakHound#157 (CS1591 promoted to error) onto the integration tip, this method needs an <inheritdoc /> tag matching the documented interface method.
The InvalidDeviceAdded event family added in PR TrakHound#169 introduced a new OnInvalidDeviceAdded method on MTConnectAgent. After rebasing TrakHound#157 (CS1591 promoted to error) onto the integration tip, this method needs an <inheritdoc /> tag matching the documented interface method.
… family Promote InvalidDeviceAdded from "in flight" to a first-class entry in the event family table, with its own row describing when it fires (Device null or Uuid null/empty). Add a validation-code reference table covering DeviceNull and DeviceUuidMissing, the two codes the agent currently stamps onto these failures. Add a pre-flight section showing how ValidateDevice exposes the same check for callers who want to validate before AddDevice. Update the wire-up example to attach a handler for InvalidDeviceAdded, and update the handler-signature listing so every delegate (including MTConnectAssetValidationHandler) carries the new universal MTConnect.ValidationResult instead of the per-domain structs.
Three pre-v7 per-domain validation result structs (MTConnect.Assets.AssetValidationResult, MTConnect.Devices.DataItems.ValidationResult, MTConnect.Observations.ObservationValidationResult) collapsed into one universal MTConnect.ValidationResult in v7. Add a dedicated migration page covering the type-replacement table, the new Code property and its rationale, and before/after code samples for both the handler side (agent subscribers) and the Asset author side (Asset.IsValid overrides). Register a /migration/ sidebar so the page is reachable without typing the URL by hand; future migration notes can join the same group.
After rebasing onto integration/all-fixes, the docs-completeness gate flagged docs/reference/http-api.md as out of sync with the source. Run MTConnect.NET-DocsGen --repo . to regenerate it; the diff is a section removal driven by changes upstream in PR TrakHound#169's consolidation work.
The library was removed in PR TrakHound#172 (chore/remove-http-aspnetcore). Strip every docs mention: - Renderers.cs: drop the AspNetCore section heading + RenderTable call and update the intro/taxonomy prose (removed "either transport"). - docs/api/index.md: remove the exclusion note that explained why AspNetCore was absent from the API reference -- the library is gone, not just excluded. - docs/reference/http-api.md: regenerated by running build/MTConnect.NET-DocsGen after the renderer fix; produces a Ceen-only page with 13 endpoints and no AspNetCore section. No sidebar entries, no migration notes, and no module/configure pages required changes -- only the two reference pages carried AspNetCore text. All 6 docs-completeness tests pass; VitePress build green.
…ily style
Use the same terse one-line summary the rest of the
MTConnect{Component,Composition,DataItem,Observation,Asset}ValidationHandler
family uses, rather than spelling out the rejection scenario inline. The
when-it-fires detail lives on the docs/concepts/agent-validation-events.md
page (user POV) and on the ValidationResult.Code values; the delegate's
own summary just identifies what it handles.
93dcbaa to
f2828f2
Compare
The docs reference generator extracted XML-doc summaries by splitting on '\n' and trimming only leading whitespace, so a CRLF-checked-out source file (the default on Windows) left a trailing '\r' on every summary line. That '\r' survived into docs/reference/http-api.md and configuration.md, making the generated markdown differ from the LF-committed pages and failing DocsReferenceGenerationTests on the windows-latest CI leg while passing on ubuntu. Strip the trailing '\r' in both ExtractSummary (ConfigInventory) and CleanXmlText (RouteInventory); cli.md already stripped it, so harden its remaining split site too. Also pin the file-enumeration order: Directory.EnumerateFiles / Directory.GetFiles return entries in a filesystem-dependent order, so add an ordinal sort on the path plus FileRelativePath/Line tiebreakers on the final result sorts to keep collection order identical across operating systems.
|
One thing to flag before this merges, since it needs a decision only you can make. The The decision is what should happen once this lands. On the push-to-master that the merge produces, the deploy job's condition becomes true and Worth being precise about what this needs, since it's a common assumption: there's no secret to add for this path. The workflow uses the GitHub-Pages-native actions ( So, a question and a couple of options:
Happy to make whichever you prefer here so the merge is clean. If you'd rather sort the Pages setup separately and merge as-is, that works too — just let me know and I'll gate the deploy job so master stays green in the meantime. |
|
A separate design point on the generated reference pages, since this PR sets the policy and I'd rather raise it than let it set a precedent silently. The branch treats the two generated doc trees differently: the docfx API pages under On reflection I think The trade-off is real but modest: you'd lose the PR-diff visibility of a generated page changing, and the pages would no longer be browsable as raw files on GitHub — only on the built site. The source change that caused them is still reviewable. My lean is to switch (The same question doesn't apply to the SysML-generated |
|
After merging into the master branch, the action completed successfully but it looks like some of the links are broken and the css doesn't load. Likely an issue with a base path or something? I'm not sure how GitHub Pages handles paths and relative links. https://trakhound.github.io/MTConnect.NET Let me know if there is something I need to configure on my end. |
|
I’ll look into this. I’ll fix all broken links and add a check for broken internal links (i.e. checking links referencing files/headings within the docs, not links referencing websites/URLs on the Internet). |
|
The is actually less about broken links (which there are too) and more about deployment to a I’ll create separate PRs to fix the issues: 1.[#179] fix the broken links and prevent them; 2. [#180] add an env var so that we can build the docs to any URL path (e.g. we will use I’ll prioritise #180 so that the deployed docs work as expected. |
|
@PatrickRitchie, both halves of that report are covered by open PRs. Proposed merge order: |
Summary
This branch delivers four things: a VitePress documentation site for the repository, a build gate that treats missing XML documentation as an error across the shipped libraries, a SysML-importer extension plus regeneration so every generated file is fully documented, and a concepts + migration narrative that pairs with the v7 agent-validation work now on master.
Documentation site
A VitePress site rooted at the existing top-level
docs/directory, with Mermaid diagrams enabled for architecture, sequence, class-relationship, state-machine, and wire-flow diagrams. The site documents the full repository: every shipped library and module, every CLI tool, every wire format and codec, every configuration option, the public-surface API, and the project's MTConnect Standard compliance posture.Top-level navigation:
tools/dotnet.sh,tools/test.sh, and SysML importer.Auto-generated API reference
The API reference under
docs/api/is generated by docfx from the Debugnet8.0build of every shipped library DLL plus its XML doc file. The configuration lives atdocs/.docfx/docfx.json; the regeneration script atdocs/scripts/generate-api-ref.shcompiles each library with-p:GenerateDocumentationFile=trueand then runsdocfx metadata, producing a flatNamespace.Type.mdlayout that VitePress consumes directly.The per-type pages are gitignored and regenerated on every build, so the repository does not carry a stale copy of the API surface. The section landing page
docs/api/index.mdis the only tracked file underdocs/api/.The legacy v1
MTConnect.Assets.Json.CuttingTools.JsonProcessFeedrateshadows the cppagent v2JsonProcessFeedRateon a case-insensitive module path; the legacy type is excluded viadocs/.docfx/filter.ymlso the module resolver does not collide on the case-variant pair. The cppagent v2 type stays in the reference.Documentation gate
libraries/Directory.Build.propstreats CS1591 (missing XML documentation comment) as a build error for the production libraries, so the API reference cannot regress to undocumented members. Every hand-authored and generated public, internal, and private type and member carries a substantive doc comment describing its contract.SysML importer and regeneration
The SysML importer in
MTConnect.NET-SysMLis extended so the CompositionState and Direction event subtype value vocabularies (one enumeration per subtype) and the shared CuttingToolMeasurementbase are materialized as documented generated output instead of stale orphan files. TheMTConnect.NET-Commonlibrary is regenerated from the mtconnect/mtconnect_sysml_model v2.7 tag; regeneration is deterministic, and stale v2.3 generator output superseded by the v2.7 equivalents has been removed.Concepts: agent validation events
docs/concepts/agent-validation-events.mddocuments the fullInvalid*Addedfamily onMTConnectAgentfrom both the consumer and the contributor perspective: why the agent emits events instead of throwing, how each event maps to a delegate, the uniform handler signatures, theInputValidationLevelknob that gates everything, the per-failure-categoryValidationResult.Codevalues, and the naming convention plus call-site pattern for adding a new family member. The page covers all six current entries (InvalidDeviceAdded,InvalidComponentAdded,InvalidCompositionAdded,InvalidDataItemAdded,InvalidObservationAdded,InvalidAssetAdded), including the pre-flightValidateDevice(IDevice)helper that exposes the same checkAddDeviceruns internally.Migration note: v7 ValidationResult consolidation
docs/migration/v7-validation-result.mdis the migration playbook for the v7 collapse of three pre-v7 per-domain validation result structs (MTConnect.Assets.AssetValidationResult,MTConnect.Devices.DataItems.ValidationResult,MTConnect.Observations.ObservationValidationResult) into one universalMTConnect.ValidationResultwith an added machine-readableCodeproperty. Covers the type-replacement table, theValid()/Invalid(code, message)factory shorthand, and before/after code samples for both the handler side (agent subscribers) and the Asset author side (Asset.IsValidoverrides). Reachable via a new/migration/sidebar group, which future migration notes can join.CI
.github/workflows/docs.ymlruns on every push and pull request to master. Each run sets up .NET 8.0 and Node 20, installs docfx, runsdocs/scripts/generate-api-ref.sh, thennpm run buildinsidedocs/. On push to master the built site is uploaded as a Pages artifact and thedeployjob publishes it to GitHub Pages. Action versions are SHA-pinned with tag aliases in trailing comments.docs/package.jsonlives insidedocs/; a!docs/package.jsonallow-list entry was added to.gitignorebecause the repository's blanketpackage.jsonignore targets the legacy gulp-era build artefacts.