WasabiDoc
WasabiDoc copied to clipboard
Vuepress 2.x version
Updated Vuepress 2.x version. Fixed #1239 #1238 #1211
@yahiheb @MarnixCroes @molnard
Your branch is not up to date with master.
Updated could you check the changes?
Concept ACK, CI is failing, can you fix it?
Concept ACK, CI is failing, can you fix it?
Fixed CL
I suggest to prioritize this PR before anything else in the repo, otherwise, you will get conflicts again and again. @BTCparadigm @MaxHillebrand @yahiheb
@CAnorbo What is the purpose of this PR? Why do we need to upgrade to Vuepress 2?
I get this error when executing
npm start
:TypeError: Cannot destructure property 'themeConfig' of 'ctx' as it is undefined. at module.exports (C:\Users\chihe\OneDrive\Bureau\WasabiDoc\node_modules@vuepress\theme-default\index.js:7:11) at file:///C:/Users/chihe/OneDrive/Bureau/WasabiDoc/docs/.vuepress/config.bundled_1665960827483.mjs:19:10 at ModuleJob.run (node:internal/modules/esm/module_job:193:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:533:24) at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15) at async extractResult (C:\Users\chihe\OneDrive\Bureau\WasabiDoc\node_modules\bundle-require\dist\index.js:263:13) at async loadConfig (C:\Users\chihe\OneDrive\Bureau\WasabiDoc\node_modules@vuepress\core\lib\node\loadConfig.js:30:21) at async App.resolveConfigAndInitialize (C:\Users\chihe\OneDrive\Bureau\WasabiDoc\node_modules@vuepress\core\lib\node\App.js:64:24) at async App.process (C:\Users\chihe\OneDrive\Bureau\WasabiDoc\node_modules@vuepress\core\lib\node\App.js:103:5) at async dev (C:\Users\chihe\OneDrive\Bureau\WasabiDoc\node_modules@vuepress\core\lib\index.js:17:3)
It's fixing 3 issues that I couldn't do on the 1.x version. Check your node version and make sure it's higher than 16.
Check your node version and make sure it's higher than 16.
I updated Node.js to the version 18.12.0 and I still get the same error and I can't run this locally.
Check your node version and make sure it's higher than 16.
I updated Node.js to the version 18.12.0 and I still get the same error and I can't run this locally.
This should work: npm install npm update npm run start
This should work: npm install npm update npm run start
Yes it worked.
I have noticed that you removed :::details
so the FAQs are not longer expandable. Why is that?
@CAnorbo I deleted .idea
folder to leave it out of source control.
This PR also fixes #1342 and #1339 because expandable items were removed https://github.com/zkSNACKs/WasabiDoc/pull/1247#issuecomment-1320968300
On the index page, when I change from dark to light, some of the text is no longer visible.
Expand screenshots
Dark mode view

open-source
non-custodial
and privacy-focused
you can't see now in light-mode.
Light mode view

On the index page, when I change from dark to light, some of the text is no longer visible.
@jesseaam Thanks, that must be fixed as well.
"Edit this page" link is broken.

leads me to here

