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

Display deprecation notice in generated documentation #115

Merged
merged 5 commits into from
Mar 29, 2024

Conversation

nikitawootten-nist
Copy link
Collaborator

@nikitawootten-nist nikitawootten-nist commented Mar 25, 2024

Committer Notes

Display deprecation in generated documentation.

  • Include an example of a deprecated definition in the "everything" test metaschema

  • Display deprecation in reference documentation

    • The .deprecated-header class is applied to item headers, which could be used for additional styling in the future
    • A deprecation pill is added to the definition body specifying the version it was deprecated

    image

  • Display deprecation in definition documentation

    • The .deprecated-header class is applied to item headers, which could be used for additional styling in the future
    • A deprecation pill is added to the definition body specifying the version it was deprecated

    image

  • Display deprecation in outline documentation

    • The .OM-name-deprecated class is applied to outline links, which is styled in the example CSS as strike-through text.

    image

  • Test the implementation on the OSCAL-Reference

Note that I decided displaying deprecation notices in the index documentation, as the index does not show any other details.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you squashed any non-relevant commits and commit messages? [instructions]
  • Do all automated CI/CD checks pass?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you included examples of how to use your new feature(s)?
  • Have you updated all website and readme documentation affected by the changes you made? Changes to the website can be made in the website/content directory of your branch.

@nikitawootten-nist nikitawootten-nist requested a review from a team as a code owner March 25, 2024 02:39
Copy link

github-actions bot commented Mar 25, 2024

XSpec Test Results

  2 files  ±0  40 suites  ±0   0s ⏱️ ±0s
105 tests ±0  90 ✅ ±0  15 💤 ±0  0 ❌ ±0 
114 runs  ±0  99 ✅ ±0  15 💤 ±0  0 ❌ ±0 

Results for commit fc7ba4a. ± Comparison against base commit 7637dd2.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@wendellpiez wendellpiez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only suggestions I have are syntax sugar - nice work here, @nikitawootten-nist.

@@ -152,6 +153,7 @@
</div>
<xsl:where-populated>
<div class="body">
<xsl:apply-templates select="$definition/@deprecated"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! adding to the default traversal by selecting and processing the attribute.

src/document/common/common-definitions.xsl Outdated Show resolved Hide resolved
src/document/json/object-map-html.xsl Outdated Show resolved Hide resolved
@@ -65,7 +65,7 @@
<div class="model-entry definition { tokenize($me/@_metaschema-json-id,'/')[2] }">
<xsl:variable name="header-class" expand-text="true">{ if (exists(parent::map)) then
'definition' else 'instance' }-header</xsl:variable>
<div class="{ $header-class }">
<div class="{ $header-class }{ if (exists($me/@deprecated)) then ' deprecated-header' else '' }">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to tightening the path I might put this expression into the $header-class variable, as it already templates this ... no biggie, certainly.

@galtm galtm mentioned this pull request Mar 26, 2024
8 tasks
@nikitawootten-nist nikitawootten-nist merged commit f3722c7 into develop Mar 29, 2024
3 checks passed
@nikitawootten-nist nikitawootten-nist deleted the document-display-deprecation branch March 29, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants