首页 > 其他分享 >index

index

时间:2024-04-01 17:45:01浏览次数:18  
标签:index console log World type Hello block

Markdown & MDX

Rspress supports not only Markdown but also MDX, a powerful way to develop content.

Markdown

MDX is a superset of Markdown, which means you can write Markdown files as usual. For example:

# Hello World

Use Component

When you want to use React components in Markdown files, you should name your files with .mdx extension. For example:

// docs/index.mdx
import { CustomComponent } from './custom';

# Hello World

<CustomComponent />

Front Matter

You can add Front Matter at the beginning of your Markdown file, which is a YAML-formatted object that defines some metadata. For example:

---
title: Hello World
---

Note: By default, Rspress uses h1 headings as html headings.

You can also access properties defined in Front Matter in the body, for example:

---
title: Hello World
---

# {frontmatter.title}

The previously defined properties will be passed to the component as frontmatter properties. So the final output will be:

<h1>Hello World</h1>

Custom Container

You can use the ::: syntax to create custom containers and support custom titles. For example:

Input:

:::tip
This is a `block` of type `tip`
:::

:::info
This is a `block` of type `info`
:::

:::warning
This is a `block` of type `warning`
:::

:::danger
This is a `block` of type `danger`
:::

::: details
This is a `block` of type `details`
:::

:::tip Custom Title
This is a `block` of `Custom Title`
:::

:::tip{title="Custom Title"}
This is a `block` of `Custom Title`
:::

Output:

:::tip
This is a block of type tip
:::

:::info
This is a block of type info
:::

:::warning
This is a block of type warning
:::

:::danger
This is a block of type danger
:::

::: details
This is a block of type details
:::

:::tip Custom Title
This is a block of Custom Title
:::

:::tip{title="Custom Title"}
This is a block of Custom Title
:::

Code Block

Basic Usage

You can use the ``` syntax to create code blocks and support custom titles. For example:

Input:

```js
console.log('Hello World');
```

```js title="hello.js"
console.log('Hello World');
```

Output:

console.log('Hello World');
console.log('Hello World');

Show Line Numbers

If you want to display line numbers, you can enable the showLineNumbers option in the config file:

export default {
  // ...
  markdown: {
    showLineNumbers: true,
  },
};

Wrap Code

If you want to wrap long code line by default, you can enable the defaultWrapCode option in the config file:

export default {
  // ...
  markdown: {
    defaultWrapCode: true,
  },
};

Line Highlighting

You can also apply line highlighting and code block title at the same time, for example:

Input:

```js title="hello.js" {1,3-5}
console.log('Hello World');

const a = 1;

console.log(a);

const b = 2;

console.log(b);
```

Ouput:

console.log('Hello World');

const a = 1;

console.log(a);

const b = 2;

console.log(b);

Rustify MDX compiler

You can enable Rustify MDX compiler by following config:

标签:index,console,log,World,type,Hello,block
From: https://www.cnblogs.com/ameng666/p/18109015

相关文章

  • KingbaseES Reindex concurrently过程
    前言KES中我们经常遇到表膨胀情况,然而索引也会膨胀,随着业务DML语句的增长,稍不留神索引就会膨胀的很严重,膨胀后的索引只有VACUUMFULL才会真正释放磁盘空间,对于新构建的索引往往比更新的旧索引提供更好的访问性能。所以,我们需要重建膨胀的索引。REINDEX命令需要ACCESSEXCLUSIVE......
  • KingbaseES Create Index include 介绍
    在数据库性能优化的世界中,索引始终扮演着至关重要的角色。KingbaseES创建索引语法中的INCLUDE关键字为索引创建提供了额外的灵活性,允许在B-Tree索引中包含额外的非键(Non-Key)列。这些列虽然不参与索引的排序或搜索过程,但可用于提高某些查询的效率,尤其是在执行索引覆盖扫描(Index-......
  • 【Bitmap Index】B-Tree索引与Bitmap位图索引的锁代价比较研究
    通过以下实验,来验证Bitmap位图索引较之普通的B-Tree索引锁的“高昂代价”。位图索引会带来“位图段级锁”,实际使用过程一定要充分了解不同索引带来的锁代价情况。1.为比较区别,创建两种索引类型的测试表1)在表t_bitmap上创建位图索引SEC@ora11g>createtablet_bitmap(idnumber(1......
  • 【wpf】ListBoxItemIndexConverter转换器listbox序号自更新
    publicclassListBoxItemIndexConverter:IMultiValueConverter{publicobjectConvert(object[]values,TypetargetType,objectparameter,CultureInfoculture){stringindexPrefix=null;if(parameter!=null&&parameter......
  • npm ERR! path /Users/apple/.npm/_cacache/index-v5/11/77/cf18d9ab54d565b57fb3
    在使用npm时,有时候您可能会遇到类似以下错误的权限问题:npmERR!path/Users/apple/.npm/_cacache/index-v5/11/77/cf18d9ab54d565b57fb3npmERR!codeEACCESnpmERR!errno-13npmERR!syscallopennpmERR!Error:EACCES:permissiondenied,open'/Users/apple/......
  • 【SPIE 出版|EI, Scopus Index】第六届图像、视频处理和人工智能国际会议(IVPAI 2024)
    第六届图像、视频处理和人工智能国际会议(IVPAI2024)日期:2024年7月21-23日地点:马来西亚,吉隆坡官网:www.ivpai.org会议背景:IVPAI在过去的五年(2018-2021&2023)里取得了巨大的成功。累计吸引了超过7000份申请和2000名与会者,展现了其在全球范围内的广泛影响力和学术价值。......
  • TorchV的RAG实践分享(三):解析llama_index的数据存储结构和召回策略过程
    1.前言LlamaIndex是一个基于LLM的数据处理框架,在RAG领域非常流行,简单的几行代码就能实现本地的文件的对话功能,对开发者提供了极致的封装,开箱即用。本文以官方提供的最简单的代理示例为例,分析LlamaIndex在数据解析、向量Embedding、数据存储及召回的整个源码过程。通过学习框架......
  • Pandas操作MultiIndex合并行列的Excel,写入读取以及写入多余行及Index列处理,插入行,修改
    Pandas操作MultiIndex合并行列的excel,写入读取以及写入多余行及Index列处理1.效果图及问题2.源码参考今天是谁写Pandas的复合索引MultiIndex,写的糊糊涂涂,晕晕乎乎。是我呀…记录下,现在终于灵台清明了。明天在记录下直接用openpyxl生成合并单元格,事半功倍。跟......
  • PhpStrom启动报错, java.net.BindException: Address already in use: bind
    问题描述:今天启动phpstromIDE时,突然报错,报错信息如下图:问题分析1.不正确关闭应用(强制关闭):可能是之前启动了一个本地web服务占了端口,在没有停掉服务,直接关闭IDE导致的(尝试了重启电脑也没解决)2.其他应用占用端口:安装了Hyper-V导致端口被占用?显然我的是第一种情况问题解决......
  • vue2 在 main.js 中定义全局函数,在二次封装的 api\index.js 中引用全局函数 GPT4 Tur
    在Vue2中,你可以通过Vue的原型系统来定义全局函数,然后在整个应用的任何组件中使用这些函数。同样,你也可以在其他JavaScript文件中使用这些函数,比如你提到的二次封装的API文件。下面是如何实现这一过程的步骤:###第一步:在`main.js`中定义全局函数在Vue项目的入口文件`main.js`中,你......