Skip to content

Minor tweaks prepping for adding diff support#27

Merged
pmolodo merged 2 commits intoaousd:mainfrom
pmolodo:diff_prep
Mar 9, 2026
Merged

Minor tweaks prepping for adding diff support#27
pmolodo merged 2 commits intoaousd:mainfrom
pmolodo:diff_prep

Conversation

@pmolodo
Copy link
Copy Markdown
Collaborator

@pmolodo pmolodo commented Feb 24, 2026

  • add filter_decorate_diff
  • pandoc_ast_diff.py: add progress bar
  • remove extra / overridden --from pandoc arg

@pmolodo pmolodo changed the title Minor tweaks preppring for adding diff support Minor tweaks prepping for adding diff support Mar 3, 2026
"--defaults",
spec,
combined,
"--from=gfm+",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please point to where is this re-used or overwritten? Thanks.

Copy link
Copy Markdown
Collaborator Author

@pmolodo pmolodo Mar 6, 2026

Choose a reason for hiding this comment

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

Here:

"--from=markdown-hard_line_breaks",

            "--from=markdown-hard_line_breaks",

import argparse
from typing import List, Dict, Any, Tuple

from tqdm import tqdm
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not against adding additional external dependencies per se, but this specific use case seems to be used mostly for debugging and rather noisy otherwise.

Copy link
Copy Markdown
Collaborator Author

@pmolodo pmolodo Mar 6, 2026

Choose a reason for hiding this comment

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

IMO some sort of progress indicator is pretty necessary - running ast_diff on my 64-core machine took ~6 minutes... which is a long time to have a terminal sit with no output. Any user without prior knowledge of the tool is bound to wonder if it's hanging.

If you really don't like the external dependency, we can remove it, and write a manual/ugly one, but I do think we need some sort of progress indicator.

Also, tqdm is a fairly small dependency, with 0 dependencies of it's own:

https://pypi.org/project/tqdm/

tqdm does not require any dependencies (not even curses!), just Python and an environment supporting carriage return \r and line feed \n control characters.

Compared to, ie, pandoc, it's a pretty negligible additional footprint...

Copy link
Copy Markdown
Collaborator Author

@pmolodo pmolodo Mar 7, 2026

Choose a reason for hiding this comment

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

Hmm... on second thought - decided to take a look at how hard it would be to speed up the LCS computation, and it turned out to be very simple:

With that change, there's not really a need for a progress bar anymore, so I'll remove that commit.

@OleksiyPuzikov
Copy link
Copy Markdown
Contributor

LGTM

@pmolodo pmolodo merged commit d88fe59 into aousd:main Mar 9, 2026
1 check passed
@pmolodo pmolodo deleted the diff_prep branch March 9, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants