Menu ▾ ▴

#325 Add page_indexes parameter to transform functions

open
nobody
None
2026-11-14
2026-01-07
Anonymous
No

Originally created by: HuSharp

Usage Example

  transform_markdown(
      pdf_path="document.pdf",
      markdown_path="output.md",
      page_indexes=range(1, 11),  # Pages 1-10 only
  )
  ```

Discussion

  • Anonymous

    Anonymous - 2026-01-07

    Originally posted by: coderabbitai[bot]

    Summary by CodeRabbit

    • New Features
    • Added optional page selection to PDF conversion tools so users can specify which pages to process when exporting to Markdown or EPUB. The selection is honored throughout the conversion flow, enabling partial-document conversions without changing existing defaults.

    ✏️ Tip: You can customize this high-level summary in your review settings.

    Walkthrough

    This change adds an optional page_indexes: range | None = None parameter to the public functions transform_markdown and transform_epub in pdf_craft/functions.py, and to the corresponding methods transform_markdown, transform_epub, and _extract_from_pdf in pdf_craft/transform.py. The parameter is threaded through these call sites and, when provided, included in a recognize_kwargs dictionary passed to the OCR recognition call so callers can restrict OCR to specified page ranges.

    Estimated code review effort

    🎯 2 (Simple) | ⏱️ ~12 minutes

    • oomol-lab/pdf-craft PR 314: Modifies the same transformation call chain by adding and threading a new optional parameter through transform_markdown, transform_epub, and related internals.
    🚥 Pre-merge checks | ✅ 1 | ❌ 1
    ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :---------: | :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- | | Title check | ⚠️ Warning | The title does not follow the required format of `<type>(<scope>): <subject>`. It is missing the type prefix and follows a generic pattern instead. | Reformat the title to follow the required pattern, for example: `feat(functions): add page_indexes parameter to transform functions` | </subject></scope></type>
    ✅ Passed checks (1 passed) | Check name | Status | Explanation | | :---------------: | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | | Description check | ✅ Passed | The description is related to the changeset, providing a concrete usage example of the new page_indexes parameter being added to the transform functions. |
    ✏️ Tip: You can configure your own custom pre-merge checks in the settings.

    📜 Recent review details **Configuration used**: Organization UI **Review profile**: CHILL **Plan**: Pro
    📥 Commits Reviewing files that changed from the base of the PR and between [a20de2] and f9dd20ce8773e0ff2895cf4a49e784ca4fba8641.
    📒 Files selected for processing (1) * `pdf_craft/transform.py`
    🚧 Files skipped from review as they are similar to previous changes (1) * pdf_craft/transform.py

    Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

    ❤️ Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

    Comment @coderabbitai help to get the list of available commands and usage tips.

     
  • Anonymous

    Anonymous - 2026-01-07

    Originally posted by: HuSharp

    @coderabbitai help

     
  • Anonymous

    Anonymous - 2026-01-07

    Originally posted by: coderabbitai[bot]

    [!TIP]
    For best results, initiate chat on the files or code changes.

    @HuSharp, hello! How can I assist you with this PR? I can help with:

    • Reviewing the changes - I can perform a detailed code review of your page_indexes parameter implementation
    • Answering questions - If you have any questions about the implementation or suggestions
    • Generating tests - I can help create unit tests for the new functionality
    • Documentation - I can help with documentation or usage examples
    • Other requests - Any other specific task you'd like me to help with

    Just let me know what you need!

     
  • Anonymous

    Anonymous - 2026-01-07

    Originally posted by: coderabbitai[bot]

    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.
    • 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.
    • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

    CodeRabbit commands

    These commands are invoked using PR/Issue 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 evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
      • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
      • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
    • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
    • @coderabbitai resolve to resolve all the CodeRabbit review comments.
    • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
    • @coderabbitai generate configuration to create a PR that adds the current resolved configuration as .coderabbit.yaml (or show it if already present).
    • @coderabbitai help to get help.

    Other keywords and placeholders

    • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
    • Add @coderabbitai summary or @cr summary to generate the high-level summary at a specific location in the PR description.
    • Add @coderabbitai or @cr 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.
    • You can also validate your configuration using the online YAML validator.
    • 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

    Status, support, documentation and community

    • Visit our status page to check the current availability of CodeRabbit.
    • Create a ticket on our support page for assistance with any issues or questions.
    • Visit our documentation site for detailed information on how to use CodeRabbit.
    • Join our Discord community to connect with other users and get help from the community.
    • Follow us on X/Twitter for updates and announcements.
     
  • Anonymous

    Anonymous - 2026-01-07

    Originally posted by: HuSharp

    @coderabbitai review

     
  • Anonymous

    Anonymous - 2026-01-07

    Originally posted by: coderabbitai[bot]

    ✅ Actions performed Review triggered. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
     

Log in to post a comment.