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

Docs/one md per predicate #571

Merged
merged 2 commits into from
Feb 24, 2024
Merged

Docs/one md per predicate #571

merged 2 commits into from
Feb 24, 2024

Conversation

ccamel
Copy link
Member

@ccamel ccamel commented Feb 23, 2024

This PR updates the doc generation process to create separate markdown files for each predicate, moving away from the previous approach of compiling everything into a single large file. This change is made in anticipation of incorporating unit test generation directly into these markdown files as part of the documentation (one day, maybe).

Summary by CodeRabbit

  • Documentation
    • Updated and added documentation for various predicates including querying account balances, converting addresses, block information retrieval, cryptographic operations, DID component extraction, JSON-Prolog conversion, file operations, and URI encoding/decoding.
  • Refactor
    • Improved internal documentation generation scripts and templates for better maintainability and readability.
  • Style
    • Standardized comment formatting across codebase to enhance readability and consistency in examples.

@ccamel ccamel self-assigned this Feb 23, 2024
Copy link
Contributor

coderabbitai bot commented Feb 23, 2024

Walkthrough

This update introduces a series of enhancements and new features across various documentation and script files related to Prolog predicates and functionalities. It includes the introduction of new predicates, improvements in documentation readability, and updates in scripting logic for better consistency and functionality. The changes aim to make the documentation more accessible and the scripts more efficient, reflecting a thoughtful refinement of both content and code structure.

Changes

Files Summary
docs/predicate/... Introduced and updated predicates with signatures, examples, and usage for various functionalities.
scripts/... Updated function naming conventions, introduced new dependencies, and modified template logic for documentation generation.
x/logic/predicate/... Updated comments for clarity and consistency, particularly in examples sections.

"In the realm of code, where logic plays and bytes do roam,
A rabbit hopped, through files and scripts, making it home.
With each leap and bound, changes were sown,
Predicates refined, and documentation grown.
🐇💻✨
Celebrate we do, for progress shown,
In this digital burrow, where knowledge is stone."

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@ccamel ccamel marked this pull request as ready for review February 23, 2024 16:46
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0dd8526 and c7825b6.
Files selected for processing (35)
  • docs/predicate/bank_balances_2.md (1 hunks)
  • docs/predicate/bank_locked_balances_2.md (1 hunks)
  • docs/predicate/bank_spendable_balances_2.md (1 hunks)
  • docs/predicate/bech32_address_2.md (1 hunks)
  • docs/predicate/block_height_1.md (1 hunks)
  • docs/predicate/block_time_1.md (1 hunks)
  • docs/predicate/chain_id_1.md (1 hunks)
  • docs/predicate/crypto_data_hash_3.md (1 hunks)
  • docs/predicate/did_components_2.md (1 hunks)
  • docs/predicate/ecdsa_verify_4.md (1 hunks)
  • docs/predicate/eddsa_verify_4.md (1 hunks)
  • docs/predicate/hex_bytes_2.md (1 hunks)
  • docs/predicate/json_prolog_2.md (1 hunks)
  • docs/predicate/open_4.md (1 hunks)
  • docs/predicate/read_string_3.md (1 hunks)
  • docs/predicate/source_file_1.md (1 hunks)
  • docs/predicate/string_bytes_3.md (1 hunks)
  • docs/predicate/uri_encoded_3.md (1 hunks)
  • scripts/generate_command_doc.go (1 hunks)
  • scripts/generate_predicates_doc.go (5 hunks)
  • scripts/main.go (2 hunks)
  • scripts/templates/doc.gotxt (1 hunks)
  • scripts/templates/func.gotxt (1 hunks)
  • scripts/templates/text.gotxt (1 hunks)
  • x/logic/predicate/address.go (1 hunks)
  • x/logic/predicate/bank.go (3 hunks)
  • x/logic/predicate/block.go (2 hunks)
  • x/logic/predicate/chain.go (1 hunks)
  • x/logic/predicate/crypto.go (3 hunks)
  • x/logic/predicate/did.go (1 hunks)
  • x/logic/predicate/encoding.go (1 hunks)
  • x/logic/predicate/file.go (2 hunks)
  • x/logic/predicate/json.go (1 hunks)
  • x/logic/predicate/string.go (2 hunks)
  • x/logic/predicate/uri.go (1 hunks)
Files skipped from review due to trivial changes (26)
  • docs/predicate/bank_balances_2.md
  • docs/predicate/bank_locked_balances_2.md
  • docs/predicate/bank_spendable_balances_2.md
  • docs/predicate/bech32_address_2.md
  • docs/predicate/block_height_1.md
  • docs/predicate/block_time_1.md
  • docs/predicate/chain_id_1.md
  • docs/predicate/crypto_data_hash_3.md
  • docs/predicate/did_components_2.md
  • docs/predicate/ecdsa_verify_4.md
  • docs/predicate/eddsa_verify_4.md
  • docs/predicate/hex_bytes_2.md
  • docs/predicate/json_prolog_2.md
  • docs/predicate/open_4.md
  • docs/predicate/read_string_3.md
  • docs/predicate/source_file_1.md
  • docs/predicate/string_bytes_3.md
  • docs/predicate/uri_encoded_3.md
  • scripts/templates/func.gotxt
  • x/logic/predicate/chain.go
  • x/logic/predicate/crypto.go
  • x/logic/predicate/encoding.go
  • x/logic/predicate/file.go
  • x/logic/predicate/json.go
  • x/logic/predicate/string.go
  • x/logic/predicate/uri.go
Additional comments: 7
scripts/templates/doc.gotxt (1)
  • 7-7: The adjustment in the header level within the header template call seems appropriate for the new documentation structure. Ensure that this change maintains consistency in header levels across all documentation.
scripts/templates/text.gotxt (1)
  • 1-3: Switching from get to index for accessing global context variables and introducing $quotedPredicate are positive changes for readability and functionality. Ensure $quotedPredicate is used consistently and correctly across all relevant instances.
scripts/main.go (1)
  • 35-35: Renaming functions to start with lowercase letters suggests these are intended for internal use. Ensure this change does not inadvertently affect any external dependencies that might rely on these functions being exported.

Also applies to: 46-46

x/logic/predicate/block.go (1)
  • 21-21: Updating comments to provide clearer examples for querying block height and time enhances documentation clarity. Ensure all examples across the documentation follow consistent formatting and are accurate.

Also applies to: 45-45

x/logic/predicate/did.go (1)
  • 30-30: Refining examples in the comments section to better illustrate decomposing a DID into its components enhances clarity. Ensure all examples across the documentation are consistent and accurate.
scripts/generate_predicates_doc.go (1)
  • 42-79: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [9-143]

Introducing new dependencies, modifying logic, and adding functions for predicate handling and template rendering are significant improvements to the documentation generation process. Ensure thorough testing is conducted to verify the new process works as expected and does not introduce regressions.

x/logic/predicate/bank.go (1)
  • 24-24: Updating comments to provide clearer examples for querying different types of balances enhances documentation clarity. Ensure all examples across the documentation follow consistent formatting and are accurate.

Also applies to: 59-59, 91-91

@ccamel ccamel requested a review from amimart February 23, 2024 17:06
Copy link
Member

@amimart amimart left a comment

Choose a reason for hiding this comment

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

Great enhancement! Can't wait for the next step 😉

@ccamel ccamel merged commit 7879f80 into main Feb 24, 2024
19 checks passed
@ccamel ccamel deleted the docs/one-md-per-predicate branch February 24, 2024 12:20
@bot-anik
Copy link
Member

🎉 This PR is included in version 7.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants