]> git.wincent.com - docvim.git/commitdiff
Add Pinnacle to integration tests
authorGreg Hurrell <greg@hurrell.net>
Sun, 12 Jun 2016 22:06:31 +0000 (15:06 -0700)
committerGreg Hurrell <greg@hurrell.net>
Sun, 12 Jun 2016 22:12:20 +0000 (15:12 -0700)
README.md
bin/get
bin/put
tests/fixtures/integration/pinnacle/golden/ast.golden [new file with mode: 0644]
tests/fixtures/integration/pinnacle/golden/markdown.golden [new file with mode: 0644]
tests/fixtures/integration/pinnacle/golden/plaintext.golden [new file with mode: 0644]
tests/fixtures/integration/pinnacle/input/.gitignore [new file with mode: 0644]
tests/fixtures/integration/pinnacle/input/autoload/pinnacle.vim [new file with mode: 0644]

index 9553285bbceee597be5a5d3fc34cfc031c0c338b..8a9677d268e71bc62753811dce535dbf5322cd17 100644 (file)
--- a/README.md
+++ b/README.md
@@ -229,6 +229,7 @@ cabal upload dist/docvim-$VERSION.tar.gz
 ### 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)
 
diff --git a/bin/get b/bin/get
index ea034083f9719fd3dc5a7e147f16e53eb564790e..7899c0c9cd2476616e37f4439fc1f0a4ed256a0e 100755 (executable)
--- a/bin/get
+++ b/bin/get
@@ -12,7 +12,8 @@ usage() {
   echo "Usage:"
   echo
   echo "  bin/get ferret      #"
-  echo "  bin/put scalpel     # freshen a specific downstream"
+  echo "  bin/put pinnacle    # freshen a specific downstream"
+  echo "  bin/put scalpel     #"
   echo "  bin/get vim-docvim  #"
   echo "  ---------------------------------------------------"
   echo "  bin/get all         # freshen all sources"
@@ -37,10 +38,11 @@ else
     case $PROJECT in
       all)
         update ferret
+        update pinnacle
         update scalpel
         update vim-docvim
         ;;
-      ferret|scalpel|vim-docvim)
+      ferret|pinnacle|scalpel|vim-docvim)
         update "$PROJECT"
         ;;
       *)
diff --git a/bin/put b/bin/put
index 1ee4387c5ca58d7a1dbf6d9c45b00e88788ccbca..ba7a81fac60b693b8842f1568a9f89b38ceb5720 100755 (executable)
--- a/bin/put
+++ b/bin/put
@@ -18,7 +18,8 @@ usage() {
   echo "Usage:"
   echo
   echo "  bin/put ferret      #"
-  echo "  bin/put scalpel     # freshen a specific downstream"
+  echo "  bin/put pinnacle    # freshen a specific downstream"
+  echo "  bin/put scalpel     #"
   echo "  bin/put vim-docvim  #"
   echo "  ---------------------------------------------------"
   echo "  bin/put all         # freshen all downstreams"
@@ -44,11 +45,12 @@ else
     shift
     case $PROJECT in
       all)
-        update "ferret"
-        update "scalpel"
-        update "vim-docvim"
+        update ferret
+        update pinnacle
+        update scalpel
+        update vim-docvim
         ;;
-      ferret|scalpel|vim-docvim)
+      ferret|pinnacle|scalpel|vim-docvim)
         update "$PROJECT"
         ;;
       *)
