mirror of
https://github.com/gryf/.vim.git
synced 2025-12-17 11:30:29 +01:00
Modified wombat color theme (colors for column adn visual block)
Modified class for reST, added support for acronyms html Cosmetic changes on pylint python module Removed leftovers from nerd tree plugin
This commit is contained in:
@@ -12,10 +12,15 @@ map <F5> :call <SID>Rst2Blogger()<cr>
|
||||
" suitable to copy and paste into blogger post.
|
||||
fun <SID>Rst2Blogger()
|
||||
python << EOF
|
||||
import re
|
||||
|
||||
from docutils import core
|
||||
from docutils import nodes
|
||||
from docutils.writers.html4css1 import Writer, HTMLTranslator
|
||||
|
||||
import vim
|
||||
|
||||
|
||||
class NoHeaderHTMLTranslator(HTMLTranslator):
|
||||
def __init__(self, document):
|
||||
HTMLTranslator.__init__(self,document)
|
||||
@@ -41,6 +46,21 @@ class NoHeaderHTMLTranslator(HTMLTranslator):
|
||||
def depart_section(self, node):
|
||||
pass
|
||||
|
||||
def visit_acronym(self, node):
|
||||
node_text = node.children[0].astext()
|
||||
node_text = node_text.replace('\n', ' ')
|
||||
patt = re.compile(r'^(.+)\s<(.+)>')
|
||||
|
||||
if patt.match(node_text):
|
||||
node.children[0] = nodes.Text(patt.match(node_text).groups()[0])
|
||||
self.body.append(\
|
||||
self.starttag(node, 'acronym',
|
||||
'', title=patt.match(node_text).groups()[1]))
|
||||
|
||||
else:
|
||||
self.body.append(self.starttag(node, 'acronym', ''))
|
||||
|
||||
|
||||
_w = Writer()
|
||||
_w.translator_class = NoHeaderHTMLTranslator
|
||||
|
||||
|
||||
Reference in New Issue
Block a user