Skip to content

Commit

Permalink
refactor: update the UI of html template for render
Browse files Browse the repository at this point in the history
  • Loading branch information
Kremilly committed Jun 6, 2024
1 parent 4881b47 commit d9c53ca
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ img {
.markdown-body {
margin: auto;
width: 900px;
margin-top: 80px;
margin-top: 60px;
box-sizing: border-box;
padding: var(--spacing-md);
background: var(--color-bg);
box-shadow: var(--box-shadow);
background: var(--color-pre-bg );
border-radius: var(--border-radius);
border: .1em solid var(--color-border);
}
Expand Down
9 changes: 9 additions & 0 deletions static/js/autoload.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ const Elements = ( e => {
scrollToDocsBtn: 'scrollToDocsBtn',
bibTextMaskModal: 'bibTextMaskModal',

classNames: {
modal: 'modal',
refsList: 'refs-list',
markdownBody: 'markdown-body',
contentModal: 'modal-content',
pluginSection: 'plugin-section',
docsSourceList: 'docs-source-list',
},

pageTitle: () => { return pageTitle(); },
};

Expand Down
2 changes: 1 addition & 1 deletion static/js/citations.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Citations = ( e => {
let ul = document.createElement('ul');
refsList.appendChild(ul);

document.body.appendChild(refsList);
document.querySelector(`.${Elements.classNames.markdownBody}`).appendChild(refsList);
}
};

Expand Down
2 changes: 1 addition & 1 deletion static/js/docs-sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const DocsSources = ( e => {
paragraph.appendChild(textLabel);
pdfLinksList.appendChild(paragraph);

document.body.appendChild(pdfLinksList);
document.querySelector(`.${Elements.classNames.markdownBody}`).appendChild(pdfLinksList);
};

let checkDocsUrlExt = url => {
Expand Down
8 changes: 6 additions & 2 deletions static/templates/render.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- NOT MODIFIED THIS -->
{{ inject_css }}
</head>
<body class='markdown-body'>
<body>
<div class='modal-mask' id='bibTextMaskModal'></div>

<header>
Expand All @@ -27,7 +27,11 @@
</div>
</div>

{{ markdown_content }}
<div class="markdown-body">
{{ markdown_content }}


</div>

<!-- NOT MODIFIED THIS -->
{{ inject_js }}
Expand Down

0 comments on commit d9c53ca

Please sign in to comment.