This commit is contained in:
lovebird 2025-03-16 17:46:57 +01:00
parent 11b91b995a
commit aa2c459861
2 changed files with 5 additions and 30 deletions

View File

@ -13,12 +13,9 @@ import {
LOGGING_NAMESPACE,
OSRL_ENV,
OSRL_PRODUCT_PROFILE,
PRODUCT_ROOT,
I18N_SOURCE_LANGUAGE
PRODUCT_ROOT
} from 'config/config.js'
import { translate } from "@/base/i18n.js"
export const logger = createLogger(LOGGING_NAMESPACE)
export const boot = () => logger.info('Astro is booting up')
export const env = (item_rel: string = ""): IProfile => {
@ -37,24 +34,12 @@ export const render = async (string) => {
const html = `${unescapeHTML(string)}`
return createComponent(() => renderTemplate(html as any, []))
}
/*
export const component = async (str: string = "", locale, data = {}) => {
const content = await translate(
(str || "").trim(),
I18N_SOURCE_LANGUAGE,
locale
)
const markup = ((await renderMarkup(content, data)) as any) || { html: "" }
return await render(markup.html)
}
*/
export const item_defaults = async (itemDir) => {
return await findUp('defaults.json', {
stopAt: PRODUCT_ROOT(),
cwd: itemDir
})
}
export async function markdownToHtml(markdown: string): Promise<string> {
const result = await unified()
.use(remarkParse)
@ -64,11 +49,9 @@ export async function markdownToHtml(markdown: string): Promise<string> {
return result.toString();
}
export const createMarkdownComponent = async (markdown: string) => {
const html = unescapeHTML(await markdownToHtml(markdown));
return createComponent(() => renderTemplate(html as any, []));
}
export const createHTMLComponent = async (html: string) =>
createComponent(() => renderTemplate(unescapeHTML(html) as any, []))

View File

@ -168,11 +168,6 @@
}
.markdown-content {
@apply prose dark:prose-invert max-w-none font-mono;
}
@ -220,13 +215,10 @@
.markdown-content code {
@apply bg-gray-800 text-xs p-1 rounded-md md:text-sm;
}
/* Links */
.markdown-content a {
@apply text-blue-600 hover:underline dark:text-blue-400;
@apply text-blue-600 dark:text-blue-400 no-underline;
}
/* Blockquotes */
.markdown-content blockquote {
@apply border-l-4 border-gray-500 pl-3 italic text-gray-600 md:pl-4;
}
.markdown-content a:hover {
@apply underline;
}