mirror of
https://github.com/typst/typst
synced 2025-05-19 11:35:27 +08:00
Fix documentation on when raw text is a block. (#1953)
This commit is contained in:
parent
046029b1e2
commit
73999fe823
@ -27,11 +27,19 @@ use crate::prelude::*;
|
|||||||
/// Adding `rbx` to `rcx` gives
|
/// Adding `rbx` to `rcx` gives
|
||||||
/// the desired result.
|
/// the desired result.
|
||||||
///
|
///
|
||||||
|
/// What is ```rust fn main()``` in Rust
|
||||||
|
/// would be ```c int main()``` in C.
|
||||||
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// fn main() {
|
/// fn main() {
|
||||||
/// println!("Hello World!");
|
/// println!("Hello World!");
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// This has ``` `backticks` ``` in it
|
||||||
|
/// (but the spaces are trimmed). And
|
||||||
|
/// ``` here``` the leading space is
|
||||||
|
/// also trimmed.
|
||||||
/// ````
|
/// ````
|
||||||
///
|
///
|
||||||
/// ## Syntax { #syntax }
|
/// ## Syntax { #syntax }
|
||||||
@ -39,8 +47,15 @@ use crate::prelude::*;
|
|||||||
/// backticks (`` ` ``) to make it raw. Two backticks produce empty raw text.
|
/// backticks (`` ` ``) to make it raw. Two backticks produce empty raw text.
|
||||||
/// When you use three or more backticks, you can additionally specify a
|
/// When you use three or more backticks, you can additionally specify a
|
||||||
/// language tag for syntax highlighting directly after the opening backticks.
|
/// language tag for syntax highlighting directly after the opening backticks.
|
||||||
/// Within raw blocks, everything is rendered as is, in particular, there are no
|
/// Within raw blocks, everything (except for the language tag, if applicable)
|
||||||
/// escape sequences.
|
/// is rendered as is, in particular, there are no escape sequences.
|
||||||
|
///
|
||||||
|
/// The language tag is an identifier that directly follows the opening
|
||||||
|
/// backticks only if there are three or more backticks. If your text starts
|
||||||
|
/// with something that looks like an identifier, but no syntax highlighting is
|
||||||
|
/// needed, start the text with a single space (which will be trimmed) or use
|
||||||
|
/// the single backtick syntax. If your text should start or end with a
|
||||||
|
/// backtick, put a space before or after it (it will be trimmed).
|
||||||
///
|
///
|
||||||
/// Display: Raw Text / Code
|
/// Display: Raw Text / Code
|
||||||
/// Category: text
|
/// Category: text
|
||||||
@ -71,8 +86,9 @@ pub struct RawElem {
|
|||||||
|
|
||||||
/// Whether the raw text is displayed as a separate block.
|
/// Whether the raw text is displayed as a separate block.
|
||||||
///
|
///
|
||||||
/// In markup mode, using one-backtick notation makes this `{false}`,
|
/// In markup mode, using one-backtick notation makes this `{false}`.
|
||||||
/// whereas using three-backtick notation makes it `{true}`.
|
/// Using three-backtick notation makes it `{true}` if the enclosed content
|
||||||
|
/// contains at least one line break.
|
||||||
///
|
///
|
||||||
/// ````example
|
/// ````example
|
||||||
/// // Display inline code in a small box
|
/// // Display inline code in a small box
|
||||||
@ -93,6 +109,8 @@ pub struct RawElem {
|
|||||||
/// )
|
/// )
|
||||||
///
|
///
|
||||||
/// With `rg`, you can search through your files quickly.
|
/// With `rg`, you can search through your files quickly.
|
||||||
|
/// This example searches the current directory recursively
|
||||||
|
/// for the text `Hello World`:
|
||||||
///
|
///
|
||||||
/// ```bash
|
/// ```bash
|
||||||
/// rg "Hello World"
|
/// rg "Hello World"
|
||||||
@ -111,6 +129,8 @@ pub struct RawElem {
|
|||||||
/// ```typ
|
/// ```typ
|
||||||
/// This is *Typst!*
|
/// This is *Typst!*
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// This is ```typ also *Typst*```, but inline!
|
||||||
/// ````
|
/// ````
|
||||||
pub lang: Option<EcoString>,
|
pub lang: Option<EcoString>,
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user