Also, can we remove the Contributors section?
On the index page, when I change from dark to light, some of the text is no longer visible.
Expand screenshots
fixed.
On the index page, when I change from dark to light, some of the text is no longer visible. Expand screenshots
fixed.
@CAnorbo It is not fixed for me.
Must be fixed:
- Variables like current version and zkSNACKs pubkey are not displayed correctly:
=> Tried to resolve it but no solution yet.
Nice to have:
- Read the embedded videos on the docs and don't redirect to youtube. => This won't work. Spent a lot of hours on this topic before.
- Expand/collapse FAQs items. #1247 (comment) => They were removed by me because of the better readability.
- Change the ugly looking default image of the embedded videos:
=> This problem comes from youtube, we have to set a good image on youtube for this video. It's not a code problem.
On the index page, when I change from dark to light, some of the text is no longer visible. Expand screenshots
fixed.
@CAnorbo It is not fixed for me.
This should fix => https://github.com/zkSNACKs/WasabiDoc/pull/1247/commits/a50a690ee0fae729197d6241c91397c03e1470e8
I still have the same issue as @jesseaam here https://github.com/zkSNACKs/WasabiDoc/pull/1247#issuecomment-1322241717 I cannot see some text in the light mode:
This is fixed.
- Variables like current version and zkSNACKs pubkey are not displayed correctly:
What works for me to fix variable rendering is using extendsMarkdown
:
extendsMarkdown: (md) => {
const render = md.renderer.render;
const variables = {
currentVersion: '2.0.2',
dotnetVersion: '6.0',
zksnacksPublicKeyFingerprint: '6FB3 872B 5D42 292F 5992 0797 8563 4832 8949 861E'
}
md.renderer.render = (...args) => {
// Render markdown.
const html = render.call(md, ...args);
// Replace variables.
let modifiedHtml = Object.keys(variables)
.reduce((result, variable) => result.replaceAll('${'+ variable +'}', variables[variable]), html);
return modifiedHtml;
};
},
Complete config.ts
file:
import resolve from 'path'
import defaultTheme from '@vuepress/theme-default'
import slugify from '@vuepress/shared-utils'
import searchPlugin from '@vuepress/plugin-search'
const themeColor = "#211b24"
export default {
title: "Wasabi Docs",
description: "An archive of knowledge about Wasabi Wallet, an open-source, non-custodial and privacy-focused Bitcoin wallet for desktop.",
extendsMarkdown: (md) => {
const render = md.renderer.render;
const variables = {
currentVersion: '2.0.2',
dotnetVersion: '6.0',
zksnacksPublicKeyFingerprint: '6FB3 872B 5D42 292F 5992 0797 8563 4832 8949 861E'
}
md.renderer.render = (...args) => {
// Render markdown.
const html = render.call(md, ...args);
// Replace variables.
let modifiedHtml = Object.keys(variables)
.reduce((result, variable) => result.replaceAll('${'+ variable +'}', variables[variable]), html);
return modifiedHtml;
};
},
theme: defaultTheme({
logo: "/Logo_without_text_dark.png",
logoDark: "/Logo_without_text.png",
docsRepo: 'https://github.com/zkSNACKs/WasabiDoc',
docsBranch: 'master',
docsDir: 'docs',
editLinks: true,
contributors: false,
//lastUpdated: 'Last Updated',
algolia: {
indexName: 'wasabiwallet',
apiKey: 'c9d9b7688e0f9e6d0ed534655321a424',
// See https://www.algolia.com/doc/api-reference/api-parameters/
algoliaOptions: {
hitsPerPage: 25
},
// See https://community.algolia.com/docsearch/behavior.html#autocompleteoptions
autocompleteOptions: {
openOnFocus: true
}
},
head: [
["link", {
rel: "icon",
href: "/favicon.ico"
}],
["link", {
rel: "apple-touch-icon",
href: "/apple-touch-icon.png",
sizes: "180x180"
}],
["link", {
rel: "manifest",
href: "/site.webmanifest"
}],
["link", {
rel: "mask-icon",
href: "/safari-pinned-tab.svg",
color: themeColor
}],
["link", {
rel: "stylesheet",
href: "https://fonts.googleapis.com/css?family=Inconsolata:400,700|Playfair+Display:700&display=swap"
}],
["meta", {
name: "msapplication-TileColor",
content: themeColor
}],
["meta", {
name: "theme-color",
content: themeColor
}],
],
navbar: [{
text: "Why Wasabi",
link: "/why-wasabi/"
}, {
text: "Using Wasabi",
link: "/using-wasabi/"
}, {
text: "Building Wasabi",
link: "/building-wasabi/"
}, {
text: "FAQ",
link: "/FAQ/"
}, {
text: "Glossary",
link: "/glossary/"
}],
sidebar: {
"/why-wasabi/": [{
text: "Why Privacy",
collapsable: false,
sidebarDepth: 2,
children: [
"/why-wasabi/WhyPrivacyImportant.md",
"/why-wasabi/WhyFinancialPrivacy.md",
"/why-wasabi/LegalConcern.md"
]
}, {
text: "Privacy in Bitcoin",
collapsable: false,
sidebarDepth: 2,
children: [
"/why-wasabi/Coins.md",
"/why-wasabi/AddressReuse.md",
"/why-wasabi/TransactionGraph.md",
"/why-wasabi/NetworkLevelPrivacy.md",
"/why-wasabi/TransactionSurveillanceCompanies.md"
]
}],
"/using-wasabi/": [{
text: "Introducing Wasabi",
collapsable: false,
sidebarDepth: 2,
children: [
"/using-wasabi/ELI5.md"
]
}, {
text: "Installing Wasabi",
collapsable: false,
sidebarDepth: 2,
children: [
"/using-wasabi/InstallPackage.md",
"/using-wasabi/BuildSource.md"
]
}, {
text: "Using Wasabi",
collapsable: false,
sidebarDepth: 2,
children: [
"/using-wasabi/WalletGeneration.md",
"/using-wasabi/WalletLoad.md",
"/using-wasabi/Receive.md",
"/using-wasabi/CoinJoin.md",
"/using-wasabi/Send.md",
"/using-wasabi/ColdWasabi.md",
"/using-wasabi/BitcoinFullNode.md"
]
}, {
text: "Best Practices",
collapsable: false,
sidebarDepth: 2,
children: [
"/using-wasabi/PasswordBestPractices.md",
"/using-wasabi/BackupBestPractices.md",
"/using-wasabi/ChangeCoins.md"
]
}, {
text: "Restoring Wasabi",
collapsable: false,
sidebarDepth: 2,
children: [
"/using-wasabi/WalletRecovery.md",
"/using-wasabi/RestoreElectrum.md",
"/using-wasabi/PasswordFinder.md"
]
}, {
text: "Advanced Installing Wasabi",
collapsable: false,
sidebarDepth: 2,
children: [
"/using-wasabi/DeterministicBuild.md",
"/using-wasabi/WasabiSetupVM.md"
]
}, {
text: "Advanced Using Wasabi",
collapsable: false,
sidebarDepth: 2,
children: [
"/using-wasabi/RPC.md",
"/using-wasabi/PayJoin.md",
"/using-wasabi/Testnet.md",
"/using-wasabi/BIPs.md"
]
}],
"/building-wasabi/": [{
text: "Contributing to Wasabi",
collapsable: false,
sidebarDepth: 2,
children: [
"/building-wasabi/TechnicalOverview.md",
"/building-wasabi/ContributionChecklist.md"
]
}, {
text: "Advanced",
collapsable: false,
sidebarDepth: 2,
children: [
"/building-wasabi/Security.md",
"/building-wasabi/LICENSE.md"
]
}],
"/FAQ/": [{
text: "Frequently Asked Questions",
collapsable: false,
sidebarDepth: 2,
children: [
"/FAQ/FAQ-Introduction.md",
"/FAQ/FAQ-Installation.md",
"/FAQ/FAQ-UseWasabi.md",
"/FAQ/FAQ-GeneralBitcoinPrivacy.md",
"/FAQ/FAQ-Contribution.md"
]
}],
"/glossary/": [{
text: "Glossary",
collapsable: false,
sidebarDepth: 2,
children: [
"/glossary/Glossary-GeneralBitcoin.md",
"/glossary/Glossary-PrivacyWasabi.md"
]
}]
},
// XXX: IMHO NOT PROCESSED AT ALL AS THE DEFAULT BUNDLER CHANGED FROM WEBPACK TO SOME OTHER ONE.
// XXX: So variables.js can be removed.
chainWebpack(config) {
return config.module
.rule('md')
.test(/\.md$/)
.use(resolve(__dirname, './variables'))
.loader(resolve(__dirname, './variables'))
.end()
},
}),
plugins: [
"@vuepress/back-to-top", ["container", {
type: "details",
render(tokens, idx) {
const token = tokens[idx]
// turn details headline into summary
if (token.type === 'container_details_open') {
const next = tokens[idx + 1]
const match = token.info.trim().match(/^details\s+(.*)$/)
let title = match && match[1]
if (next.type === 'heading_open' && !title) {
const headContent = tokens[idx + 2]
const headClose = tokens[idx + 3]
// hide headline and its contents
next.hidden = headClose.hidden = headContent.hidden = true
headContent.children = []
// extract title
title = headContent.content || ''
} else {
title = ''
}
const slug = slugify(title)
return `<details id="${slug}"><summary><a href="#${slug}" aria-hidden="true" class="header-anchor">#</a> <h4>${title}</h4></summary>`
} else if (token.type === 'container_details_close') {
return '</details>'
}
}
}],
searchPlugin({
// getExtraFields: (page) => page.frontmatter.tags,
maxSuggestions: 15,
hotKeys: ['s', '/'],
locales: {
'/': {
placeholder: 'Search...',
}
}
})
]
}
Not saying it's the nicest option how to do it. It works though. 🤷♂️
The videos now open up a new tab in YouTube. They used to be embedded and play within the docs. Is this the new desired behavior?
The old method doesn't work anymore so I changed all the videos, but maybe @kiminuo has a good idea for this also.
I can have a look but I think it may make sense to ask in Discussions first to save some time. If we don't have a response in a few days, we can try ourselves.
Otherwise, everything else looks good on my end. Nice job everybody!
I can have a look but I think it may make sense to ask in Discussions first to save some time. If we don't have a response in a few days, we can try ourselves.
@CAnorbo Do you mind asking about that as @kiminuo suggested?
I can have a look but I think it may make sense to ask in Discussions first to save some time. If we don't have a response in a few days, we can try ourselves.
@CAnorbo Do you mind asking about that as @kiminuo suggested?
@yahiheb could you try this plugin? https://vuepress-theme-hope.github.io/v2/components/ on the Discussion the community recommended this one, but I can't run it for some reason.
I can have a look but I think it may make sense to ask in Discussions first to save some time. If we don't have a response in a few days, we can try ourselves.
@CAnorbo Do you mind asking about that as @kiminuo suggested?
@yahiheb could you try this plugin? https://vuepress-theme-hope.github.io/v2/components/ on the Discussion the community recommended this one, but I can't run it for some reason.
That is not a blocker, we can fix that in a follow up PR.