Skip to content

Conversation

efaulhaber
Copy link
Collaborator

Closes #34.

@ericphanson I managed to add the argument, but I'm afraid I need a little more help here.
grafik
The width is now larger than before, and the lines are not wrapped anymore. However, the terminal itself is still the same size and the font as well, which means that the lines are clipped now.
Is there a way to make this work as intended? Thanks!

@ericphanson
Copy link
Owner

thanks for the PR!

I think there are two sides to it:

  • constructing .cast files with a specified width <-- what your PR does
  • changing the width of the "player" object <-- what is missing

The "player" object for documenter is made by the html/javascript code here:

AsciinemaPlayer.create(
'data:text/plain;base64,$(base64_str)',
document.getElementById('$(name)'), {autoPlay: true, fit: false, loop: $(cast.loop)}
);
I think. We need to somehow customize the width. I see the js player object does have configuation including cols: https://docs.asciinema.org/manual/player/options/. So I think what you need to do is read the width from the Cast object and use it in AsciinemaPlayer.create to also set the cols of the player.

@efaulhaber
Copy link
Collaborator Author

That was very helpful, thanks!
It turned out that the option fit was the problem, which was set to fit: false.
grafik
I now set it to fit: "width" and it works as intended:
grafik
The window is still the same size in the docs, but the font appears smaller.

@efaulhaber efaulhaber marked this pull request as ready for review November 20, 2024 16:28
@efaulhaber
Copy link
Collaborator Author

Ready for review now 👍

@efaulhaber
Copy link
Collaborator Author

Any news on this?

@ericphanson
Copy link
Owner

Could you add an example to the documentation to show the usage width kwarg? That would also at least run the code during the tests so if it errors in the future, the docs will stop building and I will know something is wrong

Also, I have the vague feeling I set fit = false on purpose, but I no longer remember why...

@ericphanson
Copy link
Owner

ah, looks like there is some documenter issue with width on this PR:

ERROR: LoadError: UndefVarError: `width` not defined in local scope

https://github.com/ericphanson/Asciicast.jl/actions/runs/11937572536/job/33542889591?pr=35#step:4:180

@ericphanson ericphanson merged commit 828082f into ericphanson:main Dec 9, 2024
7 checks passed
@ericphanson
Copy link
Owner

sorry for the delay! my notifications have been kinda swamped

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.

Set number of columns in Documenter
2 participants