Installation Guide
Requirements
- Python 3.7+
- MkDocs 1.0+
- MkDocs Material theme (recommended)
Installation
Via PyPI (Recommended)
From Source
Configuration
Basic Setup
Add the plugin to your mkdocs.yml
:
Quick Start with New Syntax (v1.1.0+)
Create your first question using the modern syntax:
!!! freetext
What is your favorite programming language and why?
---
marks: 5, type: long, placeholder: Share your thoughts..., show_answer: true, answer: This is a sample answer explaining why Python is great for beginners.
With Material Theme
For the best experience, use with Material theme:
theme:
name: material
features:
- content.code.copy
- navigation.sections
plugins:
- search
- freetext:
show_character_count: true
markdown_extensions:
- admonition
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
Plugin Options
Option | Type | Default | Description |
---|---|---|---|
question_class |
string | freetext-question |
CSS class for question containers |
assessment_class |
string | freetext-assessment |
CSS class for assessment containers |
enable_css |
boolean | true |
Enable built-in CSS styling |
shuffle_questions |
boolean | false |
Shuffle question order in assessments |
show_character_count |
boolean | true |
Show character counter on text inputs |
Example Configuration
plugins:
- freetext:
question_class: "my-question"
assessment_class: "my-assessment"
enable_css: true
shuffle_questions: false
show_character_count: true
Verification
After installation, create a test page to verify everything works:
Then run:
Visit http://localhost:8000
and you should see your interactive question!
Troubleshooting
Plugin Not Loading
- Ensure the plugin is installed:
pip list | grep mkdocs-freetext
- Check your
mkdocs.yml
syntax - Verify MkDocs version:
mkdocs --version
Styling Issues
- Ensure Material theme is installed:
pip install mkdocs-material
- Check that
enable_css: true
in plugin configuration - Verify admonition extension is enabled
Need Help?
Next: Try the Live Demo →