Skip to content

Latest commit

Β 

History

History
462 lines (332 loc) Β· 14.1 KB

File metadata and controls

462 lines (332 loc) Β· 14.1 KB

User Guide

This guide provides practical instructions for using the ADF Preview extension's features.

Getting Started

Opening Files

  1. Automatic Detection: Files with ADF content are automatically detected
  2. Manual Preview: Right-click β†’ "Open Preview" or use Command Palette
  3. Tab-Based Workflow: Preview opens in a separate tab for easy switching

Basic Workflow

  1. Create/Open a Markdown file
  2. Write Content using ADF-enhanced Markdown syntax
  3. Preview using the preview tab
  4. Export to HTML, Markdown, or JSON when ready

Using the Tab-Based Preview

Opening Preview

Method 1: Command Palette

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Type "ADF: Open Preview"
  3. Press Enter

Method 2: Editor Button

  1. Look for the preview button in the editor title bar
  2. Click the preview icon

Method 3: Context Menu

  1. Right-click in the editor
  2. Select "Open Preview"

Preview Tab Behavior

  • Live Updates: Preview updates automatically as you edit
  • Independent Tabs: Source and preview can be viewed side-by-side

Writing ADF-Enhanced Markdown

πŸ“– Complete ADF Markdown Reference: For comprehensive documentation on all ADF markdown extensions and syntax, see the Extended Markdown ADF Parser Package Documentation

Text Formatting

ADF supports rich text formatting including bold, italic, underline, strikethrough, code, and more. Text can be combined with links, mentions, and inline elements.

πŸ“– Text Formatting Documentation: See Text Formatting for complete syntax including emphasis, strong text, inline code, and advanced formatting options.

Headings

Create document structure using headings from H1 through H6. Headings support custom attributes and can include rich text content.

πŸ“– Heading Documentation: See Heading Specifications for syntax and advanced heading features.

Panel Syntax

Create visually distinct information panels using ADF panel syntax. Panels provide rich content containers with semantic meaning and visual styling.

Available Panel Types:

  • Info Panel - Blue styling for informational content
  • Warning Panel - Yellow styling for cautionary content
  • Success Panel - Green styling for positive feedback
  • Note Panel - Gray styling for additional context
  • Error Panel - Red styling for critical information

πŸ“– Complete Panel Documentation: See Panel Specifications for syntax examples, custom titles, and advanced panel features.

Task Lists

Create interactive task lists with checkboxes for tracking completion status. Task lists support nested items and rich content.

πŸ“– List Documentation: See Lists for complete syntax including bullet lists, numbered lists, and task lists with advanced features.

Tables

Create structured data tables with headers, rows, and rich content. Tables support text formatting, alignment, and complex layouts including merged cells.

πŸ“– Table Documentation: See Table Specifications for complete syntax including column alignment, cell merging, and advanced table features.

Code Blocks

Display formatted code with syntax highlighting for 100+ programming languages. Code blocks preserve indentation and line breaks while providing visual styling.

πŸ“– Code Block Documentation: See Code Block Specifications for language support, syntax highlighting options, and advanced code block features.

Media Elements

Embed images, videos, and file attachments in your documents. Media elements support dimensions, captions, and accessibility attributes.

πŸ“– Media Documentation: See Media Elements for syntax including image references, file attachments, and media galleries.

Blockquotes

Create quoted content with proper attribution and nested quote support. Blockquotes can contain rich content and multiple paragraphs.

πŸ“– Blockquote Documentation: See Blockquote Specifications for syntax and advanced blockquote features.

Using Code Completion

Enabling Snippet Support

If snippets are not working in your markdown files, you may need to configure VS Code settings. Create or update your workspace .vscode/settings.json file:

{
  "editor.quickSuggestions": {
    "other": true,
    "comments": false,
    "strings": true
  },
  "editor.suggestOnTriggerCharacters": true,
  "editor.wordBasedSuggestions": "off",
  "editor.snippetSuggestions": "top",
  "editor.suggest.showSnippets": true,
  "[markdown]": {
    "editor.quickSuggestions": {
      "other": true,
      "comments": false,
      "strings": true
    },
    "editor.snippetSuggestions": "top",
    "editor.suggest.showSnippets": true,
    "editor.tabCompletion": "on",
    "editor.wordBasedSuggestions": "off"
  }
}

