Code blocks
Every code block variant bitidocs supports.
Title and highlighting
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();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/nodepnpm add acme
acme loginLong lines
A very very very long line of text that may cause the code block to overflow and scroll as a result of its length.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)title: Acme Payments
colors:
accent-primary:
light: "#7C5CFF"
dark: "#9E8AFF"
navigation:
- tab: guides
- tab: apiconsole.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");CodeBlock component and links
Embedded file
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;
}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!")console.log("First code block!");fmt.Println("First code block!")print("Second code block - syncs with the one above!")console.log("Second code block - syncs with the one above!");fmt.Println("Second code block - syncs with the one above!")Mermaid
graph LR A[Write MDX] --> B[biti build] B --> C[Publish]