-
Notifications
You must be signed in to change notification settings - Fork 210
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
Add Save as PDF option #1349
Add Save as PDF option #1349
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1349 +/- ##
=======================================
Coverage 66.57% 66.57%
=======================================
Files 125 125
Lines 2546 2546
Branches 397 397
=======================================
Hits 1695 1695
Misses 851 851 |
@publiclab/is-reviewers How does this change look? |
examples/demo.js
Outdated
} | ||
|
||
/* | ||
* savePDF() |
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.
Could you please convert this to a JSDoc comment?
examples/demo.js
Outdated
@@ -207,6 +209,39 @@ window.onload = function () { | |||
}); | |||
} | |||
|
|||
//returns the data URL for the last image in the sequence |
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.
Please start with a capital letter, end with a .
and add space between //
and the sentence. We are trying to maintain consistency among all comments. Thank you.
Edits follow the JSDoc guidelines. Comments begin with a capital letter and end with a period.
@harshkhandeparkar Thanks for the feedback! I have edited the function comments to fit JSDoc comment guidelines, and the inline comments to start with a capital letter and end with a period. Is this the format you were looking for? |
} | ||
|
||
/** | ||
* Download the given image URL as a PDF file. |
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.
Remove full stop from phrases.
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.
Isn't it a complete sentence?
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.
It seems like the JSDoc examples usually look like this (they use imperative sentences).
Do we actually need https://github.com/publiclab/image-sequencer/pull/1349/files#diff-32607347f8126e6534ebc7ebaec4853d in this pr? |
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.
LGTM
} | ||
|
||
/** | ||
* Download the given image URL as a PDF file. |
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 you should use the @description
directive instead of direct comment.
* @description Download.....
This looks great. Thank you so much! |
* Add Save as PDF option * Edit coments for consistency Edits follow the JSDoc guidelines. Comments begin with a capital letter and end with a period.
Fixes #1284
I added a "Save as PDF" option for export, using the dependency jsPDF, which I installed in the project. Here is a screenshot of the options box:
Here is a screenshot of the PDF that was downloaded (I named the file "index.pdf" -- is that a good filename for now or is there something more descriptive we should change it to?):
Here is an example of a PDF generated with the new "Save as PDF" option:
npm test
@publiclab/is-reviewers
for help, in a comment below