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

chore: Automate content generation of some Priority docs #2011

Merged
merged 13 commits into from Jun 2, 2023

Conversation

claremacrae
Copy link
Collaborator

@claremacrae claremacrae commented Jun 2, 2023

Description

Summary

Use approval test files as snippets for docs and sample markdown files.

Background:

Detail

User visible changes:

  • The file format samples for Priority emojis are now machine-generated in:
    • user docs
    • Tasks-Demo vault
  • A side-effect is that some minor white-space errors were fixed

Code changes:

  • Added helper functions in PriorityField to convert Priority enum values to string

Tests

  • New file tests/TaskSerializer/DocsSamplesForTaskFormats.test.ts generates *.approved.md files showing how Priority values are represented in Emoji and dataview file formats.
    • These files are designed to be embedded in to documentation and markdown files
    • When new formats are added, new sample files will be created automatically
    • When priorities are renamed, or more priorities are added, when the tests are run, the approved files will be updated, and mdsnippets can be run automatically for via the GitHub Action to update the docs and sample vault automatically
  • withAllPriorities() is exported, and now includes a useful description for each task, so the tasks are suitable for inclusion in documentation
  • Verify functions in tests/TestingTools/VerifyMarkdownTable.ts now use Visual Studio Code's diff tool for showing and approving differences in approval test files
    • This was the only diff tool I could find, in the ones I have available, that handles Emojis correctly, not corrupting them when editing lines containing Emojis.
    • WARNING: this may need more thought if there are any contributors who don't have VSCode installed, and are reviewing Approval Test diffs

Notes

  • There are other locations in the docs that list the available priorities, such as the list of group names when grouping by priority. These may may be updated in separate steps.

Motivation and Context

  • Start of work towards reducing many repetitious edits in the user docs and sample vault

How has this been tested?

  • With new tests
  • Viewing the changed markdown files in Obsidian, in Source and Reading modes

Screenshots (if appropriate)

Types of changes

Changes visible to users:

  • Documentation (prefix: docs - improvements to any documentation content for users)
  • Sample vault (prefix: vault - improvements to the Tasks-Demo sample vault)

Internal changes:

  • Refactor (prefix: refactor - non-breaking change which only improves the design or structure of existing code, and making no changes to its external behaviour)
  • Tests (prefix: test - additions and improvements to unit tests and the smoke tests)

Checklist

Terms

@claremacrae claremacrae added scope: documentation Improvements or additions to documentation type: internal Only regards development or contributing labels Jun 2, 2023
@claremacrae claremacrae changed the title chore: Automate content generation of Priority docs chore: Automate content generation of some Priority docs Jun 2, 2023
@claremacrae
Copy link
Collaborator Author

@ilandikov You might be interested in this as:

  • it's the start of what I was describing when we last paired
  • it changes the behaviour of withAllPriorities(), which might conflict with what you are working on
  • if you had time to look at it, I would welcome any feedback you had

@ilandikov
Copy link
Collaborator

Looks good =)

So the idea here is to use approvals as snippets for docs? Did I get it right?

@claremacrae
Copy link
Collaborator Author

So the idea here is to use approvals as snippets for docs? Did I get it right?

Yes, nice summary. Also for including in markdown files in the Test Vault.

@claremacrae claremacrae merged commit 06b1653 into main Jun 2, 2023
2 checks passed
@claremacrae claremacrae deleted the automate-priority-format-docs branch June 2, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: documentation Improvements or additions to documentation type: internal Only regards development or contributing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants