mirror of
https://github.com/typst/typst
synced 2025-08-25 12:14:13 +08:00
Rewrite an old outline.indent example
This commit is contained in:
parent
5b1e75af88
commit
a712286672
@ -225,25 +225,20 @@ pub struct OutlineElem {
|
|||||||
/// to just specifying `{2em}`.
|
/// to just specifying `{2em}`.
|
||||||
///
|
///
|
||||||
/// ```example
|
/// ```example
|
||||||
/// #set heading(numbering: "1.a.")
|
/// >>> #show heading: none
|
||||||
|
/// #set heading(numbering: "I-I.")
|
||||||
|
/// #set outline(title: none)
|
||||||
///
|
///
|
||||||
/// #outline(
|
/// #outline()
|
||||||
/// title: [Contents (Automatic)],
|
/// #line(length: 100%)
|
||||||
/// indent: auto,
|
/// #outline(indent: 3em)
|
||||||
/// )
|
|
||||||
///
|
///
|
||||||
/// #outline(
|
/// = Software engineering technologies
|
||||||
/// title: [Contents (Length)],
|
/// == Requirements
|
||||||
/// indent: 2em,
|
/// == Tools and technologies
|
||||||
/// )
|
/// == Analyzing alternatives
|
||||||
///
|
/// = Designing software components
|
||||||
/// = About ACME Corp.
|
/// = Testing and integration
|
||||||
/// == History
|
|
||||||
/// === Origins
|
|
||||||
/// #lorem(10)
|
|
||||||
///
|
|
||||||
/// == Products
|
|
||||||
/// #lorem(10)
|
|
||||||
/// ```
|
/// ```
|
||||||
pub indent: Smart<OutlineIndent>,
|
pub indent: Smart<OutlineIndent>,
|
||||||
}
|
}
|
||||||
@ -451,24 +446,8 @@ impl OutlineEntry {
|
|||||||
///
|
///
|
||||||
/// If the outline's indent is a fixed value or a function, the prefixes are
|
/// If the outline's indent is a fixed value or a function, the prefixes are
|
||||||
/// indented, but the inner contents are simply offset from the prefix by
|
/// indented, but the inner contents are simply offset from the prefix by
|
||||||
/// the specified `gap`, rather than aligning outline-wide.
|
/// the specified `gap`, rather than aligning outline-wide. For a visual
|
||||||
///
|
/// explanation, see [`outline.indent`]($outline.indent).
|
||||||
/// ```example
|
|
||||||
/// >>> #show heading: none
|
|
||||||
/// #set heading(numbering: "I-I.")
|
|
||||||
/// #set outline(title: none)
|
|
||||||
///
|
|
||||||
/// #outline()
|
|
||||||
/// #line(length: 100%)
|
|
||||||
/// #outline(indent: 3em)
|
|
||||||
///
|
|
||||||
/// = Software engineering technologies
|
|
||||||
/// == Requirements
|
|
||||||
/// == Tools and technologies
|
|
||||||
/// == Analyzing alternatives
|
|
||||||
/// = Designing software components
|
|
||||||
/// = Testing and integration
|
|
||||||
/// ```
|
|
||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn indented(
|
pub fn indented(
|
||||||
&self,
|
&self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user