Commit 134df600 authored by Gabriela Bittencourt's avatar Gabriela Bittencourt
Browse files

Add paragraph to description and related objects

And fix bug: extract related-objects information from index file
parent a4ab1cde
Pipeline #3674 canceled with stage
......@@ -387,8 +387,9 @@ function display_toc() {
header.appendChild(a);
div.appendChild(header);
if (doc.description) {
text_node = document.createTextNode(doc.description);
div.appendChild(text_node);
var p_desc = document.createElement("p");
p_desc.innerHTML = doc.description;
div.appendChild(p_desc);
}
} catch (e) {
// entry doesn't exist, ignore it
......@@ -819,8 +820,7 @@ function display_doc(doc) {
var div = document.createElement("div"),
a = document.createElement("a"),
results_elem = document.getElementById("results"),
header,
text_node;
header;
a.href = "javascript: pdgui.doc_open('" +
pdgui.defunkify_windows_path(path.dirname(doc.id)) + "', '" +
pdgui.defunkify_windows_path(path.basename(doc.id)) + "');"
......@@ -831,12 +831,15 @@ function display_doc(doc) {
header.appendChild(a);
div.appendChild(header);
if (doc.description) {
text_node = document.createTextNode(doc.description);
div.appendChild(text_node);
var p_desc = document.createElement("p");
p_desc.innerHTML = doc.description;
div.appendChild(p_desc);
}
if (doc.related_objects) {
text_node = document.createTextNode("\n Related objects: " + doc.related_objects.toString());
div.appendChild(text_node);
var p_rel_objs = document.createElement("p");
p_rel_objs.innerHTML = "Related objects: ".bold() + doc.related_objects.toString();
p_rel_objs.style.marginTop = "-10px";
div.appendChild(p_rel_objs);
}
results_elem.appendChild(div);
toc_bookmark_update(current_dir);
......@@ -871,7 +874,7 @@ function doc_search() {
title: {boost: 64, expand: true},
keywords: {boost: 8, expand: true},
description: {boost: 2},
related_objects: {boost: 1}
related_objects: {boost: 1, expand: true}
}
});
// Increase priority of pd-l2ork docs over externals docs
......
......@@ -203,9 +203,7 @@ function add_doc_to_index(filename, data) {
"title": title,
"keywords": keywords,
"description": desc,
// "related_objects": rel_objs.found_objects
"related_objects": rel_objs
//"body": big_line,
});
}
......@@ -358,14 +356,14 @@ function make_index() {
var filename = e[0] ? e[0] : null;
var title = e[1] ? e[1] : null;
var keywords = e[2] ? e[2] : null;
var descr = e[3] ? e[3] : null;
var desc = e[3] ? e[3] : null;
var rel_obj = e[4] ? e[4] : null;
index.addDoc({
"id": filename,
"title": title,
"keywords": keywords,
"description": descr//,
// "related_objects": rel_obj
"description": desc,
"related_objects": rel_obj
});
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment