
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
leanpub-workflow
Advanced tools
This utility helps with creating and publishing an e-book via Leanpub. It covers processing of images, syncing of images and text files with DropBox, and creating full or partial previews on Leanpub.
npm install -g leanpub-workflow
You'll need a Leanpub account and a Dropbox account. There's no need for a DropBox client on the PC (but it doesn't harm either).
Select the "dropbox" type for your Leanpub project.
Create a new App in your Dropbox-Account (https://www.dropbox.com/developers/apps?_tk=pilot_lp&_ad=topbar4&_camp=myapps) and generate an access-token for that app.
Go to your Leanpub account https://leanpub.com/author_dashboard/settings and find your API-Key.
create a leanpub-config.json file as:
{
"dropbox_api":"dont-tell-anybody",
"leanpub_api": "keep-it-secret",
"leanpub_slug": "mycoolbook",
"dropbox_basedir": "/mycoolbook/manuscript",
"local_basedir": "/home/myname/bookproject",
"images_raw": "/home/myname/bookproject/img-raw",
"images_dest": "/home/myname/bookproject/images",
"images_width": 480
}
interactive mode: When called without parameters, leanpub-workflow will present a menu to chose from.
batch mode: When called with one or more parameters, leanpub will not show the menu, but instead execute the command given in the first parameter.
By default, leanpub-workflow tries to load a file 'leanpub-config.json' from the current directory. You can chose a different file with the option --config or -c:
leanpub-workflow -c </path/to/other-config.json> [command]
Possible operations are:
This will consider all images found in the folder denoted by images_raw in the config and copy them to the folder images_dest.
If the image width is above the images_width config, it will resize the image so that the width is images_width and the height is reduced accordingly to keep aspect ratio.
If the image width is less than images_width, does not change size.
If the Image is not in jpg-Format, converts to jpg
Original images are not modified.
This will consider all images in images_dest and all *.md files in local_basedir
If a file exists locally but not in the Dropbox -> send it to DropBox.
If a file exists in the DropBox, but not locally -> delete it in the DropBox.
If a file is newer locally than in the DropBox -> Send it to the DropBox.
If it is a file with *.md Extension, send it with a *.txt extension.
Files which are not in the images_dest folder and have not the extension .md are ignored.
Doesn't work. Currently gets always a "500" error from the server. Probably I didn't get the syntax right.
Create a Preview from the files named in Subset.md/Subset.txt. The Preview is stored in the Dropbox previews-Folder.
Create a Preview from the files named in Book.md/Book.txt. The preview will be stored in the Dropbox previews-Folder.
Leanpub jobs can take quite some time. The status command shows if a job is still running, and what is its state.
Downloads the last preview pdf from the Dropbox to the current folder. The Filename will be ${leanpub_slug}-preview.pdf
Display the program version and exit
npm test
Apache 2.0
FAQs
E-Book workflow with dropbox and leanpub
We found that leanpub-workflow demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.