-- TODO: add an anchor here
HeadingAnnotation h -> return $ h2 h -- TODO link?
Link l -> link l
- LinkTargets l -> return $ linkTargets l ++ "\n"
+ LinkTargets l -> return $ linkTargets l
List ls -> nodes ls >>= nl
ListItem l -> fmap ("- " ++) (nodes l) >>= nl
MappingAnnotation m -> return $ mapping m
MappingsAnnotation -> return $ h2 "Mappings" -- TODO link to foomappings
- -- TODO: handle OptionAnnotation
+ OptionAnnotation {} -> return $ option n
OptionsAnnotation -> return $ h2 "Options" -- TODO link to foooptions
Paragraph p -> nodes p >>= nl >>= nl
Plaintext p -> return p
linkTargets ls = "<p align=\"right\">"
++ unwords (map linkify $ sort ls)
++ "</p>"
+ ++ "\n"
where
linkify l = a $ Anchor [ Attribute "name" (sanitizeAnchor l)
, Attribute "href" (gitHubAnchor l)
gitHubAnchor n = "#user-content-" ++ sanitizeAnchor n
-- TODO: make sure symbol table knows about option targets too
+option :: Node -> String
+option (OptionAnnotation n t d) = targets ++ h
+ where targets = linkTargets [n]
+ h = h3 $ "`" ++ n ++ "` (" ++ t ++ ", default: " ++ def ++ ")"
+ def = fromMaybe "none" d
+
command :: Node -> String
-command (CommandAnnotation name params) = target ++ "\n" ++ content
+command (CommandAnnotation name params) = target ++ content
where target = linkTargets [":" ++ name]
content = h3 $ "`:" ++ annotation ++ "`"
annotation = rstrip $ name ++ " " ++ fromMaybe "" params
+<p align="right"><a name="gferretqfoptions" href="#user-content-gferretqfoptions"><code>g:FerretQFOptions</code></a></p>
+### `g:FerretQFOptions` (boolean, default: 1)
+
Controls whether to set up setting overrides for <strong>`quickfix`</strong> windows. These are various settings, such as <strong>`norelativenumber`</strong>, <strong>`nolist`</strong> and <strong>`nowrap`</strong>, that are intended to make the <strong>`quickfix`</strong> window, which is typically very small relative to other windows, more usable.
A full list of overridden settings can be found in <strong>`ferret-overrides`</strong>.
let g:FerretQFOptions=0
```
+<p align="right"><a name="gferretqfmap" href="#user-content-gferretqfmap"><code>g:FerretQFMap</code></a></p>
+### `g:FerretQFMap` (boolean, default: 1)
+
Controls whether to set up mappings in the <strong>`quickfix`</strong> results window for deleting results. The mappings include:
- `d` (<strong>`visual-mode`</strong>): delete visual selection
nmap <leader>u <Plug>(FerretAcks)
```
+<p align="right"><a name="gferretmap" href="#user-content-gferretmap"><code>g:FerretMap</code></a></p>
+### `g:FerretMap` (boolean, default: 1)
+
Controls whether to set up the Ferret mappings, such as <strong>[`<Plug>(FerretAck)`](#user-content-plugferretack)</strong> (see <strong>[`ferret-mappings`](#user-content-ferret-mappings)</strong> for a full list). To prevent any mapping from being configured, set to 0:
```
let g:FerretMap=0
```
+<p align="right"><a name="gferretqfcommands" href="#user-content-gferretqfcommands"><code>g:FerretQFCommands</code></a></p>
+### `g:FerretQFCommands` (boolean, default: 1)
+
Controls whether to set up custom versions of the <strong>`quickfix`</strong> commands, <strong>`:cn`</strong>, <strong>`:cnf`</strong>, <strong>`:cp`</strong> an <strong>`:cpf`</strong>. These overrides vertically center the match within the viewport on each jump. To prevent the custom versions from being configured, set to 0:
```