Generates a standard document header block.
Usage:
- <RT-title title="..." author="..." date="..."></RT-title>
+ <RT-title title="..." author="..." date="..." copyright="..."></RT-title>
*/
window.StyleRT = window.StyleRT || {};
const title = el.getAttribute('title') || 'Untitled Document';
const author = el.getAttribute('author');
const date = el.getAttribute('date');
+ const copyright = el.getAttribute('copyright');
if (debug.log) debug.log('title', `Generating title block: ${title}`);
container.appendChild(meta);
}
+ // Copyright Row
+ if (copyright) {
+ const copy_div = document.createElement('div');
+ copy_div.style.color = 'var(--rt-content-muted)';
+ copy_div.style.fontSize = '0.9em';
+ copy_div.style.marginTop = '0.5rem';
+ // Automatically injects the copyright symbol
+ copy_div.innerHTML = `© ${copyright}`;
+ container.appendChild(copy_div);
+ }
+
// Replace the raw tag with the generated block
el.replaceWith(container);
});
padding: 0.125rem 0.25rem;
color: var(--rt-content-main);
}
+
+ rt-article img {
+ max-width: 100%;
+ height: auto;
+ display: block;
+ margin: 1.5rem auto; /* Centers the image */
+ }
+
`;
document.head.appendChild(style_node);
};