Skip to content

Instantly share code, notes, and snippets.

@chivalry
Created July 27, 2014 20:11
Show Gist options
  • Save chivalry/a692e2e71b6f7953a181 to your computer and use it in GitHub Desktop.
Save chivalry/a692e2e71b6f7953a181 to your computer and use it in GitHub Desktop.
~ $ cd Scripts/
Scripts $ mkdir Python
Scripts $ git clone https://github.com/xolox/vim-tools.git
Cloning into 'vim-tools'...
remote: Reusing existing pack: 373, done.
remote: Total 373 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (373/373), 120.88 KiB | 34 KiB/s, done.
Resolving deltas: 100% (213/213), done.
Scripts $ cd vim-tools/
vim-tools $ ll
total 208
drwxr-xr-x 12 408 Jul 12 19:38 .git/
-rw-r--r-- 1 6051 Jul 12 19:38 README.md
-rwxr-xr-x 1 45732 Jul 12 19:38 html2vimdoc.py*
drwxr-xr-x 4 136 Jul 12 19:38 libs/
-rwxr-xr-x 1 34803 Jul 12 19:38 vim-plugin-manager.py*
-rwxr-xr-x 1 9030 Jul 12 19:38 vimdoctool.py*
vim-tools $ virtualenv html2vimdoc
New python executable in html2vimdoc/bin/python
Installing setuptools, pip...done.
vim-tools $ html2vimdoc/bin/pip install beautifulsoup coloredlogs
Downloading/unpacking beautifulsoup
Downloading BeautifulSoup-3.2.1.tar.gz
Running setup.py (path:/Users/chuck/Scripts/vim-tools/html2vimdoc/build/beautifulsoup/setup.py) egg_info for package beautifulsoup
Downloading/unpacking coloredlogs
Downloading coloredlogs-0.5.tar.gz
Running setup.py (path:/Users/chuck/Scripts/vim-tools/html2vimdoc/build/coloredlogs/setup.py) egg_info for package coloredlogs
Installing collected packages: beautifulsoup, coloredlogs
Running setup.py install for beautifulsoup
Running setup.py install for coloredlogs
Installing ansi2html script to /Users/chuck/Scripts/vim-tools/html2vimdoc/bin
Successfully installed beautifulsoup coloredlogs
Cleaning up...
vim-tools $ html2vimdoc/bin/python ./html2vimdoc.py --help
html2vimdoc [OPTIONS] [LOCATION]
Convert HTML (and Markdown) documents to Vim help files. When LOCATION is given
it is assumed to be the filename or URL of the input, if --url is given that
URL will be used, otherwise the script reads from standard input. The generated
Vim help file is written to standard output.
Valid options:
-f, --file=NAME name of generated help file (embedded
in Vim help file as first defined tag)
-t, --title=STR title of generated help file
-u, --url=ADDR URL of document (to detect relative links)
-x, --ext=NAME enable the named Markdown extension (only
relevant when input is Markdown; the extension
'fenced_code' is enabled by default)
-p, --preview preview generated Vim help file in Vim
-v, --verbose make more noise (a lot of noise)
-h, --help show this message and exit
This program tries to produce reasonable output given only an HTML or Markdown
document as input, but you can change most defaults with the command line
options listed above.
There are several dependencies that need to be installed to run this program.
The easiest way to install them is in a Python virtual environment:
# Create the virtual environment.
virtualenv html2vimdoc
# Install the dependencies.
html2vimdoc/bin/pip install beautifulsoup coloredlogs
# Run the program.
html2vimdoc/bin/python ./html2vimdoc.py --help
vim-tools $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment