Skip to content
Closed
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
18 changes: 13 additions & 5 deletions doc/_extensions/zephyr/kconfig/static/kconfig.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ function showProgress(message) {
* @returns {string} - The generated GitHub URL.
*/
function getGithubLink(path, line, mode = "blob", revision = "main") {
if (!zephyr_gh_base_url) {
return;
}

let url = [
zephyr_gh_base_url,
mode,
Expand Down Expand Up @@ -307,14 +311,18 @@ function renderKconfigEntry(entry) {
renderKconfigPropList(props, 'Choices', entry.choices, false);

/* symbol location with permalink */
const locationPermalink = document.createElement('a');
locationPermalink.href = getGithubLink(entry.filename, entry.linenr, "blob", zephyr_version);

const locationElement = document.createTextNode(`${entry.filename}:${entry.linenr}`);
locationElement.class = "pre";
locationPermalink.appendChild(locationElement);

renderKconfigPropLiteralElement(props, 'Location', locationPermalink);
let locationPermalink = getGithubLink(entry.filename, entry.linenr, "blob", zephyr_version);
if (locationPermalink) {
const locationPermalink = document.createElement('a');
locationPermalink.href = locationPermalink;
locationPermalink.appendChild(locationElement);
renderKconfigPropLiteralElement(props, 'Location', locationPermalink);
} else {
renderKconfigPropLiteralElement(props, 'Location', locationElement);
}

renderKconfigPropLiteral(props, 'Menu path', entry.menupath);

Expand Down