mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-19 12:52:37 +00:00
23 lines
556 B
Python
23 lines
556 B
Python
|
#!/usr/bin/env python
|
||
|
# -*- coding: utf-8 -*-
|
||
|
from __future__ import unicode_literals
|
||
|
|
||
|
import markdown.extensions
|
||
|
import markdown.util
|
||
|
|
||
|
|
||
|
class ClickHousePreprocessor(markdown.util.Processor):
|
||
|
def run(self, lines):
|
||
|
for line in lines:
|
||
|
if '<!--hide-->' not in line:
|
||
|
yield line
|
||
|
|
||
|
class ClickHouseMarkdown(markdown.extensions.Extension):
|
||
|
|
||
|
def extendMarkdown(self, md, md_globals):
|
||
|
md.preprocessors['clickhouse'] = ClickHousePreprocessor()
|
||
|
|
||
|
|
||
|
def makeExtension(**kwargs):
|
||
|
return ClickHouseMarkdown(**kwargs)
|