@elastic/docsmobile

中文文档
1.24.1发布于 2026/01/13Apache-2.0CommonJS近 30 天下载 3910

The engine that makes your docs go!

原始使用文档
文档目录5 节
  1. How to work with the system now
  2. Deploying the docs with CI
  3. docsmobile.config.js
  4. Navigation
  5. Sourcing docs

Docsmobile 🚌

Docsmobile is a documentation system and syntax shell that is built upon NextJS, EUI and MDX. It can be used either with local documentation within the /docs folder, or you can consume MDX pages from separate repos.

Some things have changed recently so let's chat!

How to work with the system now

Docsmobile is the engine for our documentation. An engine can't do much without being hooked up to something that makes it go--so for now I've been doing most of my docsmobile development using doc-site as my test site. You'll see info on how to get started in the root README. For the most part, you'll do two things:

  1. Initialize with yarn init-docs which runs docsmobile init --symlink under the hood. This allows docsmobile to be set up with symlinks to docsmobile/template so your changes will immediately go through.
  2. Then develop with yarn dev (which runs docsmobile dev). Note that if it isn't a component change (e.g. style or text change) you'll likely have to refresh the page once your code is done compiling.

Deploying the docs with CI

To understand how the CI picks up content from outside repos, as well as how to manually deploy the docs, please check https://docs.elastic.dev/docs/ci

docsmobile.config.js

Bare minimum, docsmobile needs a content.js with nav and sources config to run. See the docsmobile.config.js in doc-site for a living example. While the search engine config is optional, not providing it will remove all search related UI.

Navigation

Even if you add more docs to your sources key of content.js/content-dev.js, you won't see the pages appear on the home page or in the side nav without either including the new pages into an existing nav or adding a new navigation unit. If a source has already relocated its .docnav.json files into it, then they'll compile as expected.

Sourcing docs

You'll have two source configs--content.js is always used in the production build and mostly shouldn't be touched unless you're intentionally adding a new source. For local development we always use content-dev.js. You can read more on the syntax used in these json blobs in Docs Setup: Add MDX content sources.

版本与发布记录

@elastic/docsmobile 共发布 365 个版本,首次发布于 2021/09/29;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.24.1latest2026/01/139 个月前
1.24.02025/12/1910 个月前
1.23.52025/03/061.7 年前
1.23.5-rc.12025/03/061.7 年前
2.0.3-rc.12024/06/262 年前
2.0.22024/06/222 年前

关于 @elastic/docsmobile 的常见问题

@elastic/docsmobile 是什么?

The engine that makes your docs go!

如何安装 @elastic/docsmobile?

在项目目录运行 npm install @elastic/docsmobile,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 beep、docsmobile,可以用 npx beep 直接运行。

@elastic/docsmobile 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/elastic__docsmobile 是否存在。

@elastic/docsmobile 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@elastic/docsmobile 可以商用吗?

@elastic/docsmobile 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@elastic/docsmobile 的下载量有多少?

根据 npm 官方下载统计,@elastic/docsmobile 在 2026/10/13 – 2026/11/11 这 30 天内被下载 3,910 次,日均约 130 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@elastic/docsmobile 还在维护吗?

最新版本 1.24.1 发布于 2026/01/13(9 个月前);至今共发布 365 个版本,其中过去 12 个月发布了 2 个;首次发布于 2021/09/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。