-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add web bundle as download option #241
Conversation
|
153d2cc
to
ef8fa1c
Compare
I tested unzipping the file on my machine and running One thing, though, this is a zip bomb, with no inner folder. Would it make sense to put all the contents in a |
@@ -27,6 +35,7 @@ export class DemoComponent implements OnDestroy, OnInit { | |||
}; | |||
outputFormats = [ | |||
{ value: "html", display: $localize`Offline HTML` }, | |||
{ value: "zip", display: $localize`Web Bundle` }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zipped Web Bundle?
That would give me "Fichiers Web zippés" and "Archivos web comprimidos".
I find just "Web Bundle" insufficiently clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some research on "zippés" vs "comprimés" for the French translation, and Google tells me the former is much more common than the latter, and that matches my intuition, but Spanish doesn't seem to have that, it would have to be "Archivos web comprimidos zip" if we wanted to be precise, but I think that's unnecessary, adding more verbosity with no additional clarity, whereas the French "zippés" is shorter and more common, thus a no brainer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mais même selon l'OQLF "zippé" est acceptable dans certains contextes ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not going to be picky, but my first choice is "zippé" because we're creating an actual .zip file.
Does anyone have an opinion on the English, though, whether we should add "Zipped" in front?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "zipped" is redundant - Bundle implies that it's bundled/zipped which is sufficient
By the way, we already applied prettier:
the generated |
|
Yes, I think this is a good idea - MacOS or Windows are going to unpack it in a new folder anyway, but this way nobody gets any nasty surprises. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good, mostly style comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! sorry for the delay in approving!
can the readme contain section about deployment on wordpress, with the apporpiate snippet : |
Absolutely, just add that in your PR. |
The readme is only in this branch. I will have to add the instructions after this branch is merged |
.toISOString() | ||
.replace(/[^0-9]/g, "") | ||
.slice(0, -3); | ||
const basename = `readalong-${timestamp}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When people provide a title, adding the title to the filename will help them find it after download, especially if they do multiple books.
const basename = (this.slots.title?this.slots.title.replace(/\s/g,"_").toLowerCase():'readalong')+`-${timestamp}`;
38a0c7c
to
0714343
Compare
.replace(/[^0-9]/g, "") | ||
.slice(0, -3); | ||
const basename = | ||
(this.slots.title ? slugify(this.slots.title, 15) : "readalong") + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, except it's too anglocentric: if the title is ᐃᓄᒃᑎᑐᑦ, the slug is empty and you get -20240402212031.zip
, and the .txt file inside is similarly limited. Similarly "Éric" becomes "ric", but the Inuktitut example is a lot more dramatic. Can we slugify the text-unidecode output, maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this @joanise - I've updated it to use unidecode
- Update $ style for rxjs variables - Add inner folder for zip - Use timestamps for filenames - Remove indentation for readme - Added explicit version for unpkg import - Added error handling for zip download promise
…geAssetsFolder string BREAKING CHANGE: useAssetsFolder is no longer valid. The equivalent is imageAssetsFolder='assets/' which is the default.
Here's a first stab at this. A few things:
I don't love how much logic is in theI can live with this for now, but I think we're due for some refactoringdemo.component.ts
output
since if people are combining multiple readalongs they'll have to rename everything. timestamps?assets
folder stuff needs to be improved. We have theuse-assets-folder
property, but the value is just a boolean. I think we should instead have that be a path that could get prepended to all images, because right now, the images are hardcoded in the.readalong
file as being in anassets
folder relative to the location of the ReadAlong, which is sure to break in many deployments. Update: see fix(assets)!: get rid of useAssetsFolder boolean and replace with imageAssetsFolder string #243prettier
on everything. I didn't do that here yet, to make sure the content changes are easily parsable.