Skip to content

Big refactoring and two new options.#105

Merged
MaxMelcher merged 16 commits intoMaxMelcher:mainfrom
giuliov:main
May 2, 2022
Merged

Big refactoring and two new options.#105
MaxMelcher merged 16 commits intoMaxMelcher:mainfrom
giuliov:main

Conversation

@giuliov
Copy link
Copy Markdown
Contributor

@giuliov giuliov commented Apr 3, 2022

Don't be scared by the size of the PR: I did quite a lot of refactoring/reorganizing. I am sorry not being able to submit a smaller PR but I need to break down the WikiPDFExporter into manageable and unit-testable chunks.

It adds two new options:

  • --include-unlisted-pages use a different algorithm to find markdown pages; it should better match current Wiki behaviour.
  • --exclude-paths accepts a list of regular expressions and skip matching pages.

For both options, you'll find unit and integration tests. Part of the refactoring was to organize the test files, so it should be easier to add more integration tests.

I have a few more ideas like optimizing memory allocations for big Wikis, but it will be a different PR.

Hope you'll like my changes and approve them.

@giuliov
Copy link
Copy Markdown
Contributor Author

giuliov commented Apr 4, 2022

The latest commits added to the PR bring in:

  • an major architectural change: Chrome loads the temporary HTML from file system instead of keeping it in memory and send it via SetContentAsync API. Why? To solve the 100MB limit. I tested with my main Wiki which generates a 160MB HTML file (670MB of PDF) in less than 5 mins on my machine.
  • --chrome-timeout option
  • log outputs relative time to help measuring the steps

@MaxMelcher MaxMelcher merged commit b4933b1 into MaxMelcher:main May 2, 2022
@MaxMelcher
Copy link
Copy Markdown
Owner

wow - what big one... thanks a lot @giuliov

@MaxMelcher MaxMelcher mentioned this pull request May 2, 2022
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