透過超過 100 個提示的集合來學習 Nuxt!

nuxt-asciidoc
nuxt-asciidoc

在 Nuxt 中使用 asciidoc 的轉換器

nuxt-asciidoc

nuxt-asciidoc-logo

npm version npm downloads License Nuxt

如果您喜歡 asciidoc 勝過 markdown,這個外掛程式絕對適合您。

功能

  • ⛰  它可以處理 .adoc 及其對應的檔案擴展名並渲染它們。

已知問題

  • include 不會包含另一個檔案的內容,它只會建立一個連結。您可以在螢幕截圖中看到它。

螢幕截圖

nuxt-asciidoc

快速設定

  1. nuxt-asciidoc 依賴項新增至您的專案
npx nuxi@latest module add nuxt-asciidoc
  1. nuxt-asciidoc 新增到 modules 區段,在 nuxt.config.ts@nuxt/content 之前
export default defineNuxtConfig({
  modules: [
    'nuxt-asciidoc',
    ...
    '@nuxt/content'
  ]
})

就是這樣!您現在可以在您的 Nuxt 應用程式中使用我的模組了 ✨

範例

檢視:pages/imprint.vue + 對應的內容檔案:content/imprint.adoc

<script setup>
const { data } = await useAsyncData("imprint", () =>
  queryContent("/imprint").findOne()
);
</script>

<template>
  <main>
    <ContentDoc v-slot="{ doc }">
      <div v-html="doc.body"></div>
    </ContentDoc>
  </main>
</template>

開發 (npm, yarn, pnpm)

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release