Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'pandocfilters' in functional components in Python. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.
def test_numbering_prefix_single():
init()
src = Para(createListStr(u'Exercise #ex:'))
dest = Para([
Span(
[u'ex:1', ['pandoc-numbering-text', 'ex'], []],
[Strong(createListStr(u'Exercise 1'))]
)
])
assert pandoc_numbering.numbering(src['t'], src['c'], '', {}) == dest
src = Para(createListStr(u'Exercise #'))
dest = Para([
Span(
[u'exercise:1', ['pandoc-numbering-text', 'exercise'], []],
[Strong(createListStr(u'Exercise 1'))]
)
])
def test_numbering_sectioning_map_error():
init()
meta = getMeta3()
sectioning(meta)
src = Para(createListStr(u'Exercise #'))
dest = Para([
Span(
[u'exercise:1', ['pandoc-numbering-text', 'exercise'], []],
[Strong(createListStr(u'Exercise 1'))]
)
])
assert pandoc_numbering.numbering(src['t'], src['c'], '', meta) == dest
def test_numbering_sectioning_map():
init()
meta = getMeta2()
sectioning(meta)
src = Para([Str(u'Exercise'), Space(), Str(u'#')])
dest = Para([
Span(
[u'exercise:2.2.1', ['pandoc-numbering-text', 'exercise'], []],
[Strong(createListStr(u'Exercise 2.1'))]
)
])
assert pandoc_numbering.numbering(src['t'], src['c'], '', meta) == dest
def test_numbering_prefix_single():
init()
src = Para(createListStr(u'Exercise #ex:'))
dest = Para([
Span(
[u'ex:1', ['pandoc-numbering-text', 'ex'], []],
[Strong(createListStr(u'Exercise 1'))]
)
])
assert pandoc_numbering.numbering(src['t'], src['c'], '', {}) == dest
src = Para(createListStr(u'Exercise #'))
dest = Para([
Span(
[u'exercise:1', ['pandoc-numbering-text', 'exercise'], []],
[Strong(createListStr(u'Exercise 1'))]
)
])
def test_numbering_latex():
init()
src = Para(createListStr(u'Exercise #'))
dest = Para([
RawInline(u'tex', u'\\phantomsection\\addcontentsline{exercise}{exercise}{\\protect\\numberline {1}{\\ignorespaces Exercise}}'),
Span(
[u'exercise:1', ['pandoc-numbering-text', 'exercise'], []],
[RawInline('tex', '\\label{exercise:1}'), Strong(createListStr(u'Exercise 1'))]
)
])
assert pandoc_numbering.numbering(src['t'], src['c'], 'latex', {}) == dest
init()
src = Para(createListStr(u'Exercise (The title) #'))
dest = Para([
RawInline(u'tex', u'\\phantomsection\\addcontentsline{exercise}{exercise}{\\protect\\numberline {1}{\\ignorespaces The title}}'),
Span(
[u'exercise:1', ['pandoc-numbering-text', 'exercise'], []],
[
RawInline('tex', '\\label{exercise:1}'),
Strong(createListStr(u'Exercise 1')),
Space(),
def test_numbering_latex():
init()
src = Para(createListStr(u'Exercise #'))
dest = Para([
RawInline(u'tex', u'\\phantomsection\\addcontentsline{exercise}{exercise}{\\protect\\numberline {1}{\\ignorespaces Exercise}}'),
Span(
[u'exercise:1', ['pandoc-numbering-text', 'exercise'], []],
[RawInline('tex', '\\label{exercise:1}'), Strong(createListStr(u'Exercise 1'))]
)
])
assert pandoc_numbering.numbering(src['t'], src['c'], 'latex', {}) == dest
init()
src = Para(createListStr(u'Exercise (The title) #'))
dest = Para([
RawInline(u'tex', u'\\phantomsection\\addcontentsline{exercise}{exercise}{\\protect\\numberline {1}{\\ignorespaces The title}}'),
Span(
[u'exercise:1', ['pandoc-numbering-text', 'exercise'], []],
[
def listing_latex(meta, color, tab, space):
init()
src = Para(createListStr(u'Exercise #'))
pandoc_numbering.numbering(src['t'], src['c'], 'latex', meta)
src = Para(createListStr(u'Exercise (test) #'))
pandoc_numbering.numbering(src['t'], src['c'], 'latex', meta)
doc = [[{'unMeta': meta}], []]
pandoc_numbering.addListings(doc, 'latex', meta)
dest = [
Header(1, ['', ['unnumbered'], []], createListStr(u'Listings of exercises')),
RawBlock(
'tex',
''.join([
'\\hypersetup{linkcolor=' + color + '}',
'\\makeatletter',
'\\newcommand*\\l@exercise{\\@dottedtocline{1}{' + tab + 'em}{' + space + 'em}}',
'\\@starttoc{exercise}',
'\\makeatother'
])
)
]
assert json.loads(json.dumps(doc[1])) == json.loads(json.dumps(dest))
def test_numbering_title():
init()
src = Para(createListStr(u'Exercise (The title) #'))
dest = Para([
Span(
[u'exercise:1', ['pandoc-numbering-text', 'exercise'], []],
[
Strong(createListStr(u'Exercise 1')),
Space(),
Emph(createListStr(u'(') + createListStr(u'The title') + createListStr(u')'))
]
)
])
assert pandoc_numbering.numbering(src['t'], src['c'], '', {}) == dest
def test_numbering_prefix_single():
init()
src = Para(createListStr(u'Exercise #ex:'))
dest = Para([
Span(
[u'ex:1', ['pandoc-numbering-text', 'ex'], []],
[Strong(createListStr(u'Exercise 1'))]
)
])
assert pandoc_numbering.numbering(src['t'], src['c'], '', {}) == dest
src = Para(createListStr(u'Exercise #'))
dest = Para([
Span(
[u'exercise:1', ['pandoc-numbering-text', 'exercise'], []],
[Strong(createListStr(u'Exercise 1'))]
)
])
assert pandoc_numbering.numbering(src['t'], src['c'], '', {}) == dest
def test_numbering():
init()
src = Para(createListStr(u'Exercise #'))
dest = Para([
Span(
[u'exercise:1', ['pandoc-numbering-text', 'exercise'], []],
[Strong(createListStr(u'Exercise 1'))]
)
])
assert pandoc_numbering.numbering(src['t'], src['c'], '', {}) == dest