Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🤖 setup latex support #7

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
Binary file added blog/assets/bloom-cuckoo/math-formul.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions blog/bloom-and-cuckoo-filters-for-cache-summarization.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ Of course, we could store this hash somewhere, but the whole point of using fing
The solution to this predicament is the aforementioned _partial-key cuckoo hashing_, a technique for determining an element's alternate location using only its fingerprint.
For a given element $x$, the two candidate buckets are computed as follows:

$h_1(x) = \text{hash}(x)$<br/>
$h_2(x) = h_1(x) \oplus \text{hash}(\text{fingerprint}(x))$

<!-- TODO: verify setup https://docusaurus.io/docs/markdown-features/math-equations -->
$h_1(x) = \text{hash}(x)$

$h_2(x) = h_1(x) \oplus \text{hash}(\text{fingerprint}(x))$

<!-- ![](./assets/bloom-cuckoo/math-formul.png?202301181528) -->

An important property of this technique is that $h_1(x)$ can also be computed from $h_2(x)$ and the fingerprint.

Expand Down
14 changes: 14 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

// const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const math = require('remark-math');
const katex = require('rehype-katex');

const commonDocsOptions = {
breadcrumbs: false,
Expand Down Expand Up @@ -76,6 +78,8 @@ const config = {
routeBasePath: '/docs',
breadcrumbs: true,
sidebarPath: require.resolve('./sidebars.js'),
remarkPlugins: [math],
rehypePlugins: [katex],
},
blog: {
path: 'blog',
Expand All @@ -97,6 +101,16 @@ const config = {
],
],

stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
crossorigin: 'anonymous',
},
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@
"@docusaurus/preset-classic": "2.1.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"hast-util-is-element": "1.1.0",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react-dom": "^17.0.2",
"rehype-katex": "5",
"remark-math": "3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.1.0",
Expand Down
Loading