Before The Start
We assume you have a basic understanding of TypeScript. That said, we think that you won’t need any great in-depth technical field knowledge. Naturally, being familiar with some general concepts (especially of Vue & Nuxt) will help you get started more easily.
Don't worry - we'll explain everything step by step, giving you all the context you need to understand each part and concept in the application. Our goal is to help you create amazing content with confidence.
Installation
To start working with DocLayer, you’ll need a few prerequisites: a recent version of Node.js and the pnpm package manager. In the meantime you'll also clone (download) the DocLayer Boilerplate repository, think of this as a starter template that includes all the essential "components" you’ll need, so you can begin working right away.
Install prerequisites
Please follow steps below to add prerequisites, selecting a way of the application assembly, further installing dependencies, and running everything together.
Install Node.js
First, ensure you have a recent version of Node.js installed. To check your current version, run:
You’ll need Node.js in one of the following version ranges:
If your version doesn’t match, download and install the latest version from the official Node.js website. The site will guide you to the right installer for your operating system.
If you're using nvm to manage your Node versions, simply run the nvm use command to select the appropriate version.
Install pnpm
Why pnpm?
We use pnpm as our package manager to handle all repository processes and workflows. It’s fast, efficient, safe, and offers more features than npm. We recommend you to pick it as well.
DocLayer has been tested along with npm and bun, so if you prefer to use different package manager feel free to go with it - no pressure 😉
To install pnpm you can use npm:
or, through the Corepack:
Additionally, you can pick the version you want to work with. With command below it will use version assigned with packageManager property in the Boilerplate's package.json file.
Assemble the application
Now you have two options to run the DocLayer-based app: you can either use the Boilerplate (an already prepared and well-established app), or add it manually yourself.
Run with Boilerplate
Use DocLayer's CLI to create a new project on top of the Boilerplate.
Alternatively, use Boilerplate as a template.
Run on your own
If you prefer not to start with the preconfigured Boilerplate application, you can always add DocLayer to your application separately. Since it's a Nuxt Module and the process is straightforward, please follow the steps below to achieve the same result.
Add dependencies to your package.json file
We assume that the
nuxtand@nuxt/contentdependencies are already installed in your application.
As package versions may vary the most current ones can be found in the package.json file of the main DocLayer Boilerplate repository.
Add module to your nuxt.config.ts file
Create your app.config.ts file
Since configuration relies on this file - and you'll likely use it frequently when creating content - we recommend creating it and using the dedicated defineDoclayerAppConfig macro function for full type safety and coverage.
That's it - DocLayer will handle the rest. Additionally, we recommend adding markdownlint and its configuration. More about this, as well as other internal tools and their predefined setups, you can read here.
Install dependencies
Finally, let's install all the dependencies, running the Boilerplate application just after.
Install dependencies
Enter the newly created folder with Boilerplate to install all of the DocLayer's dependencies. Note that pnpm caches all dependencies globally, so future installations will use them from its store. This makes the installation process much faster and more efficient.
Run prepare script
Before running DocLayer for the first time, you need to prepare some resources by running the prepare script. Typically, this is included as part of the postinstall process. Running this script will also generate all the necessary Nuxt internals required by DocLayer.
The prepare process also performs several automations to set up your application before the first run. More about these automations, you can read here.
No content configuration found
While running the prepare process, you may encounter a warning about missing content configuration. This happens because the root preparation removes the content configuration file, which will be automatically added again when you run your application in development mode or during the build process.
Start the application in development mode.
Everything about building your application you can find here.
Module configuration
Development-related configuration (options) defined close to the module itself. This configuration controls internal features, does not affect your application's visual behavior, and is generally not necessary during content creation, meaning that the defaults are quite sufficient. This is how you can define it along with the nuxt.config.ts.
The options themselves:
baseTimeout
Timeout value used across the application, mainly to avoid hydration issues or to "relax" the main application thread. We recommend not changing this unless necessary.
| type | default | required |
|---|---|---|
number | 500 | no |
debug
Enables debug mode for DocLayer. This will log context data, disabled warnings, and dedicated process logs during runtime or build time. It's based on the DL_DEBUG environment variable.
| type | default | required |
|---|---|---|
boolean | false | no |
mdlConvert
Controls whether to convert .markdownlint.js into .markdownlint.json during prepare process. Enables markdownlint CLI usage (JSON + --rules) from the app's markdownlint config.
| type | default | required |
|---|---|---|
boolean | true | no |
experimental
Object with flags that enables experimental features in DocLayer. Be aware that all of these are disabled by default. Below you can find the available flags to switch.
| type | default | required |
|---|---|---|
{ llmSummary: boolean } | see below | no |
experimental.llmSummary
Enables AI-based summaries for llms.txt sections. More about AI-based summaries for llms.txt sections, you can read here.
| type | default | required |
|---|---|---|
boolean | false | no |
sanitizeHTML
Disables inline HTML sanitization. This option is closely linked with utilSafeHTML, which is used throughout the codebase to ensure safe HTML rendering via the v-html Vue directive.
| type | default | required |
|---|---|---|
boolean | true | no |
rootPrep
Controls whether the root preparation process is enabled. This process automatically adds essential application entry points such as app.vue, error.vue, and content.config.ts. If you have custom versions of these files, you can disable the automatic addition by setting this option to false. Otherwise, every time you run the prepare script your custom files will be overwritten. You can also run it once to add the files and then disable the option to avoid overwriting them in the future.
| type | default | required |
|---|---|---|
true | no |
Additionally, the more granular option allows you to disable the automatic addition of specific entry points. This is how it's resolved:
components: addsapp.vue,error.vuefiles.configs: addscontent.config.tsfile.public: fulfillspublicdirectory with icons,robots.txtfile, etc.
stripPrompts
Whether to strip (removed from the DOM) prompts added by the DlPrompter component from the final rendered HTML markup.
| type | default | required |
|---|---|---|
boolean | true | no |
Environment Variables
Inside the .env.example file, you'll find all the environment variables used to customize or configure different areas of the application. In the following pages, we'll explain where and how to use each variable with various features. Though, it's helpful to understand what each one does so you won't be caught off guard later.
Defaults
It's important to note that none of these environment variables are defined by default. You need to create a .env file in your project's root directory to manage them. These variables are private and specific to your local environment. When building and deploying your application, you'll need to set them separately according to your hosting provider's requirements. You can find more about deployment here.
Keep in mind that DocLayer provides default values for each environment variable. If you don't define a variable, DocLayer will recognize it and automatically use its default value, as shown below.
