This is a script that converts NextJS documentation in Markdown format to a PDF file. The purpose of this project is to simplify and streamline the process of converting documentation to a format that can be easily read and distributed, while also making it convenient for researchers and developers to train artificial intelligence models using the documentation.
As a developer, I often find myself referring to documentation to learn new technologies and APIs. However, sometimes the process of navigating through documentation can be cumbersome, especially if the documentation is not in a format that is easy to read or search. Additionally, when training artificial intelligence models to understand a specific technology or API, having the documentation in a standardized format can be very helpful.
The genesis of this project lies in my endeavor to establish an uncomplicated and efficient method for transforming NextJS documentation into a PDF format. This facilitates effortless reading and distribution. Furthermore, the adoption of a standardized format ensures that researchers and developers can seamlessly train artificial intelligence models to comprehend the technology with greater ease and precision, yielding numerous advantages.
To use this script, you need to have Node.js installed. Once you have Node.js installed, run the following command to install the required dependencies:
npm install
or
yarn
- Make the main script executable:
chmod +x main.sh
- Run the main script:
./main.sh
The main script will perform the following actions:
- Fetch the latest version of the NextJS documentation from the official API.
- Clone the documentation repository to a local folder.
- Merge all Markdown files into a single file.
- Convert the merged Markdown file to PDF format.
After running the script, the resulting PDF file will be saved in the "work" folder, along with the merged Markdown file and a folder containing the original documentation files. The contents of the "work" folder will look like this:
work
│ docs--next-js--v13.4.2--2023-05-12.md
│ docs--next-js--v13.4.2--2023-05-12.pdf
│
└───docs--next-js--v13.4.2--2023-05-12
│ accessibility.md
│ ...
│ ...
This script is licensed under the MIT License. See the LICENSE file for more information.