After spending 7 hours to publish the code while going through a 71 page PDF.
The 71 pages were reduced to 43 pages in the `clean-html.js` step. And in the next step of `create-question.js` it was expanded to 63 pages.
Most of the time I was in the cleaning phase, since this is where one can remove pages and add questions quickly without the need of either copy-pasting the wording directly to #anki or manually typing it out.
One thing that has been holding me back is not having a #LuaSnip in #NeoVim to generate snippets quickly.
The most fun I had was dealing with a a pre-existing reference as in
```
const page = { foo: 0, bar: 0};
const pageList = [];
if (someNumber > 4) {
for (let ii = 0; ii < someNumber; ii++ ) {
page.foo = ii * ii;
page.bar = ii + ii;
pageList.push(page);
}
return;
}
pageList.push(page);
```
When console logging within the for-loop everything worked as expected, but if one saved the `JSON.stringify(pageList)` then each item that was created in the for-loop equated to the last item created.
The solution is to create a `structureClone(page)` within the for-loop and reference it over `page`.
@barefootstache maybe do some #markdown.-> #LaTeX -> #GhostScript pipeline like @fuchsiii built herself?
As neat as #jquery or #cheerio is, I miss the abilities of #VanillaJavaScript in the browser.
I don't remember how many times I tried to grab certain properties, which would have been available in the browser, but don't exist in cheerio.
And it is a bit annoying to constantly put various html elements into the cheerio wrapper class to get access to the various functionalities it offers. Thus instead grabbed the minimal viable data and just worked further with arrays.
#javascript