Linux worldls-302.fr.planethoster.net 4.18.0-553.8.1.lve.el7h.x86_64 #1 SMP Thu Jul 4 15:19:33 UTC 2024 x86_64
LiteSpeed
Server IP : 10.185.0.203 & Your IP : 216.73.217.14
Domains :
Cant Read [ /etc/named.conf ]
User : gerathty
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python2.7 /
site-packages /
markdown /
extensions /
Delete
Unzip
Name
Size
Permission
Date
Action
__init__.py
1.62
KB
-rw-r--r--
2014-06-07 16:58
__init__.pyc
2.69
KB
-rw-r--r--
2014-06-07 16:58
__init__.pyo
2.69
KB
-rw-r--r--
2014-06-07 16:58
abbr.py
2.89
KB
-rw-r--r--
2014-06-07 16:58
abbr.pyc
4.35
KB
-rw-r--r--
2014-06-07 16:58
abbr.pyo
4.35
KB
-rw-r--r--
2014-06-07 16:58
admonition.py
3.69
KB
-rw-r--r--
2014-06-07 16:58
admonition.pyc
4.28
KB
-rw-r--r--
2014-06-07 16:58
admonition.pyo
4.28
KB
-rw-r--r--
2014-06-07 16:58
attr_list.py
5.99
KB
-rw-r--r--
2014-06-07 16:58
attr_list.pyc
6.14
KB
-rw-r--r--
2014-06-07 16:58
attr_list.pyo
6.14
KB
-rw-r--r--
2014-06-07 16:58
codehilite.py
9.75
KB
-rw-r--r--
2014-06-07 16:58
codehilite.pyc
9.66
KB
-rw-r--r--
2014-06-07 16:58
codehilite.pyo
9.66
KB
-rw-r--r--
2014-06-07 16:58
def_list.py
3.63
KB
-rw-r--r--
2014-06-07 16:58
def_list.pyc
4.29
KB
-rw-r--r--
2014-06-07 16:58
def_list.pyo
4.29
KB
-rw-r--r--
2014-06-07 16:58
extra.py
5.13
KB
-rw-r--r--
2014-06-07 16:58
extra.pyc
5.11
KB
-rw-r--r--
2014-06-07 16:58
extra.pyo
5.11
KB
-rw-r--r--
2014-06-07 16:58
fenced_code.py
5.72
KB
-rw-r--r--
2014-06-07 16:58
fenced_code.pyc
6.32
KB
-rw-r--r--
2014-06-07 16:58
fenced_code.pyo
6.32
KB
-rw-r--r--
2014-06-07 16:58
footnotes.py
10.95
KB
-rw-r--r--
2014-06-07 16:58
footnotes.pyc
11.9
KB
-rw-r--r--
2014-06-07 16:58
footnotes.pyo
11.9
KB
-rw-r--r--
2014-06-07 16:58
headerid.py
6.14
KB
-rw-r--r--
2014-06-07 16:58
headerid.pyc
7.77
KB
-rw-r--r--
2014-06-07 16:58
headerid.pyo
7.77
KB
-rw-r--r--
2014-06-07 16:58
meta.py
2.7
KB
-rw-r--r--
2014-06-07 16:58
meta.pyc
3.35
KB
-rw-r--r--
2014-06-07 16:58
meta.pyo
3.35
KB
-rw-r--r--
2014-06-07 16:58
nl2br.py
868
B
-rw-r--r--
2014-06-07 16:58
nl2br.pyc
1.56
KB
-rw-r--r--
2014-06-07 16:58
nl2br.pyo
1.56
KB
-rw-r--r--
2014-06-07 16:58
sane_lists.py
1.3
KB
-rw-r--r--
2014-06-07 16:58
sane_lists.pyc
2.3
KB
-rw-r--r--
2014-06-07 16:58
sane_lists.pyo
2.3
KB
-rw-r--r--
2014-06-07 16:58
smart_strong.py
1.42
KB
-rw-r--r--
2014-06-07 16:58
smart_strong.pyc
2.11
KB
-rw-r--r--
2014-06-07 16:58
smart_strong.pyo
2.11
KB
-rw-r--r--
2014-06-07 16:58
smarty.py
7.71
KB
-rw-r--r--
2014-06-07 16:58
smarty.pyc
5.26
KB
-rw-r--r--
2014-06-07 16:58
smarty.pyo
5.26
KB
-rw-r--r--
2014-06-07 16:58
tables.py
3.15
KB
-rw-r--r--
2014-06-07 16:58
tables.pyc
3.99
KB
-rw-r--r--
2014-06-07 16:58
tables.pyo
3.99
KB
-rw-r--r--
2014-06-07 16:58
toc.py
9.03
KB
-rw-r--r--
2014-06-07 16:58
toc.pyc
7.49
KB
-rw-r--r--
2014-06-07 16:58
toc.pyo
7.49
KB
-rw-r--r--
2014-06-07 16:58
wikilinks.py
5.2
KB
-rw-r--r--
2014-06-07 16:58
wikilinks.pyc
6.31
KB
-rw-r--r--
2014-06-07 16:58
wikilinks.pyo
6.31
KB
-rw-r--r--
2014-06-07 16:58
Save
Rename
''' WikiLinks Extension for Python-Markdown ====================================== Converts [[WikiLinks]] to relative links. Requires Python-Markdown 2.0+ Basic usage: >>> import markdown >>> text = "Some text with a [[WikiLink]]." >>> html = markdown.markdown(text, ['wikilinks']) >>> print html <p>Some text with a <a class="wikilink" href="/WikiLink/">WikiLink</a>.</p> Whitespace behavior: >>> print markdown.markdown('[[ foo bar_baz ]]', ['wikilinks']) <p><a class="wikilink" href="/foo_bar_baz/">foo bar_baz</a></p> >>> print markdown.markdown('foo [[ ]] bar', ['wikilinks']) <p>foo bar</p> To define custom settings the simple way: >>> print markdown.markdown(text, ... ['wikilinks(base_url=/wiki/,end_url=.html,html_class=foo)'] ... ) <p>Some text with a <a class="foo" href="/wiki/WikiLink.html">WikiLink</a>.</p> Custom settings the complex way: >>> md = markdown.Markdown( ... extensions = ['wikilinks'], ... extension_configs = {'wikilinks': [ ... ('base_url', 'http://example.com/'), ... ('end_url', '.html'), ... ('html_class', '') ]}, ... safe_mode = True) >>> print md.convert(text) <p>Some text with a <a href="http://example.com/WikiLink.html">WikiLink</a>.</p> Use MetaData with mdx_meta.py (Note the blank html_class in MetaData): >>> text = """wiki_base_url: http://example.com/ ... wiki_end_url: .html ... wiki_html_class: ... ... Some text with a [[WikiLink]].""" >>> md = markdown.Markdown(extensions=['meta', 'wikilinks']) >>> print md.convert(text) <p>Some text with a <a href="http://example.com/WikiLink.html">WikiLink</a>.</p> MetaData should not carry over to next document: >>> print md.convert("No [[MetaData]] here.") <p>No <a class="wikilink" href="/MetaData/">MetaData</a> here.</p> Define a custom URL builder: >>> def my_url_builder(label, base, end): ... return '/bar/' >>> md = markdown.Markdown(extensions=['wikilinks'], ... extension_configs={'wikilinks' : [('build_url', my_url_builder)]}) >>> print md.convert('[[foo]]') <p><a class="wikilink" href="/bar/">foo</a></p> From the command line: python markdown.py -x wikilinks(base_url=http://example.com/,end_url=.html,html_class=foo) src.txt By [Waylan Limberg](http://achinghead.com/). License: [BSD](http://www.opensource.org/licenses/bsd-license.php) Dependencies: * [Python 2.3+](http://python.org) * [Markdown 2.0+](http://packages.python.org/Markdown/) ''' from __future__ import absolute_import from __future__ import unicode_literals from . import Extension from ..inlinepatterns import Pattern from ..util import etree import re def build_url(label, base, end): """ Build a url from the label, a base, and an end. """ clean_label = re.sub(r'([ ]+_)|(_[ ]+)|([ ]+)', '_', label) return '%s%s%s'% (base, clean_label, end) class WikiLinkExtension(Extension): def __init__(self, configs): # set extension defaults self.config = { 'base_url' : ['/', 'String to append to beginning or URL.'], 'end_url' : ['/', 'String to append to end of URL.'], 'html_class' : ['wikilink', 'CSS hook. Leave blank for none.'], 'build_url' : [build_url, 'Callable formats URL from label.'], } configs = dict(configs) or {} # Override defaults with user settings for key, value in configs.items(): self.setConfig(key, value) def extendMarkdown(self, md, md_globals): self.md = md # append to end of inline patterns WIKILINK_RE = r'\[\[([\w0-9_ -]+)\]\]' wikilinkPattern = WikiLinks(WIKILINK_RE, self.getConfigs()) wikilinkPattern.md = md md.inlinePatterns.add('wikilink', wikilinkPattern, "<not_strong") class WikiLinks(Pattern): def __init__(self, pattern, config): super(WikiLinks, self).__init__(pattern) self.config = config def handleMatch(self, m): if m.group(2).strip(): base_url, end_url, html_class = self._getMeta() label = m.group(2).strip() url = self.config['build_url'](label, base_url, end_url) a = etree.Element('a') a.text = label a.set('href', url) if html_class: a.set('class', html_class) else: a = '' return a def _getMeta(self): """ Return meta data or config data. """ base_url = self.config['base_url'] end_url = self.config['end_url'] html_class = self.config['html_class'] if hasattr(self.md, 'Meta'): if 'wiki_base_url' in self.md.Meta: base_url = self.md.Meta['wiki_base_url'][0] if 'wiki_end_url' in self.md.Meta: end_url = self.md.Meta['wiki_end_url'][0] if 'wiki_html_class' in self.md.Meta: html_class = self.md.Meta['wiki_html_class'][0] return base_url, end_url, html_class def makeExtension(configs=None) : return WikiLinkExtension(configs=configs)