After adding these settings, restart VS Code or reload the window (Ctrl+Shift+P β†’ "Developer: Reload Window").

Available Snippets

The extension provides two types of code completion: Static Snippets and Dynamic Completions.

Static Snippets (from snippets file)

These snippets are triggered by typing their prefix and pressing Tab or Ctrl+Space:

Panel Snippets:

  • info or panel-info β†’ ADF Info Panel with custom title

    ~~~panel type=info title="Information Panel"
    Your content here
    ~~~
  • warn, panel-warn, or panel-warning β†’ ADF Warning Panel

    ~~~panel type=warning title="Warning Panel"
    Your content here
    ~~~
  • success or panel-success β†’ ADF Success Panel

    ~~~panel type=success title="Success Panel"
    Your content here
    ~~~
  • note or panel-note β†’ ADF Note Panel

    ~~~panel type=note title="Note Panel"
    Your content here
    ~~~
  • error or panel-error β†’ ADF Error Panel

    ~~~panel type=error title="Error Panel"
    Your content here
    ~~~

Content Snippets:

  • tasks β†’ Task List with checkboxes

    - [ ] Task 1
    - [ ] Task 2
    - [ ] Task 3
  • table β†’ ADF Compatible Table

    | Header 1 | Header 2 | Header 3 |
    |----------|----------|----------|
    | Cell 1   | Cell 2   | Cell 3   |
    | Cell 4   | Cell 5   | Cell 6   |
  • meeting β†’ Meeting Notes Template (see Template section below)

  • expand or collapsible β†’ Expandable Section

    ~~~expand title="Click to expand"
    Hidden content goes here
    ~~~

Dynamic Completions (context-aware)

These appear automatically based on what you're typing:

General Completions (triggered in empty lines):

  • ADF Table β†’ Multi-line table with headers and sample data
  • ADF Code Block β†’ Fenced code block with language placeholder
  • ADF Link β†’ Markdown hyperlink format

Task Item Completion (triggered after -, *, or +):

  • Task Item β†’ [ ] Task description (creates checkbox)

Template Completions

Full document templates available via Command Palette or template snippet:

  1. Meeting Notes Template (meeting-notes)

    • Variables: Meeting Title, Date, Attendees
    • Includes info panel, agenda, discussion, action items, next steps
  2. Requirements Document Template (requirements-doc)

    • Variables: Project Name, Version
    • Includes overview, functional requirements, non-functional requirements, success criteria
  3. Technical Specification Template (technical-spec)

    • Variables: Feature Name
    • Includes overview, architecture, implementation details, testing strategy
  4. Status Report Template (status-report)

    • Variables: Report Period, Team Name
    • Includes accomplishments, progress, upcoming work, issues, metrics

To use templates:

  • Method 1: Command Palette β†’ "ADF: Create from Template" β†’ Select template β†’ Fill variables
  • Method 2: Type template β†’ Select from list β†’ Fill variables
  • Method 3: Type specific template prefix (e.g., meeting) β†’ Press Tab

Troubleshooting Snippets:

  • Ensure the ADF Preview extension is installed and active
  • Check that your file has a .md extension
  • Try typing the snippet prefix and pressing Ctrl+Space to trigger suggestions
  • Verify the workspace settings above are applied correctly

Working with Document Templates

Creating from Template

Method 1: Command Palette

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Type "ADF: Create from Template"
  3. Select your desired template
  4. Fill in the variable prompts

Method 2: New File with Template

  1. Create a new file
  2. Use code completion to insert a template
  3. Customize the generated content

Template Variables

Templates support dynamic variables:

  • {{DATE}} - Current date
  • {{PROJECT_NAME}} - Project name (prompted)
  • {{ATTENDEES}} - Meeting attendees (prompted)
  • {{AUTHOR}} - Document author (prompted)

Customizing Templates

You can modify template content after insertion:

  1. Replace placeholder text
  2. Add or remove sections
  3. Customize the structure as needed

