
spinal.lib.bus.regif.Doc.Template.scala Maven / Gradle / Ivy
package spinal.lib.bus.regif
import java.{util => ju}
object HtmlTemplate {
object cssThemes {
val Default =
"""
| .theme-default {
| border: 3px solid #000;
| border-collapse: collapse;
| }
| .theme-default td,
| .theme-default th{
| border: 1px solid #000;
| border-top: 1px dashed #555;
| border-bottom: 1px dashed #555;
| padding: 3px;
| }
| .theme-default th{
| background: #bbb;
| }
| .theme-default tbody td.reserved{
| color: #bbb;
| font-weight:200;
| background : #eee;
| /* text-decoration:line-through; */
| text-decoration-color:#888;
| }
| .theme-default tr.blk, .theme-default tr.grp{
| border-top: 2px solid #000;
| }
| .theme-default tr.reg, .theme-default tr.ram, .theme-default tr.fifo{
| border-top: 1px solid #000;
| }
| td.fifo{
| background :
| linear-gradient(to right, #ddd 1px, transparent 1px);
| background-size: 6px 6px;
| }
| td.ram{
| background:
| linear-gradient(to right, #ddd 1px, transparent 1px),
| linear-gradient(to bottom, #ddd 1px, transparent 1px);
| background-size: 6px 6px;
| }
|""".stripMargin
val Spring =
"""
| .theme-spring{
| border-collapse: collapse;
| font-size: 1.0em;
| min-width: 800px;
| border-radius: 5px 5px 0 0 ;
| overflow: hidden;
| box-shadow: 0 -10px 20px rgba(0,0,0,0.15);
| }
| .theme-spring th,
| .theme-spring td {
| padding:5px 10px;
| }
| .theme-spring thead tr {
| background-color: #009879;
| color: #ffffff;
| text-align:center;
| font-weight: bold;
| }
| .theme-spring tbody tr{
| border-bottom: 1px solid #ddd;
| }
| .theme-spring tbody td{
| border: 1px solid #ddd;
| }
| .theme-spring tbody tr:last-of-type{
| border-bottom: 3px solid #009879;
| }
| .theme-spring tbody tr.active-row {
| font-weight: bold;
| color: #009879;
| }
| .theme-spring tbody td.reserved{
| color: #aaa;
| background : #fffff0;
| /* font-style:italic; */
| font-weight:200;
| font-size:1.0em;
| }
| .theme-spring tbody tr.green{
| background :#fffff0 ;
| }
|""".stripMargin
}
val commonCSS =
"""
| body{ font-size: 0.8em; }
| p.regif-title{
| font-weight:800;
| font-size:1.2em;
| }
| td{
| white-space:pre-line; word-wrap: break-word; word-break: break-all;
| }
| td.fixWidth{
| min-width:50px;
| max-width:300px;
| }
| td.fixWidth2{
| min-width:50px;
| max-width:400px;
| }
| footer div p.info{
| font-weight:300;
| font-size:0.7em;
| }
| a {
| color:black;text-decoration:none;
| }
| a:hover {
| color:#09f;
| }
|""".stripMargin
def tableHead(hasBlock: Boolean = true) =
s"""
|
| ${if(hasBlock)"\n ReUseBlock " else ""}
| Group
| AddressOffset
| Type
| RegName
| Description
| Width
| Section
| FieldName
| R/W
| Reset value
| Field-Description
|
|
|""".stripMargin
def getHTML(moduleName: String, tbody: String, hasBlock: Boolean = false): String = s"""
|
|
|
|
|
| ${moduleName}
|
|
|
|
|
| ${moduleName} register interface
|
|
|
|
|${tableHead(hasBlock)}
|
|${tbody}
|
|
|
|
|
|
|""".stripMargin
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy