Package: mkdocs-behave
MkDocs Behave PluginAMkDocsplugin to renderbehavefeature files.Installationpip install mkdocs-behaveUsageAdd the following tomkdocs.yml:plugins:-behaveFeature files infeatures/in the project root will be converted to Markdown
and included in MkDocs navigation under the headingFeatures.Live previewWhile previewing documentation usingmkdocs serve, feature files will be
watched for changes in the same manner as Markdown files underdocs/Markdown in feature filesMarkdown can be used in the description text of features. However, behave does
not preserve leading whitespace in descriptions.To protect Markdown in descriptions, prepend dots to a block:Feature:My feature. - A multi-level list.   - with indentation.     - that would otherwise be lostScenario:...Specifically, the following are stripped at the beginning of a line of
description before it is processed as Markdown:A dot followed by a spaceA dot followed by a newline (i.e. no further text)(Leading whitespace before the dots is stripped by behave)ConfigurationConfiguration options can be set beneath the plugin entry inmkdocs.yml.plugins:-behave:<option>:<value># ...The following options are available:OptionDefaultEffectfeatures_dirfeaturesWhere feature files are read from disk (relative to the project root)nav_headingFeaturesThe top-level MkDocs navigation heading under which features are displayedpopulatetrueWhether to automatically populate features undernav_headingwarn_missingtrueWhether to warn about features on disk that are not present in navigationstep_highlight{}A mapping ofregexp:languageto syntax highlight step text based on the step nameExample of syntax highlighting configuration:plugins:-behave:step_highlight:{'filenamed".*\.py"':python,'webpagecontaining':html,}Modes of operation1. Fully automatic feature populationThis is the default. All feature files are populated into the navigation, sorted
alphanumerically.Subdirectories under the features directory are turned into subheadings under
the main navigation heading. Directory names are processed as follows:Underscores (_) are replaced with spacesThe first character is capitalised2. Partly manual feature populationTo explicitly order features and subheadings, add suitable entries into
the navigation inmkdocs.yml. You can also insert additional Markdown files.nav:-Features:-features/index.md-features/first.feature-Sub heading:-features/sub_heading/second.feature-...Note that in this example,features/index.mdis read from underdocsas
normal, but the entries ending in.featureare read from thefeaturesdirectory in the project root.Any features that are not explicitly listed in the expected heading are
populated at the end of the heading.To control the placement of the top-level features heading without otherwise adjusting
its contents, insert it into the navigation as a blank heading:nav:-A heading:-...-Features:[]-Another heading:-...3. Fully manual feature populationSetpopulate: falseto lay out features in the navigation entirely manually.
A warning will be issued if feature files present on disk are missing from the
navigation, mirroring the behaviour of MkDocs for Markdown files.To disable this and allow only a subset of features to be included, setwarn_missing: falseLicencemkdocs-behaveis distributed under the terms of theMITlicence.