Validation and Error Checking

Real-Time Validation

The extension validates your ADF content in real-time:

  • Green Indicators: Valid ADF structure
  • Red Underlines: Validation errors
  • Yellow Underlines: Warnings or suggestions

Understanding Validation Messages

Structural Errors:

  • Invalid parent-child relationships
  • Missing required attributes
  • Incorrect node types

Content Errors:

  • Invalid text formatting
  • Malformed links
  • Incorrect table structure

Performance Warnings:

  • Large document size
  • Complex nested structures
  • Potential rendering issues

Manual Validation

Run comprehensive validation:

  1. Command Palette β†’ "ADF: Validate Document"
  2. View detailed validation results
  3. Use suggested fixes to resolve issues

Export Features

HTML Export

Standard HTML Export:

  1. Command Palette β†’ "ADF: Export as HTML"
  2. Choose location and filename
  3. File includes embedded styles for standalone viewing

Configuration Options:

{
  "adf.export.includeStyles": true,
  "adf.export.format": "pretty"
}

Markdown Export

GitHub-Compatible Markdown:

  1. Command Palette β†’ "ADF: Export as Markdown"
  2. ADF panels converted to blockquotes
  3. Tables and lists preserved

Export Features:

  • Standard Markdown compatibility
  • Preserves formatting where possible
  • Includes fallbacks for ADF-specific elements

JSON Export

Formatted ADF JSON:

  1. Command Palette β†’ "ADF: Export as JSON"
  2. Choose pretty-printed or minified format
  3. Valid ADF structure guaranteed

Customization Options

Preview Settings

Update Behavior:

{
  "adf.preview.autoUpdate": true,
  "adf.preview.updateDelay": 500
}

Font Settings:

{
  "adf.preview.fontSize": 14
}

Completion Settings

Enable/Disable Features:

{
  "adf.completion.enabled": true,
  "adf.completion.templates": true,
  "adf.completion.snippets": true
}

Validation Settings

Validation Behavior:

{
  "adf.validation.enabled": true,
  "adf.validation.strict": true,
  "adf.validation.realtime": true
}

Advanced Usage

Debug Information

Export debug information for troubleshooting:

  1. Command Palette β†’ "ADF: Write Debug Log"
  2. Saves comprehensive diagnostic data
  3. Useful for reporting issues

Performance Optimization

For large documents:

  1. Increase update delay: "adf.preview.updateDelay": 1000
  2. Disable real-time validation: "adf.validation.realtime": false
  3. Use manual validation instead of automatic

Keyboard Shortcuts

Action Windows/Linux macOS
Open Preview Ctrl+Shift+V Cmd+Shift+V
Command Palette Ctrl+Shift+P Cmd+Shift+P
Quick Open Ctrl+P Cmd+P
Toggle Sidebar Ctrl+B Cmd+B

Tips and Best Practices

Writing Effective ADF Content

  1. Use Semantic Panels: Choose the right panel type for your content
  2. Structure Documents: Use headings to create clear hierarchy
  3. Leverage Templates: Start with templates for consistent formatting
  4. Validate Early: Check validation as you write

Performance Tips

  1. Break Large Documents: Split very large documents into sections
  2. Optimize Images: Use appropriate image sizes
  3. Minimize Nesting: Avoid deeply nested structures when possible

Collaboration Tips

  1. Export for Sharing: Use HTML export for non-technical stakeholders
  2. Version Control: Use Markdown format for git-friendly versioning
  3. Documentation Standards: Establish team templates and conventions

Common Workflows

Meeting Notes Workflow

  1. Create new file from Meeting Notes template
  2. Fill in date, attendees, and agenda items
  3. Take notes during meeting
  4. Export to HTML for distribution

Requirements Documentation

  1. Start with Requirements Document template
  2. Use panels to highlight important information
  3. Create task lists for tracking completion
  4. Export to Confluence-compatible format

Technical Documentation

  1. Use Technical Specification template
  2. Include code blocks for examples
  3. Use warning panels for critical information
  4. Maintain in Markdown for version control

Next Steps