bug fixes: links in markdown documents

master
Steve Nyemba 10 months ago
parent b746a0af97
commit 649a0278dd

@ -20,7 +20,8 @@ def _format_root_folder (_root):
_root = _root[1:] _root = _root[1:]
if _root[-1] == '/' : if _root[-1] == '/' :
_root = _root[:-1] _root = _root[:-1]
return _root
return _root.replace('//','/')
def content(_args): def content(_args):
""" """
:url :url
@ -92,13 +93,19 @@ def html (uri,_config) :
_prefix = '/'.join (uri.split('/')[:-1]) _prefix = '/'.join (uri.split('/')[:-1])
_link = '/'.join(['{{context}}api/cloud/download?doc='+_prefix,'.attachments.']) _link = '/'.join(['{{context}}api/cloud/download?doc='+_prefix,'.attachments.'])
print ([_link])
# _link = '/'.join(['api/cloud/download?doc='+_prefix,'_images']) # _link = '/'.join(['api/cloud/download?doc='+_prefix,'_images'])
_html = _handler.get_file_contents(uri).decode('utf-8').replace('.attachments.',_link) _html = _handler.get_file_contents(uri).decode('utf-8')#.replace('.attachments.', copy.deepcopy(_link))
# print ([uri,uri[-2:] ,uri[-2:] in ['md','MD','markdown']]) # print ([uri,uri[-2:] ,uri[-2:] in ['md','MD','markdown']])
_handler.logout() _handler.logout()
# if uri.endswith('.md'): # if uri.endswith('.md'):
# _html = _html.replace(_root,('{{context}}api/cloud/download?doc='+_root))
_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 return markdown(_html) if uri[-2:] in ['md','MD','Md','mD'] else _html
# def update (_config): # def update (_config):
# """ # """

@ -81,6 +81,7 @@ def _dialog ():
_system = copy.deepcopy(_config['system']) _system = copy.deepcopy(_config['system'])
_html = cms.components.html(_uri,_id,_config,_system) _html = cms.components.html(_uri,_id,_config,_system)
e = Environment(loader=BaseLoader()).from_string(_html) e = Environment(loader=BaseLoader()).from_string(_html)
if 'source' in _system : if 'source' in _system :
del _system['source'] del _system['source']

