Skip to content

Commit

Permalink
Remove "per_page target" argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Azeirah committed Nov 26, 2024
1 parent dd0bdc5 commit e89431e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions deployment/remarks-server/remarks_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"md_hl_format": "whole_block",
"md_page_offset": 0,
"md_header_format": "atx",
"per_page_targets": [],
"assume_malformed_pdfs": False,
}

app = Flask("Remarks http server")
Expand Down
7 changes: 0 additions & 7 deletions remarks/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ def main():
action="store_true",
help="Create a '*_remarks-only.pdf' file with annotated pages only (unannotated ones will be out)",
)
parser.add_argument(
"--per_page_targets",
nargs="+",
help="Target specific file formats per page. Choose at least one of the following extensions: md pdf png svg. This is empty by default",
default=[],
metavar="FILE_EXTENSION",
)
parser.add_argument(
"-v",
"--version",
Expand Down
7 changes: 0 additions & 7 deletions remarks/remarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def run_remarks(
def process_document(
metadata_path,
out_path,
per_page_targets=None,
ann_type=None,
combined_pdf=False,
modified_pdf=False,
Expand Down Expand Up @@ -205,12 +204,6 @@ def process_document(
ann_page = add_smart_highlight_annotations(smart_hl_data, ann_page, scale)
smart_hl_groups = extract_groups_from_smart_hl(smart_hl_data)

if per_page_targets and (has_annotations or has_smart_highlights):
out_path.mkdir(parents=True, exist_ok=True)
if "pdf" in per_page_targets:
subdir = prepare_subdir(out_path, "pdf")
work_doc.save(f"{subdir}/{page_idx:0{pages_magnitude}}.pdf")

if modified_pdf and (has_annotations or has_smart_highlights):
mod_pdf.insert_pdf(work_doc, start_at=-1)
pages_order.append(page_idx)
Expand Down
3 changes: 1 addition & 2 deletions test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from syrupy.extensions.single_file import SingleFileSnapshotExtension
import remarks

default_args = {"ann_type": ["scribbles", "highlights"], "combined_pdf": True, "modified_pdf": False,
"per_page_targets": []}
default_args = {"ann_type": ["scribbles", "highlights"], "combined_pdf": True, "modified_pdf": False}


class JPEGImageExtension(SingleFileSnapshotExtension):
Expand Down

0 comments on commit e89431e

Please sign in to comment.