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

misc #125

Merged
merged 87 commits into from
Jun 9, 2023
Merged

misc #125

merged 87 commits into from
Jun 9, 2023

Conversation

LinqLover
Copy link
Collaborator

@LinqLover LinqLover commented Sep 26, 2022

A mix of minor styling, code-related, and content-related changes that should hopefully not need much discussion. :-)

@LinqLover LinqLover self-assigned this Sep 26, 2022
LinqLover and others added 28 commits September 26, 2022 19:19
We still respect Vassili Bykov for authoring the original version of the Regex package, but we can't maintain a list of all authors for each package in the Trunk.
Adapting all screenshots for high-dpi aware dimensions is yet to come ...
This did it:

	| matcher files |
	matcher := '%%\{(SBESqueakPicture)(([^\r\n]*([\r\n]|\r\n))%%)*(])\}' asRegex.
	files := SBEScriptBuilder getTexFilesIn: SBEScriptBuilder resourceDirectory.
	files
		collect: [:file | file -> (SBEScriptBuilder collectScriptsFromFile: file)]
		as: Dictionary.
	files do: [:file |
		file writeStreamDo: [:stream | | translated |
			translated := matcher copy: file contents translatingMatchesUsing: [:s | '\begin{ExecuteSmalltalkScript}' , (matcher subexpression: 5) , (((matcher subexpressions: 2) , (matcher subexpressions: 4) , (matcher subexpressions: 6)) join) , (matcher subexpression: 5) , '\end{ExecuteSmalltalkScript}'].
			stream reset; nextPutAll: translated]]
Regex:
    SBESqueakPicture( writeTo: .* (frame: .* ))using:(?= \[)
->
    SBEScreenshotRecorder$1building:
This did it (thanks Copilot!):

    > const fs = require('fs')
    > const path = require('path')
    > const glob = require('glob')
    > const replace = require('replace-in-file')
    > var options = {
      files: glob.sync('**/*.tex', {ignore: ['**/node_modules/**']}),
      from: /(?<=\\begin\{ExecuteSmalltalkScript\}((?<!\\end\{ExecuteSmalltalkScript\})[\s\S\n\r])*(?<!(fraction:(\s*\d+(\.\d+)?\s*@\s*)?|crtab:|selection:|selectAt:|to:|by:|\/|\*|[<>])\s?)(?<!-|-?\d+\.\d*)\(?-?\d+(\.\d+)?(?! px)(?!(\d*\.)?\d))(?!\.png)(?![\}'"])(?!\s*to:)/gi,
      to: ' px',
    }
    > replace.sync(options)
In high-dpi mode, saving of scenes may actually take more than 5 seconds.
Basically, we must not use \includegraphics.scale any longer to avoid assumptions on the current scaleFactor for the screenshots.
@LinqLover LinqLover merged commit c92b97e into hpi-swa-lab:master Jun 9, 2023
@LinqLover LinqLover mentioned this pull request Jun 27, 2023
3 tasks
@LinqLover LinqLover deleted the misc-1 branch July 10, 2023 17:08
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