|
|
|
@ -68,6 +68,7 @@ def content(_args):
|
|
|
|
|
# uri = _item
|
|
|
|
|
# print ([_menuItem, _menuItem in _menu])
|
|
|
|
|
uri = '/'.join(_item.path.split('/')[2:])
|
|
|
|
|
uri = _item.path
|
|
|
|
|
_menu[_folder].append({'text':_item.name.split('.')[0],'uri':uri})
|
|
|
|
|
#
|
|
|
|
|
# clean up the content ...
|
|
|
|
@ -99,16 +100,16 @@ def html (uri,_config) :
|
|
|
|
|
_prefix = '/'.join (uri.split('/')[:-1])
|
|
|
|
|
|
|
|
|
|
_link = '/'.join(['{{context}}api/cloud/download?doc='+_prefix,'.attachments.'])
|
|
|
|
|
print ([_link])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# _link = '/'.join(['api/cloud/download?doc='+_prefix,'_images'])
|
|
|
|
|
print (uri)
|
|
|
|
|
_html = _handler.get_file_contents(uri).decode('utf-8')#.replace('.attachments.', copy.deepcopy(_link))
|
|
|
|
|
# print ([uri,uri[-2:] ,uri[-2:] in ['md','MD','markdown']])
|
|
|
|
|
_handler.logout()
|
|
|
|
|
# if uri.endswith('.md'):
|
|
|
|
|
|
|
|
|
|
_html = _html.replace(_root,('{{context}}api/cloud/download?doc='+_root)).replace('.attachments.', copy.deepcopy(_link))
|
|
|
|
|
if '.attachments.' in _html :
|
|
|
|
|
print (_html)
|
|
|
|
|
# _html = _html.replace('<br />','')
|
|
|
|
|
return markdown(_html) if uri[-2:] in ['md','MD','Md','mD'] else _html
|
|
|
|
|
# def update (_config):
|
|
|
|
|