packages feed

docvim 0.3.1.0 → 0.3.1.1

raw patch · 4 files changed

+22/−9 lines, 4 filesdep ~base

Dependency ranges changed: base

Files

README.md view
@@ -226,6 +226,13 @@  - [Hackage package](https://hackage.haskell.org/package/docvim) +### Examples of plug-ins using docvim++- [Ferret](https://github.com/wincent/ferret)+- [Pinnacle](https://github.com/wincent/pinnacle)+- [Scalpel](https://github.com/wincent/scalpel)+- [vim-docvim](https://github.com/wincent/vim-docvim)+ ## FAQ  ### Why a new tool and not an existing one like [Vimdoc]?@@ -235,14 +242,14 @@ * It's fun to build new things from scratch. * The project is a great fit for my learn-me-a-Haskell goal this year. -### Why is it called "Docvim"?+### Why is it called "docvim"?  "Vimdoc" was the first name that occurred to me when I started this project, but:  * The number one hit for "vimdoc" is [this online copy of Vim's own documentation](http://vimdoc.sourceforge.net/). * The name "Vimdoc" is already taken by [a similar project](https://github.com/google/vimdoc). -So, in a remarkable flash of profound creativity, I settled on "Docvim" instead, which right now yields this pleasing search result:+So, in a remarkable flash of profound creativity, I settled on "docvim" instead, which right now yields this pleasing search result:  > Did you mean: dacvim 
docvim.cabal view
@@ -10,7 +10,7 @@ -- PVP summary:      +-+------- breaking API changes --                   | | +----- non-breaking API additions --                   | | | +--- code changes with no API change-version:             0.3.1.0+version:             0.3.1.1  -- A short (one-line) description of the package. synopsis:            Documentation generator for Vim plug-ins@@ -55,7 +55,7 @@ source-repository this   type:     git   location: https://github.com/wincent/docvim.git-  tag:      0.3.1.0+  tag:      0.3.1.1  executable docvim   -- .hs or .lhs file containing the Main module.@@ -68,7 +68,7 @@   -- other-extensions:    -- Other library packages from which modules are imported.-  build-depends:       base >=4.8 && <4.9+  build-depends:       base >=4.8 && <4.10                ,       docvim    ghc-options:         -W -Wall
lib/Text/Docvim/Printer/Markdown.hs view
@@ -17,8 +17,12 @@ data Attribute = Attribute String String  markdown :: Node -> String-markdown n = rstrip (runReader (node n) metadata) ++ "\n"-  where metadata = Metadata (getPluginName n) (getSymbols n)+markdown n = if null stripped+             then ""+             else stripped ++ "\n"+  where+    metadata = Metadata (getPluginName n) (getSymbols n)+    stripped = rstrip (runReader (node n) metadata)  nodes :: [Node] -> Env nodes ns = concat <$> mapM node ns
lib/Text/Docvim/Printer/Vim.hs view
@@ -34,7 +34,9 @@ textwidth = 78  vimHelp :: Node -> String-vimHelp n = suppressTrailingWhitespace output ++ "\n"+vimHelp n = if null suppressTrailingWhitespace+            then ""+            else suppressTrailingWhitespace ++ "\n"   where metadata = Metadata (getPluginName n)         context = Context defaultLineBreak ""         operations = evalState (runReaderT (node n) metadata) context@@ -44,7 +46,7 @@         reduce acc (Slurp atom) = if atom `isSuffixOf` acc                                   then take (length acc - length atom) acc                                   else acc-        suppressTrailingWhitespace str = rstrip $ intercalate "\n" (map rstrip (splitOn "\n" str))+        suppressTrailingWhitespace = rstrip $ intercalate "\n" (map rstrip (splitOn "\n" output))  -- | Helper function that appends and updates `partialLine` context, -- hard-wrapping if necessary to remain under `textwidth`.