diff --git a/tests/fixtures/integration/pinnacle/golden/ast.golden b/tests/fixtures/integration/pinnacle/golden/ast.golden
new file mode 100644 (file)
index 0000000..790bd77
--- /dev/null
@@ -0,0 +1,898 @@
+Project
+  [ DocBlock
+      [ PluginAnnotation
+          "Pinnacle" "Highlight group manipulation for Vim"
+      , TOC
+          [ "Intro"
+          , "Installation"
+          , "Website"
+          , "License"
+          , "Development"
+          , "Authors"
+          , "History"
+          ]
+      ]
+  , HeadingAnnotation "Intro"
+  , Paragraph
+      [ Plaintext "Pinnacle"
+      , Whitespace
+      , Plaintext "provides"
+      , Whitespace
+      , Plaintext "functions"
+      , Whitespace
+      , Plaintext "for"
+      , Whitespace
+      , Plaintext "manipulating"
+      , Whitespace
+      , Link ":highlight"
+      , Whitespace
+      , Plaintext "groups."
+      ]
+  , HeadingAnnotation "Installation"
+  , Paragraph
+      [ Plaintext "To"
+      , Whitespace
+      , Plaintext "install"
+      , Whitespace
+      , Plaintext "Pinnacle,"
+      , Whitespace
+      , Plaintext "use"
+      , Whitespace
+      , Plaintext "your"
+      , Whitespace
+      , Plaintext "plug-in"
+      , Whitespace
+      , Plaintext "management"
+      , Whitespace
+      , Plaintext "system"
+      , Whitespace
+      , Plaintext "of"
+      , Whitespace
+      , Plaintext "choice."
+      ]
+  , Paragraph
+      [ Plaintext "If"
+      , Whitespace
+      , Plaintext "you"
+      , Whitespace
+      , Plaintext "don't"
+      , Whitespace
+      , Plaintext "have"
+      , Whitespace
+      , Plaintext "a"
+      , Whitespace
+      , Plaintext "\"plug-in"
+      , Whitespace
+      , Plaintext "management"
+      , Whitespace
+      , Plaintext "system"
+      , Whitespace
+      , Plaintext "of"
+      , Whitespace
+      , Plaintext "choice\","
+      , Whitespace
+      , Plaintext "I"
+      , Whitespace
+      , Plaintext "recommend"
+      , Whitespace
+      , Plaintext "Pathogen"
+      , Whitespace
+      , Plaintext "(https://github.com/tpope/vim-pathogen)"
+      , Whitespace
+      , Plaintext "due"
+      , Whitespace
+      , Plaintext "to"
+      , Whitespace
+      , Plaintext "its"
+      , Whitespace
+      , Plaintext "simplicity"
+      , Whitespace
+      , Plaintext "and"
+      , Whitespace
+      , Plaintext "robustness."
+      , Whitespace
+      , Plaintext "Assuming"
+      , Whitespace
+      , Plaintext "that"
+      , Whitespace
+      , Plaintext "you"
+      , Whitespace
+      , Plaintext "have"
+      , Whitespace
+      , Plaintext "Pathogen"
+      , Whitespace
+      , Plaintext "installed"
+      , Whitespace
+      , Plaintext "and"
+      , Whitespace
+      , Plaintext "configured,"
+      , Whitespace
+      , Plaintext "and"
+      , Whitespace
+      , Plaintext "that"
+      , Whitespace
+      , Plaintext "you"
+      , Whitespace
+      , Plaintext "want"
+      , Whitespace
+      , Plaintext "to"
+      , Whitespace
+      , Plaintext "install"
+      , Whitespace
+      , Plaintext "vim-docvim"
+      , Whitespace
+      , Plaintext "into"
+      , Whitespace
+      , Code "~/.vim/bundle"
+      , Plaintext ","
+      , Whitespace
+      , Plaintext "you"
+      , Whitespace
+      , Plaintext "can"
+      , Whitespace
+      , Plaintext "do"
+      , Whitespace
+      , Plaintext "so"
+      , Whitespace
+      , Plaintext "with:"
+      ]
+  , Fenced
+      [ "git clone https://github.com/wincent/pinnacle.git ~/.vim/bundle/pinnacle"
+      ]
+  , Paragraph
+      [ Plaintext "Alternatively,"
+      , Whitespace
+      , Plaintext "if"
+      , Whitespace
+      , Plaintext "you"
+      , Whitespace
+      , Plaintext "use"
+      , Whitespace
+      , Plaintext "a"
+      , Whitespace
+      , Plaintext "Git"
+      , Whitespace
+      , Plaintext "submodule"
+      , Whitespace
+      , Plaintext "for"
+      , Whitespace
+      , Plaintext "each"
+      , Whitespace
+      , Plaintext "Vim"
+      , Whitespace
+      , Plaintext "plug-in,"
+      , Whitespace
+      , Plaintext "you"
+      , Whitespace
+      , Plaintext "could"
+      , Whitespace
+      , Plaintext "do"
+      , Whitespace
+      , Plaintext "the"
+      , Whitespace
+      , Plaintext "following"
+      , Whitespace
+      , Plaintext "after"
+      , Whitespace
+      , Code "cd"
+      , Plaintext "-ing"
+      , Whitespace
+      , Plaintext "into"
+      , Whitespace
+      , Plaintext "the"
+      , Whitespace
+      , Plaintext "top-level"
+      , Whitespace
+      , Plaintext "of"
+      , Whitespace
+      , Plaintext "your"
+      , Whitespace
+      , Plaintext "Git"
+      , Whitespace
+      , Plaintext "superproject:"
+      ]
+  , Fenced
+      [ "git submodule add https://github.com/wincent/pinnacle.git ~/vim/bundle/pinnacle"
+      , "git submodule init"
+      ]
+  , Paragraph
+      [ Plaintext "To"
+      , Whitespace
+      , Plaintext "generate"
+      , Whitespace
+      , Plaintext "help"
+      , Whitespace
+      , Plaintext "tags"
+      , Whitespace
+      , Plaintext "under"
+      , Whitespace
+      , Plaintext "Pathogen,"
+      , Whitespace
+      , Plaintext "you"
+      , Whitespace
+      , Plaintext "can"
+      , Whitespace
+      , Plaintext "do"
+      , Whitespace
+      , Plaintext "so"
+      , Whitespace
+      , Plaintext "from"
+      , Whitespace
+      , Plaintext "inside"
+      , Whitespace
+      , Plaintext "Vim"
+      , Whitespace
+      , Plaintext "with:"
+      ]
+  , Fenced [ ":call pathogen#helptags()" ]
+  , HeadingAnnotation "Website"
+  , Paragraph
+      [ Plaintext "The"
+      , Whitespace
+      , Plaintext "official"
+      , Whitespace
+      , Plaintext "Pinnacle"
+      , Whitespace
+      , Plaintext "source"
+      , Whitespace
+      , Plaintext "code"
+      , Whitespace
+      , Plaintext "repo"
+      , Whitespace
+      , Plaintext "is"
+      , Whitespace
+      , Plaintext "at:"
+      ]
+  , Paragraph [ Plaintext "http://git.wincent.com/pinnacle.git" ]
+  , Paragraph
+      [ Plaintext "Mirrors"
+      , Whitespace
+      , Plaintext "exist"
+      , Whitespace
+      , Plaintext "at:"
+      ]
+  , List
+      [ ListItem [ Plaintext "https://github.com/wincent/pinnacle" ]
+      , ListItem [ Plaintext "https://gitlab.com/wincent/pinnacle" ]
+      , ListItem [ Plaintext "https://bitbucket.org/ghurrell/pinnacle" ]
+      ]
+  , Paragraph
+      [ Plaintext "Official"
+      , Whitespace
+      , Plaintext "releases"
+      , Whitespace
+      , Plaintext "are"
+      , Whitespace
+      , Plaintext "listed"
+      , Whitespace
+      , Plaintext "at:"
+      ]
+  , Paragraph
+      [ Plaintext "http://www.vim.org/scripts/script.php?script_id=5360"
+      ]
+  , HeadingAnnotation "License"
+  , Paragraph
+      [ Plaintext "Copyright"
+      , Whitespace
+      , Plaintext "(c)"
+      , Whitespace
+      , Plaintext "2016-present"
+      , Whitespace
+      , Plaintext "Greg"
+      , Whitespace
+      , Plaintext "Hurrell"
+      ]
+  , Paragraph
+      [ Plaintext "Permission"
+      , Whitespace
+      , Plaintext "is"
+      , Whitespace
+      , Plaintext "hereby"
+      , Whitespace
+      , Plaintext "granted,"
+      , Whitespace
+      , Plaintext "free"
+      , Whitespace
+      , Plaintext "of"
+      , Whitespace
+      , Plaintext "charge,"
+      , Whitespace
+      , Plaintext "to"
+      , Whitespace
+      , Plaintext "any"
+      , Whitespace
+      , Plaintext "person"
+      , Whitespace
+      , Plaintext "obtaining"
+      , Whitespace
+      , Plaintext "a"
+      , Whitespace
+      , Plaintext "copy"
+      , Whitespace
+      , Plaintext "of"
+      , Whitespace
+      , Plaintext "this"
+      , Whitespace
+      , Plaintext "software"
+      , Whitespace
+      , Plaintext "and"
+      , Whitespace
+      , Plaintext "associated"
+      , Whitespace
+      , Plaintext "documentation"
+      , Whitespace
+      , Plaintext "files"
+      , Whitespace
+      , Plaintext "(the"
+      , Whitespace
+      , Plaintext "\"Software\"),"
+      , Whitespace
+      , Plaintext "to"
+      , Whitespace
+      , Plaintext "deal"
+      , Whitespace
+      , Plaintext "in"
+      , Whitespace
+      , Plaintext "the"
+      , Whitespace
+      , Plaintext "Software"
+      , Whitespace
+      , Plaintext "without"
+      , Whitespace
+      , Plaintext "restriction,"
+      , Whitespace
+      , Plaintext "including"
+      , Whitespace
+      , Plaintext "without"
+      , Whitespace
+      , Plaintext "limitation"
+      , Whitespace
+      , Plaintext "the"
+      , Whitespace
+      , Plaintext "rights"
+      , Whitespace
+      , Plaintext "to"
+      , Whitespace
+      , Plaintext "use,"
+      , Whitespace
+      , Plaintext "copy,"
+      , Whitespace
+      , Plaintext "modify,"
+      , Whitespace
+      , Plaintext "merge,"
+      , Whitespace
+      , Plaintext "publish,"
+      , Whitespace
+      , Plaintext "distribute,"
+      , Whitespace
+      , Plaintext "sublicense,"
+      , Whitespace
+      , Plaintext "and/or"
+      , Whitespace
+      , Plaintext "sell"
+      , Whitespace
+      , Plaintext "copies"
+      , Whitespace
+      , Plaintext "of"
+      , Whitespace
+      , Plaintext "the"
+      , Whitespace
+      , Plaintext "Software,"
+      , Whitespace
+      , Plaintext "and"
+      , Whitespace
+      , Plaintext "to"
+      , Whitespace
+      , Plaintext "permit"
+      , Whitespace
+      , Plaintext "persons"
+      , Whitespace
+      , Plaintext "to"
+      , Whitespace
+      , Plaintext "whom"
+      , Whitespace
+      , Plaintext "the"
+      , Whitespace
+      , Plaintext "Software"
+      , Whitespace
+      , Plaintext "is"
+      , Whitespace
+      , Plaintext "furnished"
+      , Whitespace
+      , Plaintext "to"
+      , Whitespace
+      , Plaintext "do"
+      , Whitespace
+      , Plaintext "so,"
+      , Whitespace
+      , Plaintext "subject"
+      , Whitespace
+      , Plaintext "to"
+      , Whitespace
+      , Plaintext "the"
+      , Whitespace
+      , Plaintext "following"
+      , Whitespace
+      , Plaintext "conditions:"
+      ]
+  , Paragraph
+      [ Plaintext "The"
+      , Whitespace
+      , Plaintext "above"
+      , Whitespace
+      , Plaintext "copyright"
+      , Whitespace
+      , Plaintext "notice"
+      , Whitespace
+      , Plaintext "and"
+      , Whitespace
+      , Plaintext "this"
+      , Whitespace
+      , Plaintext "permission"
+      , Whitespace
+      , Plaintext "notice"
+      , Whitespace
+      , Plaintext "shall"
+      , Whitespace
+      , Plaintext "be"
+      , Whitespace
+      , Plaintext "included"
+      , Whitespace
+      , Plaintext "in"
+      , Whitespace
+      , Plaintext "all"
+      , Whitespace
+      , Plaintext "copies"
+      , Whitespace
+      , Plaintext "or"
+      , Whitespace
+      , Plaintext "substantial"
+      , Whitespace
+      , Plaintext "portions"
+      , Whitespace
+      , Plaintext "of"
+      , Whitespace
+      , Plaintext "the"
+      , Whitespace
+      , Plaintext "Software."
+      ]
+  , Paragraph
+      [ Plaintext "THE"
+      , Whitespace
+      , Plaintext "SOFTWARE"
+      , Whitespace
+      , Plaintext "IS"
+      , Whitespace
+      , Plaintext "PROVIDED"
+      , Whitespace
+      , Plaintext "\"AS"
+      , Whitespace
+      , Plaintext "IS\","
+      , Whitespace
+      , Plaintext "WITHOUT"
+      , Whitespace
+      , Plaintext "WARRANTY"
+      , Whitespace
+      , Plaintext "OF"
+      , Whitespace
+      , Plaintext "ANY"
+      , Whitespace
+      , Plaintext "KIND,"
+      , Whitespace
+      , Plaintext "EXPRESS"
+      , Whitespace
+      , Plaintext "OR"
+      , Whitespace
+      , Plaintext "IMPLIED,"
+      , Whitespace
+      , Plaintext "INCLUDING"
+      , Whitespace
+      , Plaintext "BUT"
+      , Whitespace
+      , Plaintext "NOT"
+      , Whitespace
+      , Plaintext "LIMITED"
+      , Whitespace
+      , Plaintext "TO"
+      , Whitespace
+      , Plaintext "THE"
+      , Whitespace
+      , Plaintext "WARRANTIES"
+      , Whitespace
+      , Plaintext "OF"
+      , Whitespace
+      , Plaintext "MERCHANTABILITY,"
+      , Whitespace
+      , Plaintext "FITNESS"
+      , Whitespace
+      , Plaintext "FOR"
+      , Whitespace
+      , Plaintext "A"
+      , Whitespace
+      , Plaintext "PARTICULAR"
+      , Whitespace
+      , Plaintext "PURPOSE"
+      , Whitespace
+      , Plaintext "AND"
+      , Whitespace
+      , Plaintext "NONINFRINGEMENT."
+      , Whitespace
+      , Plaintext "IN"
+      , Whitespace
+      , Plaintext "NO"
+      , Whitespace
+      , Plaintext "EVENT"
+      , Whitespace
+      , Plaintext "SHALL"
+      , Whitespace
+      , Plaintext "THE"
+      , Whitespace
+      , Plaintext "AUTHORS"
+      , Whitespace
+      , Plaintext "OR"
+      , Whitespace
+      , Plaintext "COPYRIGHT"
+      , Whitespace
+      , Plaintext "HOLDERS"
+      , Whitespace
+      , Plaintext "BE"
+      , Whitespace
+      , Plaintext "LIABLE"
+      , Whitespace
+      , Plaintext "FOR"
+      , Whitespace
+      , Plaintext "ANY"
+      , Whitespace
+      , Plaintext "CLAIM,"
+      , Whitespace
+      , Plaintext "DAMAGES"
+      , Whitespace
+      , Plaintext "OR"
+      , Whitespace
+      , Plaintext "OTHER"
+      , Whitespace
+      , Plaintext "LIABILITY,"
+      , Whitespace
+      , Plaintext "WHETHER"
+      , Whitespace
+      , Plaintext "IN"
+      , Whitespace
+      , Plaintext "AN"
+      , Whitespace
+      , Plaintext "ACTION"
+      , Whitespace
+      , Plaintext "OF"
+      , Whitespace
+      , Plaintext "CONTRACT,"
+      , Whitespace
+      , Plaintext "TORT"
+      , Whitespace
+      , Plaintext "OR"
+      , Whitespace
+      , Plaintext "OTHERWISE,"
+      , Whitespace
+      , Plaintext "ARISING"
+      , Whitespace
+      , Plaintext "FROM,"
+      , Whitespace
+      , Plaintext "OUT"
+      , Whitespace
+      , Plaintext "OF"
+      , Whitespace
+      , Plaintext "OR"
+      , Whitespace
+      , Plaintext "IN"
+      , Whitespace
+      , Plaintext "CONNECTION"
+      , Whitespace
+      , Plaintext "WITH"
+      , Whitespace
+      , Plaintext "THE"
+      , Whitespace
+      , Plaintext "SOFTWARE"
+      , Whitespace
+      , Plaintext "OR"
+      , Whitespace
+      , Plaintext "THE"
+      , Whitespace
+      , Plaintext "USE"
+      , Whitespace
+      , Plaintext "OR"
+      , Whitespace
+      , Plaintext "OTHER"
+      , Whitespace
+      , Plaintext "DEALINGS"
+      , Whitespace
+      , Plaintext "IN"
+      , Whitespace
+      , Plaintext "THE"
+      , Whitespace
+      , Plaintext "SOFTWARE."
+      ]
+  , HeadingAnnotation "Development"
+  , SubheadingAnnotation "Contributing patches"
+  , Paragraph
+      [ Plaintext "Patches"
+      , Whitespace
+      , Plaintext "can"
+      , Whitespace
+      , Plaintext "be"
+      , Whitespace
+      , Plaintext "sent"
+      , Whitespace
+      , Plaintext "via"
+      , Whitespace
+      , Plaintext "mail"
+      , Whitespace
+      , Plaintext "to"
+      , Whitespace
+      , Plaintext "greg@hurrell.net,"
+      , Whitespace
+      , Plaintext "or"
+      , Whitespace
+      , Plaintext "as"
+      , Whitespace
+      , Plaintext "GitHub"
+      , Whitespace
+      , Plaintext "pull"
+      , Whitespace
+      , Plaintext "requests"
+      , Whitespace
+      , Plaintext "at:"
+      , Whitespace
+      , Plaintext "https://github.com/wincent/pinnacle/pulls"
+      ]
+  , SubheadingAnnotation "Cutting a new release"
+  , Paragraph
+      [ Plaintext "At"
+      , Whitespace
+      , Plaintext "the"
+      , Whitespace
+      , Plaintext "moment"
+      , Whitespace
+      , Plaintext "the"
+      , Whitespace
+      , Plaintext "release"
+      , Whitespace
+      , Plaintext "process"
+      , Whitespace
+      , Plaintext "is"
+      , Whitespace
+      , Plaintext "manual:"
+      ]
+  , List
+      [ ListItem
+          [ Plaintext "Perform"
+          , Whitespace
+          , Plaintext "final"
+          , Whitespace
+          , Plaintext "sanity"
+          , Whitespace
+          , Plaintext "checks"
+          , Whitespace
+          , Plaintext "and"
+          , Whitespace
+          , Plaintext "manual"
+          , Whitespace
+          , Plaintext "testing"
+          ]
+      , ListItem
+          [ Plaintext "Update"
+          , Whitespace
+          , Plaintext "the"
+          , Whitespace
+          , Link "pinnacle-history"
+          , Whitespace
+          , Plaintext "section"
+          , Whitespace
+          , Plaintext "of"
+          , Whitespace
+          , Plaintext "the"
+          , Whitespace
+          , Plaintext "documentation"
+          ]
+      , ListItem
+          [ Plaintext "Verify"
+          , Whitespace
+          , Plaintext "clean"
+          , Whitespace
+          , Plaintext "work"
+          , Whitespace
+          , Plaintext "tree:"
+          ]
+      ]
+  , Fenced [ "git status" ]
+  , List
+      [ ListItem
+          [ Plaintext "Tag"
+          , Whitespace
+          , Plaintext "the"
+          , Whitespace
+          , Plaintext "release:"
+          ]
+      ]
+  , Fenced [ "git tag -s -m \"$VERSION release\" $VERSION" ]
+  , List
+      [ ListItem
+          [ Plaintext "Publish"
+          , Whitespace
+          , Plaintext "the"
+          , Whitespace
+          , Plaintext "code:"
+          ]
+      ]
+  , Fenced
+      [ "git push origin master --follow-tags"
+      , "git push github master --follow-tags"
+      ]
+  , List
+      [ ListItem
+          [ Plaintext "Produce"
+          , Whitespace
+          , Plaintext "the"
+          , Whitespace
+          , Plaintext "release"
+          , Whitespace
+          , Plaintext "archive:"
+          ]
+      ]
+  , Fenced [ "git archive -o vim-docvim-$VERSION.zip HEAD -- ." ]
+  , List
+      [ ListItem
+          [ Plaintext "Upload"
+          , Whitespace
+          , Plaintext "to"
+          , Whitespace
+          , Plaintext "http://www.vim.org/scripts/script.php?script_id=5360"
+          ]
+      ]
+  , HeadingAnnotation "Authors"
+  , Paragraph
+      [ Plaintext "Pinnacle"
+      , Whitespace
+      , Plaintext "is"
+      , Whitespace
+      , Plaintext "written"
+      , Whitespace
+      , Plaintext "and"
+      , Whitespace
+      , Plaintext "maintained"
+      , Whitespace
+      , Plaintext "by"
+      , Whitespace
+      , Plaintext "Greg"
+      , Whitespace
+      , Plaintext "Hurrell"
+      , Whitespace
+      , Plaintext "<greg@hurrell.net>."
+      ]
+  , HeadingAnnotation "History"
+  , SubheadingAnnotation "0.1 (30 March 2016)"
+  , List
+      [ ListItem
+          [ Plaintext "Initial" , Whitespace , Plaintext "release." ]
+      ]
+  , Project
+      [ Unit
+          [ FunctionDeclaration
+              { functionBang = True
+              , functionName = "pinnacle#sub_newlines"
+              , functionArguments = ArgumentList [ Argument "string" ]
+              , functionAttributes = [ "abort" ]
+              , functionBody =
+                  [ GenericStatement "return tr(a:string, \"\\r\\n\", ' ')" ]
+              }
+          , FunctionDeclaration
+              { functionBang = True
+              , functionName = "pinnacle#capture_line"
+              , functionArguments = ArgumentList [ Argument "command" ]
+              , functionAttributes = [ "abort" ]
+              , functionBody =
+                  [ GenericStatement "redir => l:capture"
+                  , GenericStatement "execute a:command"
+                  , GenericStatement "redir END"
+                  , GenericStatement "return pinnacle#sub_newlines(l:capture)"
+                  ]
+              }
+          , FunctionDeclaration
+              { functionBang = True
+              , functionName = "pinnacle#capture_highlight"
+              , functionArguments = ArgumentList [ Argument "group" ]
+              , functionAttributes = [ "abort" ]
+              , functionBody =
+                  [ GenericStatement
+                      "return pinnacle#capture_line('0verbose silent highlight ' . a:group)"
+                  ]
+              }
+          , FunctionDeclaration
+              { functionBang = True
+              , functionName = "pinnacle#extract_highlight"
+              , functionArguments = ArgumentList [ Argument "group" ]
+              , functionAttributes = [ "abort" ]
+              , functionBody =
+                  [ LetStatement
+                      { letLexpr = "l:group "
+                      , letValue = "pinnacle#capture_highlight(a:group)"
+                      }
+                  , GenericStatement "while l:group =~# 'links to'"
+                  , LetStatement
+                      { letLexpr = "l:index "
+                      , letValue = "stridx(l:group, 'links to') + len('links to')"
+                      }
+                  , LetStatement
+                      { letLexpr = "l:linked "
+                      , letValue = "strpart(l:group, l:index + 1)"
+                      }
+                  , LetStatement
+                      { letLexpr = "l:group "
+                      , letValue = "pinnacle#capture_highlight(l:linked)"
+                      }
+                  , GenericStatement "endwhile"
+                  , LetStatement
+                      { letLexpr = "l:matches "
+                      , letValue = "matchlist(l:group, '\\<xxx\\>\\s\\+\\(.*\\)')"
+                      }
+                  , LetStatement
+                      { letLexpr = "l:original " , letValue = "l:matches[1]" }
+                  , GenericStatement "return l:original"
+                  ]
+              }
+          , FunctionDeclaration
+              { functionBang = True
+              , functionName = "pinnacle#italicize"
+              , functionArguments = ArgumentList [ Argument "group" ]
+              , functionAttributes = [ "abort" ]
+              , functionBody =
+                  [ GenericStatement "return pinnacle#decorate('italic', a:group)" ]
+              }
+          , FunctionDeclaration
+              { functionBang = True
+              , functionName = "pinnacle#embolden"
+              , functionArguments = ArgumentList [ Argument "group" ]
+              , functionAttributes = [ "abort" ]
+              , functionBody =
+                  [ GenericStatement "return pinnacle#decorate('bold', a:group)" ]
+              }
+          , FunctionDeclaration
+              { functionBang = True
+              , functionName = "pinnacle#decorate"
+              , functionArguments =
+                  ArgumentList [ Argument "style" , Argument "group" ]
+              , functionAttributes = [ "abort" ]
+              , functionBody =
+                  [ LetStatement
+                      { letLexpr = "l:original "
+                      , letValue = "pinnacle#extract_highlight(a:group)"
+                      }
+                  , GenericStatement "for l:lhs in ['gui', 'term', 'cterm']"
+                  , LetStatement
+                      { letLexpr = "l:matches " , letValue = "matchlist(" }
+                  , GenericStatement
+                      "\\ l:original, '^\\([^ ]\\+ \\)\\?' . '\\(' . l:lhs . '=[^ ]\\+\\)' . '\\( .\\+\\)\\?$' )"
+                  , GenericStatement "if l:matches == []"
+                  , LetStatement
+                      { letLexpr = "l:original ."
+                      , letValue = "' ' . l:lhs . '=' . a:style"
+                      }
+                  , GenericStatement "else"
+                  , LetStatement
+                      { letLexpr = "l:start " , letValue = "l:matches[1]" }
+                  , LetStatement
+                      { letLexpr = "l:value " , letValue = "l:matches[2]" }
+                  , LetStatement { letLexpr = "l:end " , letValue = "l:matches[3]" }
+                  , GenericStatement "if l:value =~# '.*' . a:style . '.*'"
+                  , GenericStatement "continue"
+                  , GenericStatement "else"
+                  , LetStatement
+                      { letLexpr = "l:original "
+                      , letValue = "l:start . l:value . ',' . a:style . l:end"
+                      }
+                  , GenericStatement "endif"
+                  , GenericStatement "endif"
+                  , GenericStatement "endfor"
+                  , GenericStatement "return pinnacle#sub_newlines(l:original)"
+                  ]
+              }
+          ]
+      ]
+  ]
diff --git a/tests/fixtures/integration/pinnacle/golden/markdown.golden b/tests/fixtures/integration/pinnacle/golden/markdown.golden
new file mode 100644 (file)
index 0000000..e1d16ae
--- /dev/null
@@ -0,0 +1,103 @@
+# Pinnacle<a name="pinnacle-pinnacle" href="#user-content-pinnacle-pinnacle"></a>
+
+## Intro<a name="pinnacle-intro" href="#user-content-pinnacle-intro"></a>
+
+Pinnacle provides functions for manipulating <strong>`:highlight`</strong> groups.
+
+## Installation<a name="pinnacle-installation" href="#user-content-pinnacle-installation"></a>
+
+To install Pinnacle, use your plug-in management system of choice.
+
+If you don't have a "plug-in management system of choice", I recommend Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and robustness. Assuming that you have Pathogen installed and configured, and that you want to install vim-docvim into `~/.vim/bundle`, you can do so with:
+
+```
+git clone https://github.com/wincent/pinnacle.git ~/.vim/bundle/pinnacle
+```
+
+Alternatively, if you use a Git submodule for each Vim plug-in, you could do the following after `cd`-ing into the top-level of your Git superproject:
+
+```
+git submodule add https://github.com/wincent/pinnacle.git ~/vim/bundle/pinnacle
+git submodule init
+```
+
+To generate help tags under Pathogen, you can do so from inside Vim with:
+
+```
+:call pathogen#helptags()
+```
+
+## Website<a name="pinnacle-website" href="#user-content-pinnacle-website"></a>
+
+The official Pinnacle source code repo is at:
+
+http://git.wincent.com/pinnacle.git
+
+Mirrors exist at:
+
+- https://github.com/wincent/pinnacle
+- https://gitlab.com/wincent/pinnacle
+- https://bitbucket.org/ghurrell/pinnacle
+
+Official releases are listed at:
+
+http://www.vim.org/scripts/script.php?script_id=5360
+
+## License<a name="pinnacle-license" href="#user-content-pinnacle-license"></a>
+
+Copyright (c) 2016-present Greg Hurrell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+## Development<a name="pinnacle-development" href="#user-content-pinnacle-development"></a>
+
+### Contributing patches<a name="pinnacle-contributing-patches" href="#user-content-pinnacle-contributing-patches"></a>
+
+Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests at: https://github.com/wincent/pinnacle/pulls
+
+### Cutting a new release<a name="pinnacle-cutting-a-new-release" href="#user-content-pinnacle-cutting-a-new-release"></a>
+
+At the moment the release process is manual:
+
+- Perform final sanity checks and manual testing
+- Update the <strong>[`pinnacle-history`](#user-content-pinnacle-history)</strong> section of the documentation
+- Verify clean work tree:
+
+```
+git status
+```
+
+- Tag the release:
+
+```
+git tag -s -m "$VERSION release" $VERSION
+```
+
+- Publish the code:
+
+```
+git push origin master --follow-tags
+git push github master --follow-tags
+```
+
+- Produce the release archive:
+
+```
+git archive -o vim-docvim-$VERSION.zip HEAD -- .
+```
+
+- Upload to http://www.vim.org/scripts/script.php?script_id=5360
+
+## Authors<a name="pinnacle-authors" href="#user-content-pinnacle-authors"></a>
+
+Pinnacle is written and maintained by Greg Hurrell <greg@hurrell.net>.
+
+## History<a name="pinnacle-history" href="#user-content-pinnacle-history"></a>
+
+### 0.1 (30 March 2016)<a name="pinnacle-01-30-march-2016" href="#user-content-pinnacle-01-30-march-2016"></a>
+
+- Initial release.
diff --git a/tests/fixtures/integration/pinnacle/golden/plaintext.golden b/tests/fixtures/integration/pinnacle/golden/plaintext.golden
new file mode 100644 (file)
index 0000000..d9033ce
--- /dev/null
@@ -0,0 +1,116 @@
+*pinnacle.txt*           Highlight group manipulation for Vim           *pinnacle*
+
+CONTENTS                                                     *pinnacle-contents*
+
+1. Intro             |pinnacle-intro|
+2. Installation      |pinnacle-installation|
+3. Website           |pinnacle-website|
+4. License           |pinnacle-license|
+5. Development       |pinnacle-development|
+6. Authors           |pinnacle-authors|
+7. History           |pinnacle-history|
+
+INTRO                                                           *pinnacle-intro*
+
+Pinnacle provides functions for manipulating |:highlight| groups.
+
+INSTALLATION                                             *pinnacle-installation*
+
+To install Pinnacle, use your plug-in management system of choice.
+
+If you don't have a "plug-in management system of choice", I recommend
+Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and
+robustness. Assuming that you have Pathogen installed and configured, and
+that you want to install vim-docvim into `~/.vim/bundle`, you can do so with:
+>
+    git clone https://github.com/wincent/pinnacle.git ~/.vim/bundle/pinnacle
+<
+Alternatively, if you use a Git submodule for each Vim plug-in, you could do
+the following after `cd`-ing into the top-level of your Git superproject:
+>
+    git submodule add https://github.com/wincent/pinnacle.git ~/vim/bundle/pinnacle
+    git submodule init
+<
+To generate help tags under Pathogen, you can do so from inside Vim with:
+>
+    :call pathogen#helptags()
+<
+WEBSITE                                                       *pinnacle-website*
+
+The official Pinnacle source code repo is at:
+
+http://git.wincent.com/pinnacle.git
+
+Mirrors exist at:
+
+- https://github.com/wincent/pinnacle
+- https://gitlab.com/wincent/pinnacle
+- https://bitbucket.org/ghurrell/pinnacle
+
+Official releases are listed at:
+
+http://www.vim.org/scripts/script.php?script_id=5360
+
+LICENSE                                                       *pinnacle-license*
+
+Copyright (c) 2016-present Greg Hurrell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+
+DEVELOPMENT                                               *pinnacle-development*
+
+Contributing patches ~
+
+Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests
+at: https://github.com/wincent/pinnacle/pulls
+
+Cutting a new release ~
+
+At the moment the release process is manual:
+
+- Perform final sanity checks and manual testing
+- Update the |pinnacle-history| section of the documentation
+- Verify clean work tree:
+>
+    git status
+<
+- Tag the release:
+>
+    git tag -s -m "$VERSION release" $VERSION
+<
+- Publish the code:
+>
+    git push origin master --follow-tags
+    git push github master --follow-tags
+<
+- Produce the release archive:
+>
+    git archive -o vim-docvim-$VERSION.zip HEAD -- .
+<
+- Upload to http://www.vim.org/scripts/script.php?script_id=5360
+
+AUTHORS                                                       *pinnacle-authors*
+
+Pinnacle is written and maintained by Greg Hurrell <greg@hurrell.net>.
+
+HISTORY                                                       *pinnacle-history*
+
+0.1 (30 March 2016) ~
+
+- Initial release.
diff --git a/tests/fixtures/integration/pinnacle/input/.gitignore b/tests/fixtures/integration/pinnacle/input/.gitignore
new file mode 100644 (file)
index 0000000..2850af1
--- /dev/null
@@ -0,0 +1 @@
+/pinnacle-*.zip
diff --git a/tests/fixtures/integration/pinnacle/input/autoload/pinnacle.vim b/tests/fixtures/integration/pinnacle/input/autoload/pinnacle.vim
new file mode 100644 (file)
index 0000000..11877be
--- /dev/null
@@ -0,0 +1,210 @@
+""
+" @plugin Pinnacle Highlight group manipulation for Vim
+"
+" # Intro
+"
+" Pinnacle provides functions for manipulating |:highlight| groups.
+"
+"
+" # Installation
+"
+" To install Pinnacle, use your plug-in management system of choice.
+"
+" If you don't have a "plug-in management system of choice", I recommend
+" Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and
+" robustness. Assuming that you have Pathogen installed and configured, and that
+" you want to install vim-docvim into `~/.vim/bundle`, you can do so with:
+"
+" ```
+" git clone https://github.com/wincent/pinnacle.git ~/.vim/bundle/pinnacle
+" ```
+"
+" Alternatively, if you use a Git submodule for each Vim plug-in, you could do
+" the following after `cd`-ing into the top-level of your Git superproject:
+"
+" ```
+" git submodule add https://github.com/wincent/pinnacle.git ~/vim/bundle/pinnacle
+" git submodule init
+" ```
+"
+" To generate help tags under Pathogen, you can do so from inside Vim with:
+"
+" ```
+" :call pathogen#helptags()
+" ```
+"
+"
+" # Website
+"
+" The official Pinnacle source code repo is at:
+"
+"   http://git.wincent.com/pinnacle.git
+"
+" Mirrors exist at:
+"
+"   - https://github.com/wincent/pinnacle
+"   - https://gitlab.com/wincent/pinnacle
+"   - https://bitbucket.org/ghurrell/pinnacle
+"
+" Official releases are listed at:
+"
+"   http://www.vim.org/scripts/script.php?script_id=5360
+"
+"
+" # License
+"
+" Copyright (c) 2016-present Greg Hurrell
+"
+" Permission is hereby granted, free of charge, to any person obtaining
+" a copy of this software and associated documentation files (the
+" "Software"), to deal in the Software without restriction, including
+" without limitation the rights to use, copy, modify, merge, publish,
+" distribute, sublicense, and/or sell copies of the Software, and to
+" permit persons to whom the Software is furnished to do so, subject to
+" the following conditions:
+"
+" The above copyright notice and this permission notice shall be
+" included in all copies or substantial portions of the Software.
+"
+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+"
+"
+" # Development
+"
+" ## Contributing patches
+"
+" Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests
+" at: https://github.com/wincent/pinnacle/pulls
+"
+" ## Cutting a new release
+"
+" At the moment the release process is manual:
+"
+" - Perform final sanity checks and manual testing
+" - Update the |pinnacle-history| section of the documentation
+" - Verify clean work tree:
+"
+" ```
+" git status
+" ```
+"
+" - Tag the release:
+"
+" ```
+" git tag -s -m "$VERSION release" $VERSION
+" ```
+"
+" - Publish the code:
+"
+" ```
+" git push origin master --follow-tags
+" git push github master --follow-tags
+" ```
+"
+" - Produce the release archive:
+"
+" ```
+" git archive -o vim-docvim-$VERSION.zip HEAD -- .
+" ```
+"
+" - Upload to http://www.vim.org/scripts/script.php?script_id=5360
+"
+"
+" # Authors
+"
+" Pinnacle is written and maintained by Greg Hurrell <greg@hurrell.net>.
+"
+"
+" # History
+"
+" ## 0.1 (30 March 2016)
+"
+" - Initial release.
+
+" Replaces newlines with spaces.
+function! pinnacle#sub_newlines(string) abort
+  return tr(a:string, "\r\n", '  ')
+endfunction
+
+" Runs a command and returns the captured output as a single line.
+"
+" Useful when we don't want to let long lines on narrow windows produce unwanted
+" embedded newlines.
+function! pinnacle#capture_line(command) abort
+  redir => l:capture
+  execute a:command
+  redir END
+
+  return pinnacle#sub_newlines(l:capture)
+endfunction
+
+" Gets the current value of a highlight group.
+function! pinnacle#capture_highlight(group) abort
+  return pinnacle#capture_line('0verbose silent highlight ' . a:group)
+endfunction
+
+" Extracts a highlight string from a group, recursively traversing linked
+" groups, and returns a string suitable for passing to `:highlight`.
+function! pinnacle#extract_highlight(group) abort
+  let l:group = pinnacle#capture_highlight(a:group)
+
+  " Traverse links back to authoritative group.
+  while l:group =~# 'links to'
+    let l:index = stridx(l:group, 'links to') + len('links to')
+    let l:linked = strpart(l:group, l:index + 1)
+    let l:group = pinnacle#capture_highlight(l:linked)
+  endwhile
+
+  " Extract the highlighting details (the bit after "xxx")
+  let l:matches = matchlist(l:group, '\<xxx\>\s\+\(.*\)')
+  let l:original = l:matches[1]
+  return l:original
+endfunction
+
+" Returns an italicized copy of `group` suitable for passing to `:highlight`.
+function! pinnacle#italicize(group) abort
+  return pinnacle#decorate('italic', a:group)
+endfunction
+
+" Returns a bold copy of `group` suitable for passing to `:highlight`.
+function! pinnacle#embolden(group) abort
+  return pinnacle#decorate('bold', a:group)
+endfunction
+
+" Returns a copy of `group` decorated with `style` (eg. "bold", "italic" etc)
+" suitable for passing to `:highlight`.
+function! pinnacle#decorate(style, group) abort
+  let l:original = pinnacle#extract_highlight(a:group)
+
+  for l:lhs in ['gui', 'term', 'cterm']
+    " Check for existing setting.
+    let l:matches = matchlist(
+      \   l:original,
+      \   '^\([^ ]\+ \)\?' .
+      \   '\(' . l:lhs . '=[^ ]\+\)' .
+      \   '\( .\+\)\?$'
+      \ )
+    if l:matches == []
+      " No setting, add one with just a:style in it
+      let l:original .= ' ' . l:lhs . '=' . a:style
+    else
+      " Existing setting; check whether a:style is already in it.
+      let l:start = l:matches[1]
+      let l:value = l:matches[2]
+      let l:end = l:matches[3]
+      if l:value =~# '.*' . a:style . '.*'
+        continue
+      else
+        let l:original = l:start . l:value . ',' . a:style . l:end
+      endif
+    endif
+  endfor
+
+  return pinnacle#sub_newlines(l:original)
+endfunction