@ -14,86 +14,9 @@ body {
font-size:16px; font-size:16px;
font-family: sans-serif; font-family: sans-serif;
font-weight:lighter; font-weight:lighter;
}
.main{
margin-left:10%;
margin-right:10%;
display:grid;
grid-template-rows:120px 48px auto 48px;
grid-template-columns: 70% auto;
gap:8px;
min-height:98vh;
}
.bold {font-weight:bold}
.menu {
padding:8px;
border:1px solid #CAD5E0 ;
display:grid;
grid-column: 1 / span 2;
grid-template-columns: 92px repeat(7,auto);
gap:4px;
text-transform: capitalize;
align-items: center;
}
.menu .item {
font-weight:bold;
cursor:pointer;
padding:4px;
text-align: left;
}
.menu .sub-menu {
display:none;
position:absolute;
margin-top:2px;
min-width:10%;
z-index:90;
padding:8px;
font-weight:lighter;
text-align:left;
align-items:left;
background-color: rgba(255,255,255,0.8);
}
.menu .item:hover .sub-menu{
display:block;
height:auto;
}
.header {
display:grid;
grid-column: 1 / span 2;
grid-template-columns: 128px auto;
gap:4px;
align-items:center ;
align-content: center;
text-transform: capitalize;
/* background-color: rgba(255,255,255,0.8); */
} }
.header .title { .bold {font-weight:bold}
display:grid;
align-content: center;
font-size:24px;
font-weight:bold;
}
.header img { width:100%;} .header img { width:100%;}
@ -113,42 +36,8 @@ body {
grid-column: 1 /span 2; grid-column: 1 /span 2;
} }
.main .content {
padding:8px;
/* box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.25); */
/* transition: all 0.2s; */
}
.main .content img {width:78%}
.index {
height:100%;
padding:4px;
display:grid;
align-items: center;
grid-template-rows: 80% auto;
align-content: center;
text-align: center;
}
.large-text {font-size: 24px; font-weight: bold;} .large-text {font-size: 24px; font-weight: bold;}
.index .background {
border:2px solid transparent;
padding:2px;
/* Add the blur effect */
filter: blur(1.5px);
-webkit-filter: blur(1.5px);
}
.pane {
padding:8px;
border-left:1px solid #CAD5E0;
/* background-color: rgba(255,255,255,0.8); */
}
.active { .active {
padding:4px; padding:4px;
cursor:pointer; cursor:pointer;
@ -190,210 +79,3 @@ body {
grid-template-columns: auto 115px; grid-template-columns: auto 115px;
gap:4px; gap:4px;
} }
/*
* components: people
*/
.people .current, .alumni {
display:grid;
grid-template-columns: repeat(3,1fr);
overflow:hidden;
gap:30px;
}
/* .people .alumni {
display:grid;
grid-template-columns: repeat(3,1fr);
gap:10px;
} */
.people .person {
box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.25);
/* background: radial-gradient(#1fe4f5, #3fbafe); */
display:grid;
min-height:150px;
grid-template-columns: 120px auto ;
gap:2px;
align-items:center;
overflow:hidden;
}
.people .person .name{
font-size:22px; text-transform:capitalize; font-weight:normal;
width:200px; overflow:hidden;
text-transform:capitalize;
-o-text-overflow:ellipsis;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
}
.person .position {
width:200px; overflow:hidden;
text-transform:capitalize;
-o-text-overflow:ellipsis;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
}
.person .picture {
width:120px;
height:120px;
overflow:hidden;
display:grid;
align-content:center ;
align-items:center;
justify-content: center;
justify-items: center;
}
.person .picture .frame { width:100px; height:100px; overflow:hidden;}
.person .picture img {
width:120px;
height:120px;
display:block; margin:auto;
}
/**
* components: search
*/
.search .frame .suggestion-frame {
width:98%;
overflow: hidden;
overflow-y: auto;
word-wrap: normal;
margin-top:2px;
border-right:1px solid #CAD5E0;
}
.search .frame .suggestion-frame .suggestions {
display:none;
position:absolute;
width:55%;
height:55%;
z-index:9;
overflow:hidden;
overflow-y: auto;
padding:4px;;
}
.search .frame .input-frame{
display:grid;
grid-template-columns: auto 32px 48px ;
gap:4px;
align-items: center;
align-content:center;
padding:4px;
background-color: rgba(255,255,255,0.8);
}
.search .frame .input-frame i {color:#000000}
.search .frame .input-frame .found { font-size:11px; color:maroon; text-align: center;}
.search .frame input[type="text"] {
padding:8px;
font-size:14px;
font-weight:normal;
border:2px solid transparent;
outline: 0px;
background-color:#D3D3D3;
}
.search .frame .suggestions .item {
display:grid;
grid-template-columns: 60px auto ;
height:60px;
gap:4px;
padding:8px;
align-items:center;
}
.search .frame .suggestions .item .title { width:85%; overflow:hidden; font-size:14px; font-weight: normal; text-transform:capitalize; text-overflow: ellipsis; white-space: nowrap;}
.search .frame .suggestions .item .author {width:80%; overflow:hidden; font-size:14px; font-weight: lighter;text-transform: capitalize;text-overflow: ellipsis; white-space: nowrap;}
.search .frame .suggestions .item .picture{
height:50px;
display:grid;
grid-template-columns: auto;
padding:4px;
}
.search .frame .suggestions .item .link {
display:grid;
grid-template-columns: auto 120px;
font-size:12px;
align-items:center;
align-content: center;
overflow:hidden;
}
.frame .suggestions .item .picture .frame {background-size: cover;}
.resume {
display:grid;
grid-template-columns: 200px auto;
gap:4px;
text-transform: capitalize;
height:90vh;
}
.resume .article {
margin:4px;
background-color:rgba(255,255,255,0.8);
padding:4px;
color:#000000;
display:grid;
grid-template-columns:5% 86% 8%;
grid-gap:4px;
align-items:center;
}
.small {font-size:12px;}
.resume .picture {display:grid; height:300px; align-items:center; align-content: center; overflow:hidden}
.resume .picture div {height:200px; background-position: center;background-position-y: .5px; background-size: cover; background-repeat: no-repeat;}
.resume .name {font-weight:bold; font-size:22px;}
.resume .position {word-wrap: break-word; margin-top:4px;}
.card {box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.25);}
.resume .article .title {overflow:hidden; font-weight:bold;; text-overflow: ellipsis; white-space: nowrap; }
.resume .article .citation {font-family:courier;}
.resume .publications {height:75%; overflow:hidden; overflow-y:auto; }
.class {
display:grid;
grid-template-columns: auto repeat(3,1fr);
gap:1px;
background-color: rgba(255,255,255,0.8);
padding:4px;
color:black; font-size:18px;
}
.class .description {
font-size:22px;
font-weight:bold;
display:grid;
padding:8px;
align-items:center;
align-content: center;
justify-items: center;
}
.news {
background-color: rgba(255, 255, 255, 0.25);
height:99%;
padding:9px;
overflow:hidden;
overflow-y: auto;
}

