Skip to content

Commit

Permalink
rename: clarified funtion and option name
Browse files Browse the repository at this point in the history
Signed-off-by: javalsai <jvssxxi@gmail.com>
  • Loading branch information
javalsai committed Jun 5, 2023
1 parent 9dd5b46 commit 42cb96a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ function createPrettyAnchor(elementType, ancestor, name, href) {
</${elementType}>`;
}

function completeAnchorFromItem(item) {
function prefixModuleToItemAnchor(item) {
let { anchor } = item;

let anchorLink = anchor.split('href="')[1].split('"')[0]
let cleanLink = anchorLink.replace(/.html$/, '');
let cleanLink = anchorLink.replace(/\.html$/, '');

let prettyAnchor;

Expand Down Expand Up @@ -629,7 +629,7 @@ function buildSidebar(members) {
nav.sections.push(sections[section]);
} else {
const errorMsg = `While building nav. Section name: ${section} is not recognized.
Accepted sections are: ${defaultSections.join(', ')}
Accepted sections are: ${defaultSections.join(', ')}
`;

throw new Error(errorMsg);
Expand Down Expand Up @@ -698,7 +698,7 @@ exports.publish = function (taffyData, opts, tutorials) {
if(themeOpts.sort !== false ) {
data.sort('longname, version, since');
}

helper.addEventListeners(data);

data().each((doclet) => {
Expand Down Expand Up @@ -895,10 +895,10 @@ exports.publish = function (taffyData, opts, tutorials) {
members.modules
);

if (themeOpts.experimentPrettySidebar) {
if (themeOpts.prefixModuleToSidebarItems_experimental) {
view.sidebar.sections.forEach((section, i) => {
view.sidebar.sections[i].items = section.items.map(item => {
item.anchor = completeAnchorFromItem(item);
item.anchor = prefixModuleToItemAnchor(item);

return item;
});
Expand Down

0 comments on commit 42cb96a

Please sign in to comment.