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

feat: Initialize documentation #85

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Conversation

jjjermiah
Copy link
Contributor

@jjjermiah jjjermiah commented Dec 12, 2024

Start of documentation, mostly copied the core dependencies and plugins from med-imagetools

  • Set up initial documentation structure using MkDocs, including configuration and integration of Markdown files for the README and CHANGELOG.

this "core" would be the base of the main vs 2.0 branch

Summary by CodeRabbit

  • New Features

    • Added badges for project health and status in the README.
    • Expanded installation instructions with a new environment setup method.
    • Introduced a section for serving documentation locally.
  • Documentation

    • Enhanced clarity and structure of the README, including command-line options and contributing guidelines.
    • Updated inclusion method for CHANGELOG and README in documentation.
    • Introduced a new configuration file for MkDocs documentation, improving navigation and usability.
  • Bug Fixes

    • Corrected formatting for bash commands in the README to enhance readability.
  • Chores

    • Updated project version and dependencies in the configuration files.

Copy link
Contributor

coderabbitai bot commented Dec 12, 2024

Walkthrough

This pull request introduces significant enhancements to the README.md file for the readii project, including the addition of badges, improved installation instructions, and a clearer usage section. It also modifies the documentation structure by updating the inclusion methods in CHANGELOG.md and index.md, and introduces a new mkdocs.yaml configuration file to facilitate documentation generation. Additionally, the pyproject.toml file has been updated to reflect a shift from Sphinx to MkDocs for documentation management, including changes to project dependencies and new documentation tasks.

Changes

File Change Summary
README.md Added badges, encapsulated introduction in HTML comments, expanded installation instructions, clarified usage section, reformatted command-line options, rephrased negative control options, and improved contributing guidelines. Added section for serving documentation locally.
docs/changelog.md Updated inclusion syntax to {% include-markdown %} with rewrite-relative-urls=false.
docs/index.md Replaced README inclusion method with a new directive allowing content inclusion between HTML comments and added a title header.
mkdocs.yaml Introduced new configuration for MkDocs, specifying site details, navigation, plugins, and theme settings.
pyproject.toml Updated project version to "1.19.0", replaced documentation dependencies with MkDocs-related ones, added new documentation tasks, and included new PyPI dependencies.

Possibly related PRs

Suggested reviewers

  • strixy16

🐇 In the README, we now shine,
With badges bright, our project aligns.
Installation's clear, usage refined,
Documentation's path, perfectly designed.
Join us in coding, let’s hop and play,
With MkDocs in tow, we’ll guide the way! 🌟


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>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 testing code 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (6)
docs/index.md (1)

1-8: LGTM! Consider organizing documentation sections.

The include-markdown directive is correctly configured. However, consider organizing the documentation into logical sections beyond just including the README.

Consider adding these common documentation sections:

  • Getting Started Guide
  • API Reference
  • Examples/Tutorials
  • Development Guide
  • Troubleshooting
mkdocs.yaml (2)

1-5: Consider adding security-related configurations.

The basic site configuration looks good, but consider adding security-related configurations.

Add these configurations for better security:

# Prevent XSS attacks
strict: true

# Add CSP headers
extra:
  generator: false  # Remove generator meta tag
  social:
    cards: true    # Enable social cards

30-34: Consider adding useful documentation plugins.

The current plugin selection is good, but could be enhanced.

Consider adding these useful plugins:

plugins:
  - minify:        # Minifies HTML, JS and CSS
      minify_html: true
      minify_js: true
      minify_css: true
  - git-revision-date-localized  # Shows last update date
  - mkdocstrings:  # API documentation from docstrings
      handlers:
        python:
          paths: [src]  # Path to your Python source
README.md (2)

Line range hint 2-14: Consider organizing badges by category.

While the badges provide excellent project status visibility, they could be better organized.

Consider grouping badges by category:

<!-- Status -->
[![CI-CD][ci-badge]][ci-url]
[![codecov][coverage-badge]][coverage-url]
[![CodeFactor][codefactor-badge]][codefactor-url]

<!-- Package -->
[![PyPI - Version][pypi-version-badge]][pypi-url]
[![PyPI - Python Version][python-version-badge]][pypi-url]
[![PyPI - Format][pypi-format-badge]][pypi-url]

<!-- Downloads -->
[![Downloads][pepy-badge]][pepy-url]
[![Docker Pulls][docker-badge]][docker-url]

98-102: Enhance documentation serving instructions.

The documentation serving instructions could be more detailed.

Consider adding more context:

### Serve Documentation Locally

The documentation is built using MkDocs. To serve it locally:

