|
@@ 52-68 (lines=17) @@
|
| 49 |
|
|
| 50 |
|
assert json.loads(json.dumps(pandoc_listof.listof(src['t'], src['c'], 'latex', {}))) == dest |
| 51 |
|
|
| 52 |
|
def test_toccolor(): |
| 53 |
|
init() |
| 54 |
|
|
| 55 |
|
meta = {'toccolor': {'t': 'MetaInlines', 'c': [{'t': 'Str', 'c': 'red'}]}} |
| 56 |
|
src = json.loads(json.dumps(Span(['exercise:1', [], []], [Str(u'Exercise'), Space(), Str(u'1')]))) |
| 57 |
|
pandoc_listof.collect(src['t'], src['c'], 'latex', meta) |
| 58 |
|
|
| 59 |
|
src = json.loads(json.dumps(Span(['exercise:2', [], []], [Str(u'Exercise'), Space(), Str(u'2')]))) |
| 60 |
|
pandoc_listof.collect(src['t'], src['c'], 'latex', meta) |
| 61 |
|
|
| 62 |
|
src = json.loads(json.dumps(Para([Str(u'{exercise}')]))) |
| 63 |
|
dest = json.loads(json.dumps(Para([RawInline( |
| 64 |
|
'tex', |
| 65 |
|
'\\hypersetup{linkcolor=red}\\makeatletter\\@starttoc{exercise}\\makeatother' |
| 66 |
|
)]))) |
| 67 |
|
|
| 68 |
|
assert json.loads(json.dumps(pandoc_listof.listof(src['t'], src['c'], 'latex', meta))) == dest |
| 69 |
|
|
| 70 |
|
def test_double_curly_bracket(): |
| 71 |
|
init() |
|
@@ 35-50 (lines=16) @@
|
| 32 |
|
|
| 33 |
|
assert json.loads(json.dumps(pandoc_listof.listof(src['t'], src['c'], '', {}))) == dest |
| 34 |
|
|
| 35 |
|
def test_latex(): |
| 36 |
|
init() |
| 37 |
|
|
| 38 |
|
src = json.loads(json.dumps(Span(['exercise:1', [], []], [Str(u'Exercise'), Space(), Str(u'1')]))) |
| 39 |
|
pandoc_listof.collect(src['t'], src['c'], 'latex', {}) |
| 40 |
|
|
| 41 |
|
src = json.loads(json.dumps(Span(['exercise:2', [], []], [Str(u'Exercise'), Space(), Str(u'2')]))) |
| 42 |
|
pandoc_listof.collect(src['t'], src['c'], 'latex', {}) |
| 43 |
|
|
| 44 |
|
src = json.loads(json.dumps(Para([Str(u'{exercise}')]))) |
| 45 |
|
dest = json.loads(json.dumps(Para([RawInline( |
| 46 |
|
'tex', |
| 47 |
|
'\\hypersetup{linkcolor=black}\\makeatletter\\@starttoc{exercise}\\makeatother' |
| 48 |
|
)]))) |
| 49 |
|
|
| 50 |
|
assert json.loads(json.dumps(pandoc_listof.listof(src['t'], src['c'], 'latex', {}))) == dest |
| 51 |
|
|
| 52 |
|
def test_toccolor(): |
| 53 |
|
init() |