Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@subhamx/notion-to-ebook
Advanced tools
Notion to ebook is a lightweight library to convert notion document consisting of multiple nested documents or databases into an ebook format like PDFs, with the table of contents, page cover, headers etc.
Notion to Ebook is a lightweight library written in Typescript to convert any notion document consisting of multiple nested documents or databases into an ebook format like PDFs, with the table of contents, page cover, headers etc.
This application requires Zero Configuration. The current implementation does most things like arranging all the files as chapters and generating the Table of Contents, cover page, footer, etc.
There are two modes to use this application:
Standalone mode: It allows users to generate a separate PDF for each of the HTML pages. For example, if your notion exports have a total of 12 pages (including all nested docs, tables etc.), then there will be precisely 12 PDFs generated for each one of them. You can find the exported merged file inside session_files/output/standalone.
Merge mode: It allows users to generate a single PDF for the entire export. It concatenates each of the notion pages smartly to generate a single document. Table of contents of the whole document is also included at the beginning to ease browsing across the different sections of the merged PDF. You can find the exported standalone files inside session_files/output/merged.
💡 Document Arranging Logic: In merge mode all documents not linking to any other document at the current level are placed before the documents linking to other ones in alphabetical order.
npm install @subhamx/notion-to-ebook
The following application uses wkhtmltopdf
to generate PDFs. Kindly follow these steps to get wkhtmltopdf
installed and added to PATH
.
⚠️ Packages provided by your distribution might be easier to install but they may not be using a patched Qt and have missing features. So use it at your own discretion.
wkhtmltopdf
by downloading the installer from here.wkhtmltopdf
to PATH. You might or might not need to perform this step, as the installer automatically performs this step for some distributions. (FYI, macOS installer automatically adds to PATH. Another advantage of using a mac? 🤔).wkhtmltopdf
is successfully added to PATH by opening terminal/command prompt/powershell
and executing the following command:wkhtmltopdf --version
Note: On macOS, while trying to install wkhtmltopdf you will be prompted with macOS cannot verify that this app is free from malware. Kindly follow the steps mentioned here to fix it.
The usage is pretty straightforward.
import { buildStandaloneDocs } from "@subhamx/notion-to-ebook";
const token_v2 = "YOUR_NOTION_TOKEN_V2";
const pageId = "NOTION_PAGE_ID";
buildStandaloneDocs(token_v2, pageId);
import { buildMergedDoc } from "@subhamx/notion-to-ebook";
const token_v2 = "YOUR_NOTION_TOKEN_V2";
const pageId = "NOTION_PAGE_ID";
buildMergedDoc(token_v2, pageId);
⚠️ Caution: Whenever you call any of the instances of buildStandaloneDocs or buildMergedDoc. It removes all files inside the session_files. So please be cautious before starting the script.
Please note that TOKEN_V2 used in the application is different from Notion's official API Internal Integration Token.
Follow these steps to get the token_v2.
We will export this Notion document, which is a full-page database and has four documents inside it.
Please note that Notion doesn't allow us to export all of these documents as PDFs in one go without the enterprise plan.
It's Great, isn't it? 🎉
This project welcomes contributions and suggestions. Feel free to report bugs and suggest features. It will help us improve this project. ⚡⚡
FAQs
Notion to ebook is a lightweight library to convert notion document consisting of multiple nested documents or databases into an ebook format like PDFs, with the table of contents, page cover, headers etc.
The npm package @subhamx/notion-to-ebook receives a total of 0 weekly downloads. As such, @subhamx/notion-to-ebook popularity was classified as not popular.
We found that @subhamx/notion-to-ebook 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.