forked from vkocubinsky/SublimeTableEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
table_re_structured_text_syntax.py
49 lines (33 loc) · 1.64 KB
/
table_re_structured_text_syntax.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# re_structured_text_syntax.py - Support reStructuredText table syntax
# Copyright (C) 2012 Free Software Foundation, Inc.
# Author: Valery Kocubinsky
# Package: SublimeTableEditor
# Homepage: https://github.com/vkocubinsky/SublimeTableEditor
# This file is part of SublimeTableEditor.
# SublimeTableEditor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# SublimeTableEditor is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with SublimeTableEditor. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
from __future__ import division
try:
from . import table_base as tbase
from . import table_border_syntax as tborder
except ValueError:
import table_base as tbase
import table_border_syntax as tborder
def create_syntax(table_configuration=None):
return ReStructuredTextTableSyntax(table_configuration)
class ReStructuredTextTableSyntax(tbase.TableSyntax):
def __init__(self, table_configuration):
tbase.TableSyntax.__init__(self, "reStructuredText", table_configuration)
self.table_parser = tborder.BorderTableParser(self)
self.table_driver = tborder.BorderTableDriver(self)
self.hline_out_border = '+'
self.hline_in_border = '+'