From 727f20c4e8c811eafe972859f17f314a363b5c2c Mon Sep 17 00:00:00 2001 From: Christophe Rosset Date: Sat, 26 Oct 2024 11:22:24 +0200 Subject: [PATCH] feat: add visual hint to local anchors --- custom.css | 12 ++++++++++++ src/rolldown/explore-shared.md | 8 ++++---- src/rust/README.md | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/custom.css b/custom.css index aaa7f5d..045c5a7 100644 --- a/custom.css +++ b/custom.css @@ -1,3 +1,15 @@ .sidebar .chapter-item { padding-left: 10px; } +.content main a[href^="."]::after, +.content main a[href^="#"]::after { + content: "⇲"; +} +.content main h1 a[href^="#"]::after, +.content main h2 a[href^="#"]::after, +.content main h3 a[href^="#"]::after, +.content main h4 a[href^="#"]::after, +.content main h5 a[href^="#"]::after, +.content main h6 a[href^="#"]::after { + content: ""; +} diff --git a/src/rolldown/explore-shared.md b/src/rolldown/explore-shared.md index e2cba20..4425292 100644 --- a/src/rolldown/explore-shared.md +++ b/src/rolldown/explore-shared.md @@ -17,7 +17,7 @@ npm run build-binding ### rolldown_common::file_emitter -The [`FileEmitter`](https://github.com/rolldown/rolldown/blob/main/crates/rolldown_common/src/file_emitter.rs) is instanciated and passed as an `Arc` to the [`rolldown_plugin::PluginDriver` (wiki)](#rolldown_pluginplugindriver) +The [`FileEmitter`](https://github.com/rolldown/rolldown/blob/main/crates/rolldown_common/src/file_emitter.rs) is instanciated and passed as an `Arc` to the [`rolldown_plugin::PluginDriver`](#rolldown_pluginplugindriver) ## rolldown_css @@ -51,7 +51,7 @@ For the implementation, see [oxc-project/oxc-resolver](https://github.com/oxc-pr - [`oxc_syntax::keyword::is_reserved_keyword_or_global_object`](https://github.com/oxc-project/oxc/blob/main/crates/oxc_syntax/src/keyword.rs) - [`text_to_esm`](https://github.com/rolldown/rolldown/blob/main/crates/rolldown_loader_utils/src/text_to_esm.rs) - [`binary_to_esm`](https://github.com/rolldown/rolldown/blob/main/crates/rolldown_loader_utils/src/binary_to_esm.rs) - - Based on the platform, it will be `__toBinary` or `__toBinaryNode`, the implementation is in [crates/rolldown/src/runtime](https://github.com/rolldown/rolldown/blob/main/crates/rolldown/src/runtime/index.js) + - Based on the platform, it will be `__toBinary` or `__toBinaryNode`, the implementation is in [`crates/rolldown/src/runtime`](https://github.com/rolldown/rolldown/blob/main/crates/rolldown/src/runtime/index.js) - `import { __toBinary } from ./some-module; export default __toBinary(base64encoded)` 📄 @@ -75,7 +75,7 @@ For the implementation, see [oxc-project/oxc-resolver](https://github.com/oxc-pr - instanciated by the [`BundlerBuilder`](https://github.com/rolldown/rolldown/blob/main/crates/rolldown/src/bundler_builder.rs) - plugins: `Vec` - list of plugins - resolver: `&Arc` - see [`rolldown_resolver`](#rolldown_resolver) - - file_emitter: `SharedFileEmitter` - see [`rolldown_common::file_emitter` (source)](https://github.com/rolldown/rolldown/blob/main/crates/rolldown_common/src/file_emitter.rs) / [`rolldown_common::file_emitter` (wiki)](#rolldown_commonfile_emitter) + - file_emitter: `SharedFileEmitter` - see [`rolldown_common::file_emitter` (source)](https://github.com/rolldown/rolldown/blob/main/crates/rolldown_common/src/file_emitter.rs) / [`rolldown_common::file_emitter`](#rolldown_commonfile_emitter) - options= `SharedNormalizedBundlerOptions = Arc` - watch_files - `PluginDriver::iter_plugin_with_context_by_order(self, [PluginIdx])` is available: it loops over plugins, **making their context available** @@ -115,7 +115,7 @@ This is the plugin in charge of resolving the paths of the imports, which is a v ## rolldown_rstr -Exposes `rolldown_rstr::Rstr` which is a thin wrapper over [`oxc::span::CompactStr`](https://github.com/oxc-project/oxc/blob/main/crates/oxc_span/src/compact_str.rs), which is a wrapper over the [compact_str](https://crates.io/crates/compact_str) crate. +Exposes `rolldown_rstr::Rstr` which is a thin wrapper over [`oxc::span::CompactStr`](https://github.com/oxc-project/oxc/blob/main/crates/oxc_span/src/compact_str.rs), which is a wrapper over the [`compact_str`](https://crates.io/crates/compact_str) crate. > A memory efficient string type that can store up to 24* bytes on the stack. > diff --git a/src/rust/README.md b/src/rust/README.md index fc6cde9..ec078bb 100644 --- a/src/rust/README.md +++ b/src/rust/README.md @@ -6,4 +6,4 @@ Some rust specifics - [`std::sync::LazyLock`](https://doc.rust-lang.org/beta/std/sync/struct.LazyLock.html) - A value which is initialized on the first access. - [`string_wizard::MagicString`](https://docs.rs/string_wizard/0.0.22/string_wizard/struct.MagicString.html) / [`magic-string`](https://github.com/Rich-Harris/magic-string) - performant updates on large strings (like source-maps) -- [compact_str](https://crates.io/crates/compact_str) - check [rolldown_rstr](../rolldown/explore-shared.md#rolldown_rstr) +- [`compact_str`](https://crates.io/crates/compact_str) - check [`rolldown_rstr`](../rolldown/explore-shared.md#rolldown_rstr)