How to Develop on Nextra: A Step-by-Step Guide

Jul 18, 2023 | Blockchain

Welcome to the world of Nextra development! Whether you are looking to contribute to the developer documentation or simply set up your own environment, this guide will outline the essential steps you need to follow. Grab your terminal and let’s get started!

Installation

IMPORTANT: These installation steps apply specifically to the MacOS environment.

Requirements

Before you commence, you will need to install a couple of important tools:

  • To install Node.js, execute the following command in your Terminal:
  • sh
    brew install node
    
  • Install the latest pnpm:
  • sh
    curl -fsSL https://get.pnpm.io/install.sh | sh
    

Clone the Developer Docs Repo

Now that you have your requirements sorted, it’s time to clone the repository:

sh
git clone https://github.com/aptos-labs/developer-docs.git

Install Dependencies

If you’re using macOS M1 Sonoma or newer, you may need to run the following command:

sh
pnpm add node-gyp -g
pnpm install

Develop on Nextra

Ready to start developing? Let’s set up your environment!

Setup Environment

Ensure you have the correct configuration in your .env file located under the appsnextra directory:

  • Duplicate .env.example and rename it to .env.
  • Once your environment is set, run:
  • sh
    pnpm prebuild
    

Build Nextra

The next step is to build Nextra:

bash
npx turbo run build --filter=appsnextra...

Run the Development Server

Navigate to the correct subdirectory and start your development server:

sh
cd appsnextra
pnpm dev

Debugging

If you encounter formatting issues, you can fix them by running:

sh
pnpm fmt

Regenerating Contributors

To regenerate the contributors list, you’ll need to authenticate with GitHub. Here’s how you can do it:

  • First, make sure you have the GitHub CLI installed.
  • Authenticate with the following command:
  • sh
    gh auth login --scopes read:user,user:email
    
  • Finally, generate the contributor map:
  • sh
    pnpm contributors
    

Troubleshooting

If you face any challenges during installation or development, here are some troubleshooting ideas:

  • Ensure you are running the commands in a terminal with the proper permissions.
  • Verify that Node.js and pnpm are installed correctly by checking their versions.
  • Check for any error messages in your terminal and search for them online or in the documentation.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Conclusion

Now that you are equipped with the necessary steps to set up your Nextra development environment, let your creativity flow and contribute to the amazing world of documentation! Happy coding!

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox