2.3 KiB

title, icon, createTime, permalink
title icon createTime permalink
Environment preset eos-icons:env 2026/01/13 22:21:56 /en/guide/markdown/env/

Overview

Environment presets (markdown.env) can be used to configure preset values for the Markdown rendering environment,

such as reference links, content annotations, abbreviations, etc., thereby avoiding repetitive definitions in each Markdown file.

Environment presets can take effect in any Markdown file.

Configuration

export default defineUserConfig({
  theme: plumeTheme({
    markdown: {
      env: {
        // reference
        references: {
          vuepress: 'https://v2.vuepress.vuejs.org/'
        },
        // abbreviation
        abbreviations: {
          HTML: 'Hypertext Markup Language'
        },
        // annotation
        annotations: {
          vuepress: 'VuePress is a [Static Site Generator](https://en.wikipedia.org/wiki/Static_site_generator) (SSG).It is specifically designed for building fast, content-centric sites.'
        }
      }
    }
  })
})

The above configuration is equivalent to including the following in any markdown file:

[vuepress]: https://v2.vuepress.vuejs.org/

*[HTML]: Hypertext Markup Language

[+vuepress]: VuePress is a [Static Site Generator](https://en.wikipedia.org/wiki/Static_site_generator) (SSG).It is specifically designed for building fast, content-centric sites.

Therefore, these environment presets can be used in any markdown file:

Link reference: [vuepress][vuepress]

Abbreviation: HTML

Content note: vuepress [+vuepress]

Link reference: vuepress

Abbreviation: HTML

Content note: vuepress [+vuepress]

*[HTML]: Hypertext Markup Language

[+vuepress]: VuePress is a Static Site Generator (SSG). It is specifically designed for building fast, content-centric sites.

Interface

interface MarkdownEnvPreset {
  /**
   * Reference links
   */
  references?: {
    [label: string]: string | { title?: string, href: string }
  }
  /**
   * Abbreviation
   */
  abbreviations?: {
    [label: string]: string
  }
  /**
   * Annotation
   */
  annotations?: {
    [label: string]: string | string[]
  }
}