Installation

How to install and run DocLayer

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:

node -v# v20.20.0  # You should see something similar

You’ll need Node.js in one of the following version ranges:

^20.22.0 || ^22.22.0

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:

npm install -g pnpm

or, through the Corepack:

npm install --global corepack@latestcorepack enable pnpm

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.

corepack use pnpm
Step 0 of 0

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.

pnpx @vuehouse/dl-cli@latest init

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

pnpm add    @vuehouse/dl    @vuehouse/dl-mdl-rulespnpm add -D    @iconify-json/bi    @iconify-json/lucide    @iconify-json/vscode-icons

We assume that the nuxt and @nuxt/content dependencies 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

export default defineNuxtConfig({  compatibilityDate: '2026-01-01',  modules: ['@vuehouse/dl'],});

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.

Step 0 of 0

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.

# enter the Boilerplate directorycd doclayer# install the Boilerplate dependenciespnpm i

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.

# run the prepare processpnpm prepare

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.

WARN: No content configuration found, falling back to default collection. In order to have full control over your collections, create the config file in project root. See: https://content.nuxt.com/docs/getting-started/installation

Start the application in development mode.

# start the Boilerplate applicationpnpm dev

Everything about building your application you can find here.

Step 0 of 0

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.

export default defineNuxtConfig({  compatibilityDate: '2026-01-01',  modules: ['@vuehouse/dl'],  dl: {    // module configuration (options) goes here  },});

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.

typedefaultrequired
number500no

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.

typedefaultrequired
booleanfalseno

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.

typedefaultrequired
booleantrueno

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.

typedefaultrequired
{ llmSummary: boolean }see belowno

experimental.llmSummary

Enables AI-based summaries for llms.txt sections. More about AI-based summaries for llms.txt sections, you can read here.

typedefaultrequired
booleanfalseno

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.

typedefaultrequired
booleantrueno

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.

typedefaultrequired
type ModuleOptions = {  rootPrep:    | {        components: boolean;        configs: boolean;        public: boolean;      }    | boolean;};
trueno

Additionally, the more granular option allows you to disable the automatic addition of specific entry points. This is how it's resolved:

  • components: adds app.vue, error.vue files.
  • configs: adds content.config.ts file.
  • public: fulfills public directory with icons, robots.txt file, etc.

stripPrompts

Whether to strip (removed from the DOM) prompts added by the DlPrompter component from the final rendered HTML markup.

typedefaultrequired
booleantrueno

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.

# Enables debug mode.# Will display warnings, logs, and errors in your console.DL_DEBUG=false# Sets the CORS origin(s) for the DocLayer security handling.# Defined as a comma-separated list of origins.DL_SECURITY_CORS_ORIGIN=https://doclayer.dev# Enables production logging, blocked by default by the Security module.DL_SECURITY_PROD_LOG=false# Main tag used to identify the application in the console.# Some application areas, like components use `doclayer` tag by default.DL_META_TAG=doclayer# Domain used across the application (plugins, SEO, security, etc.).DL_META_DOMAIN=https://doclayer.dev# Metadata titleDL_META_TITLE="DocLayer.dev | The Smart Content Framework powered by Nuxt"# Metadata descriptionDL_META_DESCRIPTION="Write anything in Markdown, DocLayer handles the rest. Stunningly."# Metadata keywordsDL_META_KEYWORDS="vue, nuxt, docs, documentation, content, module, framework, template, typescript, javascript"# Metadata authorDL_META_AUTHOR=vue.house# Metadata robotsDL_META_ROBOTS="noindex, nofollow"# Metadata title used by the LLMS Module & Plugin, if not defined the DL_META_TITLE is used.DL_LLMS_TITLE=# Metadata description used by the LLMS Module & Plugin, if not defined the DL_META_DESCRIPTION is used.DL_LLMS_DESCRIPTION=# Enables Search AI Assistant.DL_SEARCH_ASSISTANT=true# Provides CDN URL for the Huggingface Transformers.# Must be paired with `DL_SEARCH_ASSISTANT` to fully enable AI Assistant.DL_SEARCH_ASSISTANT_HFC=https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.4.2/+esm# Sets `baseUrl` value for the Nuxt's public runtime config; used for SEO, security, and LLMs metadata; leave empty for local development.NUXT_PUBLIC_BASE_URL=https://doclayer.dev# Sets site.url for the Sitemap Module; required for production builds.NUXT_PUBLIC_SITE_URL=https://doclayer.dev# Resolves Nitro build process timeout, if hanging.NITRO_BUILD_TIMEOUT=5000# Disables Nitro events logging.NITRO_EVENTS=false