diff --git a/ftplugin/rst/commons.vim b/ftplugin/rst/commons.vim index df054bf..cae483a 100644 --- a/ftplugin/rst/commons.vim +++ b/ftplugin/rst/commons.vim @@ -1,6 +1,8 @@ " Some common settings for all reSt files setlocal textwidth=80 -setlocal makeprg=rst2html.py\ \"%\"\ \"%:p:r.html\" +"setlocal makeprg=rst2html.sh\ \"%\"\ \"%:p:r.html\" +let &makeprg = 'rst2html.py --syntax-highlight=short --stylesheet ' . expand(':p:h', 1) . '/style.css "%" "%:p:r.html"' + setlocal spell setlocal smartindent setlocal autoindent diff --git a/ftplugin/rst/style.css b/ftplugin/rst/style.css new file mode 100644 index 0000000..6e3887c --- /dev/null +++ b/ftplugin/rst/style.css @@ -0,0 +1,183 @@ +/* simple stylesheet for preview rst files in HTML */ +html { + margin: 0; + padding: 0; +} + +body { + font-family: Helvetica,Arial,sans-serif; + margin: 0; + padding: 0; + color: rgb(51, 51, 51); +} +a { + color: rgb(64, 120, 192); + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +img { + max-width: 100%; + height: auto; +} + +.document { + margin-left: auto; + margin-right: auto; + margin-bottom: 2em; + margin-top: 2em; + width: 60em; + padding: 3em; + + word-wrap: break-word; + background-color: rgb(255, 255, 255); + border: 1px solid rgb(221, 221, 221); + border-radius: 4px 4px 4px 4px; +} + +input { + background: none repeat scroll 0 0 #555; + border: medium none; + border-radius: 5px 5px 5px 5px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) inset; + padding: 4px 7px; + transition: width 0.7s ease 0s; +} + +/* Pygments highlighting classes */ + +.code { + font: 12px Consolas,"Liberation Mono",Menlo,Courier,monospace; + margin: 0; + padding: 16px; + overflow: auto; + line-height: 1.45; + background-color: rgb(247, 24, 247); + border-radius: 4px 4px 4px 4px; +} + +.code pre { + padding: 0; + margin: 0; + padding: 16px; + overflow: auto; + font-size: 85%; + line-height: 1.45; + background-color: rgb(47, 247, 247); + border-radius: 4px 4px 4px 4px; +} + +.code .hll { background-color: #ffffcc } +.code { background: #f8f8f8; } +.code .c { color: #408080; font-style: italic } /* Comment */ +.code .err { border: 1px solid #FF0000 } /* Error */ +.code .k { color: #008000; font-weight: bold } /* Keyword */ +.code .o { color: #666666 } /* Operator */ +.code .ch { color: #408080; font-style: italic } /* Comment.Hashbang */ +.code .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.code .cp { color: #BC7A00 } /* Comment.Preproc */ +.code .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */ +.code .c1 { color: #408080; font-style: italic } /* Comment.Single */ +.code .cs { color: #408080; font-style: italic } /* Comment.Special */ +.code .gd { color: #A00000 } /* Generic.Deleted */ +.code .ge { font-style: italic } /* Generic.Emph */ +.code .gr { color: #FF0000 } /* Generic.Error */ +.code .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.code .gi { color: #00A000 } /* Generic.Inserted */ +.code .go { color: #888888 } /* Generic.Output */ +.code .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.code .gs { font-weight: bold } /* Generic.Strong */ +.code .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.code .gt { color: #0044DD } /* Generic.Traceback */ +.code .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.code .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.code .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.code .kp { color: #008000 } /* Keyword.Pseudo */ +.code .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.code .kt { color: #B00040 } /* Keyword.Type */ +.code .m { color: #666666 } /* Literal.Number */ +.code .s { color: #BA2121 } /* Literal.String */ +.code .na { color: #7D9029 } /* Name.Attribute */ +.code .nb { color: #008000 } /* Name.Builtin */ +.code .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.code .no { color: #880000 } /* Name.Constant */ +.code .nd { color: #AA22FF } /* Name.Decorator */ +.code .ni { color: #999999; font-weight: bold } /* Name.Entity */ +.code .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.code .nf { color: #0000FF } /* Name.Function */ +.code .nl { color: #A0A000 } /* Name.Label */ +.code .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.code .nt { color: #008000; font-weight: bold } /* Name.Tag */ +.code .nv { color: #19177C } /* Name.Variable */ +.code .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.code .w { color: #bbbbbb } /* Text.Whitespace */ +.code .mb { color: #666666 } /* Literal.Number.Bin */ +.code .mf { color: #666666 } /* Literal.Number.Float */ +.code .mh { color: #666666 } /* Literal.Number.Hex */ +.code .mi { color: #666666 } /* Literal.Number.Integer */ +.code .mo { color: #666666 } /* Literal.Number.Oct */ +.code .sb { color: #BA2121 } /* Literal.String.Backtick */ +.code .sc { color: #BA2121 } /* Literal.String.Char */ +.code .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.code .s2 { color: #BA2121 } /* Literal.String.Double */ +.code .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.code .sh { color: #BA2121 } /* Literal.String.Heredoc */ +.code .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.code .sx { color: #008000 } /* Literal.String.Other */ +.code .sr { color: #BB6688 } /* Literal.String.Regex */ +.code .s1 { color: #BA2121 } /* Literal.String.Single */ +.code .ss { color: #19177C } /* Literal.String.Symbol */ +.code .bp { color: #008000 } /* Name.Builtin.Pseudo */ +.code .vc { color: #19177C } /* Name.Variable.Class */ +.code .vg { color: #19177C } /* Name.Variable.Global */ +.code .vi { color: #19177C } /* Name.Variable.Instance */ +.code .il { color: #666666 } /* Literal.Number.Integer.Long */ + +h1.title { + padding-bottom: 0.3em; + font-size: 2em; + border-bottom: 1px solid rgb(238, 238, 238); +} + +h1 { + border-bottom: 1px solid rgb(238, 238, 238); + font-size: 1.5em; + padding-bottom: 0.3em; +} + +h2 { + font-size: 1.25em; +} + +h3 { + font-size: 1.12em; +} + +h4 { + font-size: 1.6em; +} + +h5 { + font-size: 1.3em; +} + +h6 { + font-size: 1.1em; +} + +.figure { + margin: 0 auto 2em; + padding: 5px; + text-align: center; +} + +.figure p { + font-size: 0.9em; +} + +.figure img, table.results { + border: 2px solid black; +}