clean-jsdoc-theme icon indicating copy to clipboard operation
clean-jsdoc-theme copied to clipboard

Document css classes, ids etc for the html generated by.markdown

Open backspaces opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

I need to style the html produced by markdown. This is a documentation request.

Describe the solution you'd like

When markdown is converted to html, I need to style it. For example, if I have `console.log()` in my markdown, I'd like to set it's color via css.

Describe alternatives you've considered

Looking at the generated html and try to figure out how to create css for styling it.

Additional context

As an example, look the first paragraph of https://code.agentscript.org/docs/tutorial-3%20-%20Browser.html#browser's-developer-console It has "It also provides a handy console.log() function". I'd like the back-ticked console.log() to be highlighted.

Thanks for the help!

backspaces avatar Mar 18 '24 17:03 backspaces

All instances of text enclosed in backticks are rendered as <code> blocks. To modify the appearance of these code blocks, you can follow these steps:

"theme_opts": {
    "create_style": ".light .readme p > code { background: red } .dark .readme p > code { background: blue}",
}

Note: This will only update the appearance of code blocks in homepage. Not on other pages.

This code snippet introduces a style definition that alters the background color of all code blocks (indicated by backticks) to red when the theme is light, and blue when the theme is dark. Refer to this link for more details.

Alternatively, you can create a custom CSS file containing the aforementioned CSS rules and include it as described here.

ankitskvmdam avatar Mar 20 '24 13:03 ankitskvmdam

Will this work for both single ticks (inline) and triple ticks (block)? I want to limit it to single, inline ticks. Thanks again!

backspaces avatar Mar 20 '24 22:03 backspaces

It will only update inline code block. To select all triple ticks the code blocks: .light .readme pre code table.

ankitskvmdam avatar Mar 21 '24 09:03 ankitskvmdam

@backspaces is the issue resolved?

ankitskvmdam avatar May 05 '24 11:05 ankitskvmdam

I think so, lets close it and reopen if needed. Thanks!!

backspaces avatar May 05 '24 14:05 backspaces