Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/colibri/documenter/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,11 @@ export const html_style_preview = `
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
<title>TerosHDL</title>
<title>`;



export const html_style_preview_second_part = `</title>
<style>
body {
box-sizing: border-box;
Expand Down Expand Up @@ -2197,7 +2201,11 @@ export const html_style_save = `
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
<title>TerosHDL</title>
<title>`;



export const html_style_save_second_part = `</title>
<style>
body {
box-sizing: border-box;
Expand Down
40 changes: 27 additions & 13 deletions src/colibri/documenter/documenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,30 @@ export class Documenter extends section_creator.Creator {
async get_document(code: string, lang: LANGUAGE, configuration: t_documenter_options,
save: boolean, input_path: string, output_svg_dir: string, extra_top_space: boolean,
output_type: common_documenter.doc_output_type): Promise<result_type> {

let code_fix = "";
// const svg_dir_path = path_lib.dirname(output_svg_dir);
// const filename_svg = path_lib.basename(input_path, path_lib.extname(input_path));

// Fix multiline code in HTML:
if (output_type === common_documenter.doc_output_type.HTML) {
if(lang === LANGUAGE.VHDL){
if (lang === LANGUAGE.VHDL) {
const vhdl_symbol = configuration.vhdl_symbol;
code_fix = code.replace(/```[^]*```/g, function(match){
return match.replace(/\n/g, '\n--' + vhdl_symbol +' \n');});
}
else if(lang === LANGUAGE.VERILOG || lang === LANGUAGE.SYSTEMVERILOG){
code_fix = code.replace(/```[^]*```/g, function (match) {
return match.replace(/\n/g, '\n--' + vhdl_symbol + ' \n');
});
}
else if (lang === LANGUAGE.VERILOG || lang === LANGUAGE.SYSTEMVERILOG) {
const verilog_symbol = configuration.verilog_symbol;
code_fix = code.replace(/```[^]*```/g, function(match){
return match.replace(/\n/g, '\n//' + verilog_symbol +' \n');});
code_fix = code.replace(/```[^]*```/g, function (match) {
return match.replace(/\n/g, '\n//' + verilog_symbol + ' \n');
});
}
else
{
else {
code_fix = code;
}

}else{
} else {
code_fix = code;
}

Expand All @@ -120,19 +121,32 @@ export class Documenter extends section_creator.Creator {
return result;
}

// Get the entity name
const name_entity = hdl_element.name;

////////////////////////////////////////////////////////////////////////
// HTML preparation
////////////////////////////////////////////////////////////////////////
let html_style = '';
if (save) {
html_style = `<div id="teroshdl" class='templateTerosHDL'>\n`;
html_style = css_const_style.html_style_save + html_style;
// Inser the entity name inside the title tag
html_style =
css_const_style.html_style_save +
name_entity + // entity name
css_const_style.html_style_save_second_part +
html_style;
}
else {
// eslint-disable-next-line max-len
html_style = `<div id="teroshdl" class='templateTerosHDL' style="overflow-y:auto;height:100%;width:100%">\n`;
html_style = '';
html_style = css_const_style.html_style_preview + html_style;
// Inser the entity name inside the title tag
html_style =
css_const_style.html_style_preview +
name_entity + // entity name
css_const_style.html_style_preview_second_part +
html_style;
}
let html = html_style;
if (extra_top_space) {
Expand Down