Style Guide
Style Guide
Section titled “Style Guide”This guide ensures consistency across all content in The New Era Codex. Follow these guidelines when creating or editing content.
Frontmatter Standards
Section titled “Frontmatter Standards”Every page must include frontmatter at the top of the file:
---title: "Your Page Title"description: "Brief description for SEO and previews (140-160 characters)"sidebar: order: 1 # Optional: controls position in sidebar badge: # Optional: add visual badges text: "New" variant: tip # Options: note, tip, caution, danger---Title Guidelines
Section titled “Title Guidelines”- Use sentence case: “Building your first RAG system” (not “Building Your First RAG System”)
- Be specific: “Create an email classifier in n8n” (not “Email automation”)
- Avoid jargon in titles: Prefer clarity over cleverness
- Keep it concise: 3-8 words ideal
Description Guidelines
Section titled “Description Guidelines”- 140-160 characters for optimal SEO
- Include the benefit: “Learn how to…” or “Reduce time by…”
- Mention the audience if not obvious from directory
- No ending period
Good examples:
description: "Build a production-ready RAG system using LangChain and Pinecone in under 30 minutes"description: "Reduce resume screening time by 70% with AI-powered candidate evaluation"description: "Master ChatGPT prompt engineering with simple techniques anyone can use"Bad examples:
description: "RAG systems" # Too vaguedescription: "This guide will teach you everything you need to know about building RAG systems with vector databases and embeddings." # Too longdescription: "The ultimate guide to RAG." # Clickbait, ends with periodTone by Audience
Section titled “Tone by Audience”Voice: Technical, direct, assumes coding knowledge
Do:
- Use technical terminology without over-explaining
- Link to official documentation
- Show code-first, explain after
- Discuss tradeoffs and performance
Don’t:
- Explain basic programming concepts
- Use non-technical analogies
- Over-simplify architecture decisions
Example:
Initialize the vector store with OpenAI embeddings:
```pythonfrom langchain.vectorstores import Pineconeembeddings = OpenAIEmbeddings(model="text-embedding-3-small")vectorstore = Pinecone.from_documents(docs, embeddings, index_name="my-index")This approach uses the newer text-embedding-3-small model, which offers
better performance at lower cost compared to text-embedding-ada-002.
</TabItem>
<TabItem label="Automation">**Voice**: Friendly, step-by-step, visual, assumes no coding knowledge
**Do**:- Use numbered steps- Include screenshots with annotations- Explain what each step does- Provide downloadable workflow files
**Don't**:- Assume technical knowledge- Skip "obvious" steps- Use code without explanation
**Example**:```markdown## Step 3: Add the OpenAI Node
Now you'll add the AI component that analyzes your emails.
1. Click the **+** button on the canvas2. Search for "OpenAI" in the node selector3. Select **"OpenAI Chat Model"**
[Screenshot showing where to click, with arrows]
**What this does**: This node sends your email text to OpenAI's AI modeland receives a response with the email category.Voice: Accessible, jargon-free, encouraging, conversational
Do:
- Explain terms the first time they appear
- Use everyday analogies
- Provide copy-paste examples
- Celebrate small wins
Don’t:
- Use unexplained jargon
- Assume prior AI knowledge
- Make it feel complicated
Example:
## What is a "Prompt"?
A prompt is simply the instruction you give to ChatGPT. Think of it likeordering at a restaurant: the more specific you are, the more likely you'llget exactly what you want.
**Vague order**: "I'll have pasta"**Specific order**: "I'll have the spaghetti carbonara, extra crispy bacon,light on the cheese"
Same idea with ChatGPT:
**Vague prompt**: "Write about productivity"**Specific prompt**: "Write 5 productivity tips for parents working from home,each under 50 words, with practical examples"Voice: Business-focused, role-specific, ROI-conscious, compliance-aware
Do:
- Lead with business impact
- Include metrics and ROI
- Address compliance/privacy
- Provide role-specific templates
Don’t:
- Include technical implementation details
- Ignore business constraints
- Skip compliance considerations
Example:
## Business Impact
**Time Saved**: 2 hours per candidate evaluation**Cost Reduction**: $150 per hire in HR time**Quality Improvement**: 40% more consistent evaluations**Compliance Benefit**: Complete audit trail of evaluation criteria
## Privacy Considerations
Before implementing AI screening:- ✅ Ensure candidate consent for AI processing- ✅ Document evaluation criteria for audits- ✅ Maintain human oversight for final decisions- ✅ Check GDPR/CCPA compliance with legal teamMarkdown Formatting
Section titled “Markdown Formatting”Headings
Section titled “Headings”Use ATX-style headers with proper hierarchy:
# Page Title (H1) - Only one per page, usually automatic from frontmatter
## Main Sections (H2)
### Subsections (H3)
#### Minor subsections (H4) - Use sparinglyDon’t skip levels: H2 → H4 breaks document structure.
Code Blocks
Section titled “Code Blocks”Always specify the language for syntax highlighting:
```pythondef hello(): return "Hello, World!"```
```bashbun installbun dev```
```javascriptconst greeting = "Hello, World!";console.log(greeting);```For terminal output without syntax highlighting:
```textOutput from command```Unordered lists: Use - (not * or +) for consistency
- First item- Second item - Nested item (2 spaces) - Another nested item- Third itemOrdered lists: Use 1. for all items (auto-numbering)
1. First step1. Second step1. Third stepInternal links: Use relative paths without .md or .mdx extension
[See our contribution guide](/community/contributing/)[Developer guides](/developers/)External links: Include https:// and open in new tab isn’t needed (Starlight handles this)
[LangChain documentation](https://docs.langchain.com)Images
Section titled “Images”Store images in src/assets/ for optimization:
For frontmatter hero images:
---title: My Guidehero: image: file: ../../assets/hero.webp alt: "Descriptive alt text"---Starlight Components
Section titled “Starlight Components”Import components at the top of .mdx files:
---title: My Guide---
import { Card, CardGrid, Tabs, TabItem, Aside, Steps, Code } from '@astrojs/starlight/components'Use for feature highlights or grouped information:
<CardGrid> <Card title="Feature One" icon="rocket"> Description of the feature </Card>
<Card title="Feature Two" icon="star"> Another feature description </Card></CardGrid>Available icons: rocket, star, pencil, setting, laptop, approve-check, warning, information, etc. See full icon list
Perfect for showing audience-specific content or alternative approaches:
<Tabs> <TabItem label="Python"> ```python print("Hello") ``` </TabItem>
<TabItem label="JavaScript"> ```javascript console.log("Hello") ``` </TabItem></Tabs>Asides (Callouts)
Section titled “Asides (Callouts)”Use for important notes, tips, warnings:
<Aside>Default note</Aside>
<Aside type="tip">Helpful tip for readers</Aside>
<Aside type="caution">Important warning or caveat</Aside>
<Aside type="danger">Critical warning - risk of data loss, security issue, etc.</Aside>When to use each:
note(default): Supplementary informationtip: Helpful shortcuts or best practicescaution: Important warnings, gotchasdanger: Critical issues, security risks, data loss potential
For sequential processes:
<Steps>
1. **First Step**
Explanation of what to do
```bash command to run ```
2. **Second Step**
More details here
3. **Third Step**
Final instructions
</Steps>File Naming
Section titled “File Naming”URLs Are Permanent
Section titled “URLs Are Permanent”File paths become URLs. Once published, changing a file path breaks links.
Good file names:
langchain-rag-guide.md→/developers/langchain-rag-guide/n8n-email-classifier.md→/automation/n8n-email-classifier/chatgpt-prompts-basics.md→/everyone/chatgpt-prompts-basics/
Bad file names:
guide1.md- Not descriptiveRAG_System_Guide.md- Use kebab-case, not snake_case or PascalCasethe-ultimate-guide-to-rag.md- Avoid “ultimate” and be concise
Directory Structure
Section titled “Directory Structure”Files are organized by audience first:
src/content/docs/├── developers/│ ├── agents/│ │ └── guide.md│ └── rag/│ └── langchain.md├── automation/│ ├── n8n/│ └── zapier/├── everyone/│ ├── chatgpt/│ └── prompts/└── professionals/ ├── hr/ └── marketing/Code Examples
Section titled “Code Examples”All Code Must Be Tested
Section titled “All Code Must Be Tested”Before submitting:
- ✅ Run the code yourself
- ✅ Verify it works with current versions
- ✅ Include necessary imports
- ✅ Specify version requirements if relevant
Include Context
Section titled “Include Context”Bad:
result = chain.run(query)Good:
from langchain.chains import RetrievalQA
# Initialize the QA chain with our vector storeqa_chain = RetrievalQA.from_chain_type( llm=llm, retriever=vectorstore.as_retriever(), chain_type="stuff")
# Run a queryresult = qa_chain.run("What are the key features?")print(result)Environment Variables
Section titled “Environment Variables”Never include real API keys. Use placeholders:
Bad:
openai.api_key = "sk-proj-abc123xyz"Good:
import osopenai.api_key = os.getenv("OPENAI_API_KEY")And remind readers to set them:
Create a `.env` file:
```textOPENAI_API_KEY=your-key-herePINECONE_API_KEY=your-key-hereNever commit .env files to version control!
## Multilingual Considerations
### Currently: English Only
All content is currently in English. However, the structure is prepared for Spanish (and more languages).
### Future: Spanish Translations
When translating:- Keep the same file structure: `es/developers/` mirrors `en/developers/`- Translate file names too: `langchain-rag-guide.md` → `guia-rag-langchain.md`- Adapt examples to be culturally relevant- Maintain the same audience-specific tone
### Translation Priority
When Spanish support launches, prioritize:1. **Everyone** content - Most accessible to Spanish speakers2. **Professionals** content - High business value3. **Automation** content - Visual, easier to translate4. **Developers** content - International audience already uses English
## Common Mistakes
<CardGrid> <Card title="❌ Mixing Audiences" icon="warning"> **Don't**: Write a guide that's half technical, half beginner
**Do**: Create separate guides for different audiences </Card>
<Card title="❌ Untested Code" icon="warning"> **Don't**: Copy code from Stack Overflow without testing
**Do**: Run every code example before publishing </Card>
<Card title="❌ Skipping Prerequisites" icon="warning"> **Don't**: Assume readers have accounts/API keys
**Do**: List prerequisites upfront with links </Card>
<Card title="❌ Vague Benefits" icon="warning"> **Don't**: "This guide will help you with productivity"
**Do**: "Reduce email triage time by 2 hours per week" </Card></CardGrid>
## Accessibility
### Alt Text for Images
Always include descriptive alt text:
```markdownNot: 
Heading Hierarchy
Section titled “Heading Hierarchy”Don’t skip heading levels - screen readers rely on proper structure:
Bad:
# Title### Subsection (skipped H2!)Good:
# Title## Main Section### SubsectionLink Text
Section titled “Link Text”Use descriptive link text, not “click here”:
Bad: “Click here to learn more”
Good: “Learn more about RAG architecture”
Review Checklist
Section titled “Review Checklist”Before submitting a PR, verify:
- Frontmatter includes title and description
- Description is 140-160 characters
- File uses kebab-case naming
- Content matches the target audience
- All code examples are tested and working
- No real API keys or credentials
- Images have descriptive alt text
- Headings follow proper hierarchy (no skipped levels)
- Links are working (internal and external)
- Starlight components are imported if used
- Checked for spelling and grammar
- Tested locally with
bun dev
Questions about style? Check the contribution guide or open a discussion on GitHub.