@ -72,7 +72,7 @@ menu.apply_link =function(_args){
// jx.modal.show(_html) // jx.modal.show(_html)
var http = HttpClient.instance() var http = HttpClient.instance()
http.setHeader('uri',_args.uri) http.setHeader('uri',_args.uri)
http.setHeader('dom','dialog') http.setHeader('dom',(_args.title)?_args.title:'dialog')
// http.setHeader('dom',_args.text) // http.setHeader('dom',_args.text)
http.get('/dialog',function(x){ http.get('/dialog',function(x){

@ -4,5 +4,5 @@
{% endif %} {% endif %}
<div> <div>
<div class="title">{{layout.header.title}}</div> <div class="title">{{layout.header.title}}</div>
<div>{{layout.header.subtitle}}</div> <div class="subtitle">{{layout.header.subtitle}}</div>
</div> </div>

@ -21,13 +21,16 @@ Vanderbilt University Medical Center
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="x12,parser,healthcare,tools,informatics,research,phd,post-doc,api,python, jamia,amia,pnas,nature"> <meta name="keywords" content="quick cms, cms, python, flask, qcms">
<meta name="robots" content="/, follow, max-snippet:-1, max-image-preview:large"> <meta name="robots" content="/, follow, max-snippet:-1, max-image-preview:large">
<link href="{{system.context}}/static/css/default.css" rel="stylesheet" type="text/css"> <link href="{{system.context}}/static/css/default.css" rel="stylesheet" type="text/css">
<link href="{{system.context}}/static/css/menu.css" rel="stylesheet" type="text/css">
<link href="{{system.context}}/static/css/border.css" rel="stylesheet" type="text/css">
<!-- <link href="{{system.context}}/static/css/animation/_ocean.css" rel="stylesheet" type="text/css"> --> <!-- <link href="{{system.context}}/static/css/animation/_ocean.css" rel="stylesheet" type="text/css"> -->
<link href="{{system.context}}/static/css/themes/{{system.theme}}" rel="stylesheet" type="text/css"> <link href="{{system.context}}/static/css/themes/{{system.theme}}" rel="stylesheet" type="text/css">
<link href="{{system.context}}/static/css/icons.css" rel="stylesheet" type="text/css"> <link href="{{system.context}}/static/css/icons.css" rel="stylesheet" type="text/css">
<link href="{{system.context}}/static/css/border.css" rel="stylesheet" type="text/css">
<script src="{{system.context}}/static/js/jx/dom.js"></script> <script src="{{system.context}}/static/js/jx/dom.js"></script>
<script src="{{system.context}}/static/js/jx/utils.js"></script> <script src="{{system.context}}/static/js/jx/utils.js"></script>
<script src="{{system.context}}/static/js/jx/rpc.js"></script> <script src="{{system.context}}/static/js/jx/rpc.js"></script>

@ -3,4 +3,4 @@
Hard code whatever you want here Hard code whatever you want here
@TODO: Perhaps have code to add things here onload @TODO: Perhaps have code to add things here onload
--> -->
<iframe src="/api/cloud/download?doc=/www/data-transport/quick-start.md"></iframe>

Loading…
Cancel
Save