```bash
pixi run -e docs doc-serve

The documentation will be available at http://127.0.0.1:8001


</blockquote></details>
<details>
<summary>pyproject.toml (1)</summary><blockquote>

`92-111`: **Consider documentation migration strategy.**

The shift from Sphinx to MkDocs is well-structured. However, consider the following recommendations:

1. Document the migration process in CHANGELOG.md
2. Ensure all existing documentation is properly converted from Sphinx format to MkDocs format
3. Update any documentation-related CI/CD workflows to use the new MkDocs commands

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 0e868f6ffaf749fe1591d75215e1dcf00cca948b and 7de6f803bf8884091827ffb6f3a474ea1acb07de.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `pixi.lock` is excluded by `!**/*.lock`

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `README.md` (5 hunks)
* `docs/changelog.md` (1 hunks)
* `docs/index.md` (1 hunks)
* `mkdocs.yaml` (1 hunks)
* `pyproject.toml` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* docs/changelog.md

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 yamllint (1.35.1)</summary>

<details>
<summary>mkdocs.yaml</summary>

[error] 35-35: trailing spaces

(trailing-spaces)

---

[error] 36-36: trailing spaces

(trailing-spaces)

---

[warning] 39-39: wrong indentation: expected 4 but found 2

(indentation)

---

[error] 53-53: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (2)</summary>

<details>
<summary>pyproject.toml (2)</summary>

`101-102`: **LGTM!**

The PyPI dependency is well-configured with appropriate version constraints.

---

`104-111`: **Verify mkdocs.yaml configuration file.**

The tasks are well-defined, but let's ensure the referenced configuration file exists and is properly set up.


<details>
<summary>✅ Verification successful</summary>

**mkdocs.yaml configuration is properly set up**

The configuration file exists and contains all essential configurations:
- Site name is defined as "READII"
- Material theme is configured with appropriate features
- Required plugins are set up (awesome-pages, search, git-authors, include-markdown)



</details>

<details>
<summary>🏁 Scripts executed</summary>

The following scripts were executed for the analysis:

Script:

```shell
#!/bin/bash
# Description: Verify mkdocs.yaml exists and contains required configurations

# Check if mkdocs.yaml exists
if [ -f mkdocs.yaml ]; then
    echo "mkdocs.yaml exists"
    # Check for essential configurations
    rg -A 5 "^site_name:|^theme:|^plugins:" mkdocs.yaml
else
    echo "mkdocs.yaml not found"
fi

Length of output: 754

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.51%. Comparing base (c10a568) to head (672362b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #85   +/-   ##
=======================================
  Coverage   44.51%   44.51%           
=======================================
  Files          16       16           
  Lines         739      739           
=======================================
  Hits          329      329           
  Misses        410      410           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (5)
mkdocs.yaml (5)

1-6: Consider adding additional metadata fields for better SEO and documentation.

The basic configuration looks good, but consider adding these fields to enhance documentation discoverability and user experience:

  • site_url: The canonical URL where the documentation will be hosted
  • copyright: Copyright information
  • edit_uri: Path to edit pages on GitHub
 site_name: READII
 repo_url: https://github.com/bhklab/readii
 repo_name: readii
 site_description: Package documentation for readii
 site_author: bhklab
+site_url: https://bhklab.github.io/readii
+copyright: Copyright &copy; 2024 bhklab
+edit_uri: edit/main/docs/

7-23: Consider expanding watch paths for comprehensive documentation updates.

The build configuration is good, but consider adding these paths to the watch list for more comprehensive documentation updates:

  • README.md: To track changes in the main project documentation
  • CHANGELOG.md: To track version history updates
-watch: [docs, src, mkdocs.yaml]
+watch: [docs, src, mkdocs.yaml, README.md, CHANGELOG.md]

26-28: Consider expanding navigation with common documentation sections.

The current navigation structure is minimal. Consider adding these common sections to provide comprehensive documentation:

  • API Reference
  • Getting Started
  • User Guide
  • Contributing Guidelines
 nav:
   - Home: index.md
   - Changelog: changelog.md
+  - Getting Started: getting-started.md
+  - User Guide: user-guide.md
+  - API Reference: api/
+  - Contributing: contributing.md

30-34: Consider adding more plugins for enhanced documentation features.

The current plugin setup is good, but consider these additional plugins to enhance the documentation:

  • mkdocs-material[imaging]: For image processing and optimization
  • mkdocstrings: For automatic API documentation from docstrings
  • mkdocs-git-revision-date-localized-plugin: For showing last update dates
 plugins:
   - awesome-pages                     # simplifies configuring page titles and their order
   - search                            # necessary for search functionality to work
   - git-authors                       # adds authors to pages using git history
   - include-markdown                  # allows for including Markdown files into another Markdown file
+  - mkdocstrings:                     # automatic API documentation from docstrings
+      handlers:
+        python:
+          paths: [src]                # path to your Python source code
+  - git-revision-date-localized       # shows last update date on each page

36-53: Fix formatting issues in theme configuration.

The theme configuration is comprehensive, but there are some formatting issues to address:

  • Remove trailing spaces after theme: on line 36
  • Add a newline at the end of the file
-theme: 
+theme:
 name: material
 # ... rest of configuration ...
 - toc.follow
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 36-36: trailing spaces

(trailing-spaces)


[error] 53-53: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7de6f80 and 672362b.

⛔ Files ignored due to path filters (1)
  • pixi.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • mkdocs.yaml (1 hunks)
  • pyproject.toml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml
🧰 Additional context used
🪛 yamllint (1.35.1)
mkdocs.yaml

[error] 35-35: trailing spaces

(trailing-spaces)


[error] 36-36: trailing spaces

(trailing-spaces)


[error] 53-53: no new line character at the end of file

(new-line-at-end-of-file)

@strixy16 strixy16 merged commit 3b2c294 into main Dec 12, 2024
17 checks passed
@strixy16 strixy16 deleted the jjjermiah/feature/documentation branch December 12, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants