summaryrefslogtreecommitdiff
path: root/library/src/basics
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/basics')
-rw-r--r--library/src/basics/heading.rs35
-rw-r--r--library/src/basics/list.rs10
-rw-r--r--library/src/basics/table.rs5
3 files changed, 50 insertions, 0 deletions
diff --git a/library/src/basics/heading.rs b/library/src/basics/heading.rs
index 2781034e..b7d8c72c 100644
--- a/library/src/basics/heading.rs
+++ b/library/src/basics/heading.rs
@@ -7,9 +7,23 @@ use crate::text::{SpaceNode, TextNode, TextSize};
/// A section heading.
///
+/// # Example
+/// ```
+/// #set heading(numbering: "I.")
+///
+/// = Introduction
+/// In recent years, ...
+/// ```
+///
+/// # Syntax
+/// Headings can be created by starting a line with one or multiple equals
+/// signs. The number of equals signs determines the heading's logical nesting
+/// depth.
+///
/// # Parameters
/// - body: Content (positional, required)
/// The heading's contents.
+///
/// - level: NonZeroUsize (named)
/// The logical nesting depth of the heading, starting from one.
///
@@ -29,10 +43,31 @@ pub struct HeadingNode {
#[node]
impl HeadingNode {
/// How to number the heading.
+ ///
+ /// # Example
+ /// ```
+ /// #set heading(numbering: "1.a.")
+ ///
+ /// = A section
+ /// == A subsection
+ /// === A sub-subsection
+ /// ```
#[property(referenced)]
pub const NUMBERING: Option<NumberingPattern> = None;
/// Whether the heading should appear in the outline.
+ ///
+ /// # Example
+ /// ```
+ /// #outline()
+ ///
+ /// #heading[Normal]
+ /// This is a normal heading.
+ ///
+ /// #heading(outlined: false)[Hidden]
+ /// This heading does not appear
+ /// in the outline.
+ /// ```
pub const OUTLINED: bool = true;
fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> {
diff --git a/library/src/basics/list.rs b/library/src/basics/list.rs
index c9215a50..15b26169 100644
--- a/library/src/basics/list.rs
+++ b/library/src/basics/list.rs
@@ -8,12 +8,22 @@ use crate::text::{SpaceNode, TextNode};
/// # Parameters
/// - items: Content (positional, variadic)
/// The contents of the list items.
+///
/// - start: NonZeroUsize (named)
/// Which number to start the enumeration with.
+///
/// - tight: bool (named)
/// Makes the list more compact, if enabled. This looks better if the items
/// fit into a single line each.
///
+/// # Example
+/// ```
+/// #show columns.with(2)
+/// #list(tight: true)[Tight][List]
+/// #colbreak()
+/// #list(tight: false)[Wide][List]
+/// ```
+///
/// # Tags
/// - basics
#[func]
diff --git a/library/src/basics/table.rs b/library/src/basics/table.rs
index d7e2e08f..05f2ffff 100644
--- a/library/src/basics/table.rs
+++ b/library/src/basics/table.rs
@@ -6,14 +6,19 @@ use crate::prelude::*;
/// # Parameters
/// - cells: Content (positional, variadic)
/// The contents of the table cells.
+///
/// - rows: TrackSizings (named)
/// Defines the row sizes.
+///
/// - columns: TrackSizings (named)
/// Defines the column sizes.
+///
/// - gutter: TrackSizings (named)
/// Defines the gaps between rows & columns.
+///
/// - column-gutter: TrackSizings (named)
/// Defines the gaps between columns. Takes precedence over `gutter`.
+///
/// - row-gutter: TrackSizings (named)
/// Defines the gaps between rows. Takes precedence over `gutter`.
///