Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Sep 17, 2024
1 parent 820f5cf commit 82473fa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions lib/iterator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ module.exports = function (callback) {
const meta = yaml.load(
fs.readFileSync(`${__dirname}/../${doc.name}/${metaname}`),
);
const name =
meta.name =
metaname === "meta.yaml" || !meta.dirname ? doc.name : meta.dirname;
callback(doc.name, name, metaname.substring(0, metaname.length - 5), {
...metameta,
...meta,
});
callback(
doc.name,
meta.name,
metaname.substring(0, metaname.length - 5),
{
...metameta,
...meta,
},
);
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Number {
.sort(compareSectionNumbers);
this.meta = meta;
this.meta["pandoc-version"] = pandoc;
builders[meta.dirname || dir.match(/[^\\/]*$/)] = this;
if (meta.name) builders[meta.name] = this;
}

secno(type) {
Expand Down
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const app = express()
var number = new Number(
`${__dirname}/../${req.params.doc}`,
req.query.variant,
{ ...metameta, ...meta },
{ ...metameta, ...meta, name: meta.dirname || req.params.doc },
);
delete req.query.variant;
res.type("html");
Expand Down

0 comments on commit 82473fa

Please sign in to comment.