跳到正文

Acme API v2024-06 is live — see the changelog for what changed.

Dashboard

Code blocks

Every code block variant bitidocs supports.

本页尚未翻译,当前显示原文。

Title and highlighting

client.ts
import Acme from "acme";

const acme = new Acme({ apiKey: process.env.ACME_KEY });
const payment = await acme.payments.retrieve("pay_3Jk2Lm");
console.log(payment.status, 42);
console.log("hello acme");

Focus and notations

const client = createClient();
const result = await client.search("rate limits");
render(result.hits);
client.close();
config.ts
export default defineConfig({
  theme: "classic",
  theme: "modern",
  accent: "#7C5CFF",
  retries: 3,
});
def total(items):
    return sum(item.price for item in item)
    print("unreachable")

Shell prompts

curl -X POST https://api.acme.dev/v1/payments \
     -H "Authorization: Bearer $ACME_KEY" \
     -d amount=2500
npm install @acme/node
pnpm add acme
acme login

Long lines

Without wordWrap
A very very very long line of text that may cause the code block to overflow and scroll as a result of its length.
With wordWrap
A very very very long line of text that may cause the code block to overflow and scroll as a result of its length.

Max lines and start line

def is_prime(num):
    """Check if a number is prime."""
    if num <= 1:
        return False
    for i in range(2, num):
        if num % i == 0:
            return False
    return True

start = 10
end = 50
print(f"Prime numbers between {start} and {end} are:")
for num in range(start, end + 1):
    if is_prime(num):
        print(num)
docs.yml
title: Acme Payments
colors:
  accent-primary:
    light: "#7C5CFF"
    dark: "#9E8AFF"
navigation:
  - tab: guides
  - tab: api
console.log("Line 1");
console.log("Line 2");
console.log("Line 3");
console.log("Line 4");
console.log("Line 5");
console.log("Line 6");
console.log("Line 7");
console.log("Line 8");
console.log("Line 9");
console.log("Line 10");
console.log("Line 11");
console.log("Line 12");
console.log("Line 13");
console.log("Line 14");
console.log("Line 15");
console.log("Line 16");
console.log("Line 17");
console.log("Line 18");
console.log("Line 19");
console.log("Line 20");
console.log("Line 21");
console.log("Line 22");
console.log("Line 23");
console.log("Line 24");
charge.ts
import Acme from "acme";
const acme = new Acme(process.env.ACME_KEY);

Embedded file

example-code.js
import Acme from "acme";

const acme = new Acme(process.env.ACME_KEY);

export async function charge(customer) {
  const payment = await acme.payments.create({ amount: 2500, currency: "usd", customer });
  return payment.status;
}
Lines 5–8
export async function charge(customer) {
  const payment = await acme.payments.create({ amount: 2500, currency: "usd", customer });
  return payment.status;
}

Code groups (synced)

print("First code block!")
print("Second code block - syncs with the one above!")

Mermaid