summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-22 18:25:29 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-22 18:25:29 +0100
commit8527517258cf62a2f229796cc3f118d8bf0494b6 (patch)
tree7662e90bcb9d610e63f4b1a9f1f12f84cb1f742a
parent947522b71aa6220ce8f006bfab4700d6e3cb04f1 (diff)
Rename `desc` to `terms`
-rw-r--r--library/src/basics/enum.rs4
-rw-r--r--library/src/basics/list.rs4
-rw-r--r--library/src/basics/mod.rs4
-rw-r--r--library/src/basics/terms.rs (renamed from library/src/basics/desc.rs)52
-rw-r--r--library/src/layout/mod.rs18
-rw-r--r--library/src/layout/page.rs50
-rw-r--r--library/src/lib.rs6
-rw-r--r--library/src/meta/link.rs5
-rw-r--r--src/ide/complete.rs10
-rw-r--r--src/ide/highlight.rs10
-rw-r--r--src/model/eval.rs6
-rw-r--r--src/model/library.rs10
-rw-r--r--src/syntax/ast.rs28
-rw-r--r--src/syntax/kind.rs19
-rw-r--r--src/syntax/parsing.rs6
-rw-r--r--tests/ref/basics/enum.pngbin27690 -> 29431 bytes
-rw-r--r--tests/ref/basics/terms.png (renamed from tests/ref/basics/desc.png)bin16887 -> 16887 bytes
-rw-r--r--tests/typ/basics/enum.typ6
-rw-r--r--tests/typ/basics/list.typ2
-rw-r--r--tests/typ/basics/terms.typ (renamed from tests/typ/basics/desc.typ)8
20 files changed, 121 insertions, 127 deletions
diff --git a/library/src/basics/enum.rs b/library/src/basics/enum.rs
index f0ca217a..81a36b61 100644
--- a/library/src/basics/enum.rs
+++ b/library/src/basics/enum.rs
@@ -5,8 +5,8 @@ use crate::layout::{BlockNode, GridNode, ParNode, Spacing, TrackSizing};
use crate::prelude::*;
use crate::text::TextNode;
-/// # Enumeration
-/// An ordered list.
+/// # Numbered List
+/// A numbered list.
///
/// Displays a sequence of items vertically and numbers them consecutively.
///
diff --git a/library/src/basics/list.rs b/library/src/basics/list.rs
index eaba6594..24c7b21c 100644
--- a/library/src/basics/list.rs
+++ b/library/src/basics/list.rs
@@ -2,8 +2,8 @@ use crate::layout::{BlockNode, GridNode, ParNode, Spacing, TrackSizing};
use crate::prelude::*;
use crate::text::TextNode;
-/// # List
-/// An unordered list.
+/// # Bullet List
+/// An bullet list.
///
/// Displays a sequence of items vertically, with each item introduced by a
/// marker.
diff --git a/library/src/basics/mod.rs b/library/src/basics/mod.rs
index 431cb004..7520c42d 100644
--- a/library/src/basics/mod.rs
+++ b/library/src/basics/mod.rs
@@ -1,14 +1,14 @@
//! Common document elements.
-mod desc;
#[path = "enum.rs"]
mod enum_;
mod heading;
mod list;
mod table;
+mod terms;
-pub use self::desc::*;
pub use self::enum_::*;
pub use self::heading::*;
pub use self::list::*;
pub use self::table::*;
+pub use self::terms::*;
diff --git a/library/src/basics/desc.rs b/library/src/basics/terms.rs
index 2c764c59..1570d177 100644
--- a/library/src/basics/desc.rs
+++ b/library/src/basics/terms.rs
@@ -2,7 +2,7 @@ use crate::layout::{BlockNode, GridNode, HNode, ParNode, Spacing, TrackSizing};
use crate::prelude::*;
use crate::text::{SpaceNode, TextNode};
-/// # Description List
+/// # Term List
/// A list of terms and their descriptions.
///
/// Displays a sequence of terms and their descriptions vertically. When the
@@ -11,8 +11,7 @@ use crate::text::{SpaceNode, TextNode};
///
/// ## Syntax
/// This function also has dedicated syntax: Starting a line with a slash,
-/// followed by a term, a colon and a description creates a description list
-/// item.
+/// followed by a term, a colon and a description creates a term list item.
///
/// ## Example
/// ```
@@ -23,10 +22,10 @@ use crate::text::{SpaceNode, TextNode};
///
/// ## Parameters
/// - items: Content (positional, variadic)
-/// The descrition list's children.
+/// The term list's children.
///
-/// When using the description list syntax, adjacents items are automatically
-/// collected into description lists, even through constructs like for loops.
+/// When using the term list syntax, adjacents items are automatically
+/// collected into term lists, even through constructs like for loops.
///
/// ### Example
/// ```
@@ -38,17 +37,17 @@ use crate::text::{SpaceNode, TextNode};
/// ```
///
/// - tight: bool (named)
-/// If this is `{false}`, the items are spaced apart with [description list
-/// spacing](@desc/spacing). If it is `{true}`, they use normal
-/// [leading](@par/leading) instead. This makes the description list more
-/// compact, which can look better if the items are short.
+/// If this is `{false}`, the items are spaced apart with [term list
+/// spacing](@terms/spacing). If it is `{true}`, they use normal
+/// [leading](@par/leading) instead. This makes the term list more compact,
+/// which can look better if the items are short.
///
/// ### Example
/// ```
-/// / Fact: If a description list has
-/// a lot of text, and maybe other
-/// inline content, it should not be
-/// tight anymore.
+/// / Fact: If a term list has a lot
+/// of text, and maybe other inline
+/// content, it should not be tight
+/// anymore.
///
/// / Tip: To make it wide, simply
/// insert a blank line between the
@@ -60,15 +59,15 @@ use crate::text::{SpaceNode, TextNode};
#[func]
#[capable(Layout)]
#[derive(Debug, Hash)]
-pub struct DescNode {
+pub struct TermsNode {
/// If true, the items are separated by leading instead of list spacing.
pub tight: bool,
/// The individual bulleted or numbered items.
- pub items: StyleVec<DescItem>,
+ pub items: StyleVec<TermItem>,
}
#[node]
-impl DescNode {
+impl TermsNode {
/// The indentation of each item's term.
#[property(resolve)]
pub const INDENT: Length = Length::zero();
@@ -77,15 +76,14 @@ impl DescNode {
///
/// # Example
/// ```
- /// #set desc(hanging-indent: 0pt)
- /// / Term: This description list
- /// does not make use of hanging
- /// indents.
+ /// #set terms(hanging-indent: 0pt)
+ /// / Term: This term list does not
+ /// make use of hanging indents.
/// ```
#[property(resolve)]
pub const HANGING_INDENT: Length = Em::new(1.0).into();
- /// The spacing between the items of a wide (non-tight) description list.
+ /// The spacing between the items of a wide (non-tight) term list.
///
/// If set to `{auto}` uses the spacing [below blocks](@block/below).
pub const SPACING: Smart<Spacing> = Smart::Auto;
@@ -109,7 +107,7 @@ impl DescNode {
}
}
-impl Layout for DescNode {
+impl Layout for TermsNode {
fn layout(
&self,
vt: &mut Vt,
@@ -151,16 +149,16 @@ impl Layout for DescNode {
}
}
-/// A description list item.
+/// A term list item.
#[derive(Debug, Clone, Hash)]
-pub struct DescItem {
+pub struct TermItem {
/// The term described by the list item.
pub term: Content,
/// The description of the term.
pub description: Content,
}
-impl DescItem {
+impl TermItem {
/// Encode the item into a value.
fn encode(&self) -> Value {
Value::Array(array![
@@ -171,7 +169,7 @@ impl DescItem {
}
castable! {
- DescItem,
+ TermItem,
array: Array => {
let mut iter = array.into_iter();
let (term, description) = match (iter.next(), iter.next(), iter.next()) {
diff --git a/library/src/layout/mod.rs b/library/src/layout/mod.rs
index bd4b0430..67b53e1b 100644
--- a/library/src/layout/mod.rs
+++ b/library/src/layout/mod.rs
@@ -40,7 +40,7 @@ use typst::model::{
StyleVecBuilder, StyledNode,
};
-use crate::basics::{DescItem, DescNode, EnumNode, ListNode};
+use crate::basics::{EnumNode, ListNode, TermItem, TermsNode};
use crate::meta::DocumentNode;
use crate::prelude::*;
use crate::shared::BehavedBuilder;
@@ -418,7 +418,7 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> {
self.interrupt_par()?;
} else if map.interruption::<ListNode>().is_some()
|| map.interruption::<EnumNode>().is_some()
- || map.interruption::<DescNode>().is_some()
+ || map.interruption::<TermsNode>().is_some()
{
self.interrupt_list()?;
}
@@ -519,7 +519,7 @@ impl<'a> FlowBuilder<'a> {
node.tight
} else if let Some(node) = content.to::<EnumNode>() {
node.tight
- } else if let Some(node) = content.to::<DescNode>() {
+ } else if let Some(node) = content.to::<TermsNode>() {
node.tight
} else {
false
@@ -621,10 +621,10 @@ impl<'a> ListBuilder<'a> {
}),
}
.pack(),
- ListItem::Desc(_) => DescNode {
+ ListItem::Term(_) => TermsNode {
tight: self.tight,
items: items.map(|item| match item {
- ListItem::Desc(item) => item.clone(),
+ ListItem::Term(item) => item.clone(),
_ => panic!("wrong list item"),
}),
}
@@ -648,12 +648,12 @@ impl Default for ListBuilder<'_> {
#[capable]
#[derive(Debug, Clone, Hash)]
pub enum ListItem {
- /// An item of an unordered list.
+ /// An item of a bullet list.
List(Content),
- /// An item of an ordered list.
+ /// An item of a numbered list.
Enum(Option<NonZeroUsize>, Content),
- /// An item of a description list.
- Desc(DescItem),
+ /// An item of a term list.
+ Term(TermItem),
}
#[node]
diff --git a/library/src/layout/page.rs b/library/src/layout/page.rs
index c1ac6118..beedf4c5 100644
--- a/library/src/layout/page.rs
+++ b/library/src/layout/page.rs
@@ -125,17 +125,15 @@ impl PageNode {
/// # Example
/// ```
/// #set page(columns: 2, height: 4.8cm)
- /// Climate change is one of the
- /// most pressing issues of our
- /// time, with the potential to
- /// devastate communities,
- /// ecosystems, and economies
- /// around the world. It's clear
- /// that we need to take urgent
+ /// Climate change is one of the most
+ /// pressing issues of our time, with
+ /// the potential to devastate
+ /// communities, ecosystems, and
+ /// economies around the world. It's
+ /// clear that we need to take urgent
/// action to reduce our carbon
- /// emissions and mitigate the
- /// impacts of a rapidly changing
- /// climate.
+ /// emissions and mitigate the impacts
+ /// of a rapidly changing climate.
/// ```
pub const COLUMNS: NonZeroUsize = NonZeroUsize::new(1).unwrap();
@@ -191,13 +189,13 @@ impl PageNode {
/// ```
/// #set par(justify: true)
/// #set page(
- /// margin: (x: 24pt, y: 32pt),
- /// footer: i => align(horizon + right,
- /// text(8pt, numbering("I", i))
- /// )
+ /// margin: (x: 24pt, y: 32pt),
+ /// footer: i => align(horizon + right,
+ /// text(8pt, numbering("I", i))
/// )
+ /// )
///
- /// #lorem(18)
+ /// #lorem(18)
/// ```
#[property(referenced)]
pub const FOOTER: Marginal = Marginal::None;
@@ -209,14 +207,12 @@ impl PageNode {
///
/// # Example
/// ```
- /// #set page(
- /// background: align(
- /// center + horizon,
- /// rotate(24deg,
- /// text(18pt, fill: rgb("FFCBC4"))[*CONFIDENTIAL*]
- /// )
+ /// #set page(background: align(
+ /// center + horizon,
+ /// rotate(24deg,
+ /// text(18pt, fill: rgb("FFCBC4"))[*CONFIDENTIAL*]
/// ),
- /// )
+ /// ))
///
/// = Typst's secret plans
///
@@ -232,12 +228,10 @@ impl PageNode {
///
/// # Example
/// ```
- /// #set page(
- /// foreground: align(
- /// center + horizon,
- /// text(24pt)[🥸]
- /// ),
- /// )
+ /// #set page(foreground: align(
+ /// center + horizon,
+ /// text(24pt)[🥸],
+ /// ))
///
/// Reviewer 2 has marked our paper
/// "Weak Reject" because they did
diff --git a/library/src/lib.rs b/library/src/lib.rs
index 26727711..a4c6fc30 100644
--- a/library/src/lib.rs
+++ b/library/src/lib.rs
@@ -28,7 +28,7 @@ fn scope() -> Scope {
std.def_func::<basics::HeadingNode>("heading");
std.def_func::<basics::ListNode>("list");
std.def_func::<basics::EnumNode>("enum");
- std.def_func::<basics::DescNode>("desc");
+ std.def_func::<basics::TermsNode>("terms");
std.def_func::<basics::TableNode>("table");
// Text.
@@ -200,8 +200,8 @@ fn items() -> LangItems {
heading: |level, body| basics::HeadingNode { level, title: body }.pack(),
list_item: |body| layout::ListItem::List(body).pack(),
enum_item: |number, body| layout::ListItem::Enum(number, body).pack(),
- desc_item: |term, description| {
- layout::ListItem::Desc(basics::DescItem { term, description }).pack()
+ term_item: |term, description| {
+ layout::ListItem::Term(basics::TermItem { term, description }).pack()
},
math: |children, block| math::MathNode { children, block }.pack(),
math_atom: |atom| math::AtomNode(atom).pack(),
diff --git a/library/src/meta/link.rs b/library/src/meta/link.rs
index 60d57a5f..ebb7a7e9 100644
--- a/library/src/meta/link.rs
+++ b/library/src/meta/link.rs
@@ -13,12 +13,17 @@ use crate::text::TextNode;
/// ```
/// #show link: underline
///
+/// https://example.com \
/// #link("https://example.com") \
/// #link("https://example.com")[
/// See example.com
/// ]
/// ```
///
+/// ## Syntax
+/// This function also has dedicated syntax: Text that starts with `http://` or
+/// `https://` is automatically turned into a link.
+///
/// ## Parameters
/// - dest: Destination (positional, required)
/// The destination the link points to.
diff --git a/src/ide/complete.rs b/src/ide/complete.rs
index 27b81fb2..e069391f 100644
--- a/src/ide/complete.rs
+++ b/src/ide/complete.rs
@@ -712,25 +712,25 @@ impl<'a> CompletionContext<'a> {
self.snippet_completion(
"list item",
"- ${item}",
- "Inserts an item of an unordered list.",
+ "Inserts an item of a bullet list.",
);
self.snippet_completion(
"enumeration item",
"+ ${item}",
- "Inserts an item of an ordered list.",
+ "Inserts an item of a numbered list.",
);
self.snippet_completion(
"enumeration item (numbered)",
"${number}. ${item}",
- "Inserts an explicitly numbered item of an ordered list.",
+ "Inserts an explicitly numbered list item.",
);
self.snippet_completion(
- "description list item",
+ "term list item",
"/ ${term}: ${description}",
- "Inserts an item of a description list.",
+ "Inserts an item of a term list.",
);
self.snippet_completion(
diff --git a/src/ide/highlight.rs b/src/ide/highlight.rs
index ff9b8450..1f52ae95 100644
--- a/src/ide/highlight.rs
+++ b/src/ide/highlight.rs
@@ -23,9 +23,9 @@ pub enum Category {
Ref,
/// A section heading.
Heading,
- /// A marker of a list, enumeration, or description list.
+ /// A marker of a list, enumeration, or term list.
ListMarker,
- /// A term in a description list.
+ /// A term in a term list.
ListTerm,
/// The delimiters of a math formula.
MathDelimiter,
@@ -114,7 +114,7 @@ pub fn highlight(node: &LinkedNode) -> Option<Category> {
_ => Category::Operator,
}),
SyntaxKind::Slash => Some(match node.parent_kind() {
- Some(SyntaxKind::DescItem) => Category::ListMarker,
+ Some(SyntaxKind::TermItem) => Category::ListMarker,
Some(SyntaxKind::Frac) => Category::MathOperator,
_ => Category::Operator,
}),
@@ -159,7 +159,7 @@ pub fn highlight(node: &LinkedNode) -> Option<Category> {
SyntaxKind::From => Some(Category::Keyword),
SyntaxKind::Markup { .. }
- if node.parent_kind() == Some(&SyntaxKind::DescItem)
+ if node.parent_kind() == Some(&SyntaxKind::TermItem)
&& node.next_sibling().as_ref().map(|v| v.kind())
== Some(&SyntaxKind::Colon) =>
{
@@ -183,7 +183,7 @@ pub fn highlight(node: &LinkedNode) -> Option<Category> {
SyntaxKind::ListItem => None,
SyntaxKind::EnumItem => None,
SyntaxKind::EnumNumbering(_) => Some(Category::ListMarker),
- SyntaxKind::DescItem => None,
+ SyntaxKind::TermItem => None,
SyntaxKind::Math => None,
SyntaxKind::Atom(_) => None,
SyntaxKind::Script => None,
diff --git a/src/model/eval.rs b/src/model/eval.rs
index 6ad27d6e..ce1739ed 100644
--- a/src/model/eval.rs
+++ b/src/model/eval.rs
@@ -274,7 +274,7 @@ impl Eval for ast::MarkupNode {
Self::Heading(v) => v.eval(vm)?,
Self::List(v) => v.eval(vm)?,
Self::Enum(v) => v.eval(vm)?,
- Self::Desc(v) => v.eval(vm)?,
+ Self::Term(v) => v.eval(vm)?,
Self::Ref(v) => v.eval(vm)?,
Self::Expr(_) => unimplemented!("handled above"),
}
@@ -393,13 +393,13 @@ impl Eval for ast::EnumItem {
}
}
-impl Eval for ast::DescItem {
+impl Eval for ast::TermItem {
type Output = Content;
fn eval(&self, vm: &mut Vm) -> SourceResult<Self::Output> {
let term = self.term().eval(vm)?;
let description = self.description().eval(vm)?;
- Ok((vm.items.desc_item)(term, description))
+ Ok((vm.items.term_item)(term, description))
}
}
diff --git a/src/model/library.rs b/src/model/library.rs
index 41a5e8d4..c6449e27 100644
--- a/src/model/library.rs
+++ b/src/model/library.rs
@@ -59,12 +59,12 @@ pub struct LangItems {
pub ref_: fn(target: EcoString) -> Content,
/// A section heading: `= Introduction`.
pub heading: fn(level: NonZeroUsize, body: Content) -> Content,
- /// An item in an unordered list: `- ...`.
+ /// An item in a bullet list: `- ...`.
pub list_item: fn(body: Content) -> Content,
- /// An item in an enumeration (ordered list): `+ ...` or `1. ...`.
+ /// An item in an enumeration (numbered list): `+ ...` or `1. ...`.
pub enum_item: fn(number: Option<NonZeroUsize>, body: Content) -> Content,
- /// An item in a description list: `/ Term: Details`.
- pub desc_item: fn(term: Content, description: Content) -> Content,
+ /// An item in a term list: `/ Term: Details`.
+ pub term_item: fn(term: Content, description: Content) -> Content,
/// A mathematical formula: `$x$`, `$ x^2 $`.
pub math: fn(children: Vec<Content>, block: bool) -> Content,
/// An atom in a formula: `x`, `+`, `12`.
@@ -102,7 +102,7 @@ impl Hash for LangItems {
self.heading.hash(state);
self.list_item.hash(state);
self.enum_item.hash(state);
- self.desc_item.hash(state);
+ self.term_item.hash(state);
self.math.hash(state);
self.math_atom.hash(state);
self.math_script.hash(state);
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index 5847e816..d2b19ee3 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -101,12 +101,12 @@ pub enum MarkupNode {
Ref(Ref),
/// A section heading: `= Introduction`.
Heading(Heading),
- /// An item in an unordered list: `- ...`.
+ /// An item in a bullet list: `- ...`.
List(ListItem),
- /// An item in an enumeration (ordered list): `+ ...` or `1. ...`.
+ /// An item in an enumeration (numbered list): `+ ...` or `1. ...`.
Enum(EnumItem),
- /// An item in a description list: `/ Term: Details`.
- Desc(DescItem),
+ /// An item in a term list: `/ Term: Details`.
+ Term(TermItem),
/// An expression.
Expr(Expr),
}
@@ -129,7 +129,7 @@ impl AstNode for MarkupNode {
SyntaxKind::Heading => node.cast().map(Self::Heading),
SyntaxKind::ListItem => node.cast().map(Self::List),
SyntaxKind::EnumItem => node.cast().map(Self::Enum),
- SyntaxKind::DescItem => node.cast().map(Self::Desc),
+ SyntaxKind::TermItem => node.cast().map(Self::Term),
_ => node.cast().map(Self::Expr),
}
}
@@ -151,7 +151,7 @@ impl AstNode for MarkupNode {
Self::Heading(v) => v.as_untyped(),
Self::List(v) => v.as_untyped(),
Self::Enum(v) => v.as_untyped(),
- Self::Desc(v) => v.as_untyped(),
+ Self::Term(v) => v.as_untyped(),
Self::Expr(v) => v.as_untyped(),
}
}
@@ -362,7 +362,7 @@ impl Heading {
}
node! {
- /// An item in an unordered list: `- ...`.
+ /// An item in a bullet list: `- ...`.
ListItem
}
@@ -374,7 +374,7 @@ impl ListItem {
}
node! {
- /// An item in an enumeration (ordered list): `+ ...` or `1. ...`.
+ /// An item in an enumeration (numbered list): `+ ...` or `1. ...`.
EnumItem
}
@@ -394,23 +394,21 @@ impl EnumItem {
}
node! {
- /// An item in a description list: `/ Term: Details`.
- DescItem
+ /// An item in a term list: `/ Term: Details`.
+ TermItem
}
-impl DescItem {
+impl TermItem {
/// The term described by the item.
pub fn term(&self) -> Markup {
- self.0
- .cast_first_child()
- .expect("description list item is missing term")
+ self.0.cast_first_child().expect("term list item is missing term")
}
/// The description of the term.
pub fn description(&self) -> Markup {
self.0
.cast_last_child()
- .expect("description list item is missing description")
+ .expect("term list item is missing description")
}
}
diff --git a/src/syntax/kind.rs b/src/syntax/kind.rs
index 02e972c4..27a8da0f 100644
--- a/src/syntax/kind.rs
+++ b/src/syntax/kind.rs
@@ -39,8 +39,7 @@ pub enum SyntaxKind {
/// A semicolon terminating an expression: `;`.
Semicolon,
/// A colon between name/key and value in a dictionary, argument or
- /// parameter list, or between the term and body of a description list
- /// term: `:`.
+ /// parameter list, or between the term and body of a term list term: `:`.
Colon,
/// The strong text toggle, multiplication operator, and wildcard import
/// symbol: `*`.
@@ -54,8 +53,8 @@ pub enum SyntaxKind {
/// The unary negation, binary subtraction operator, and start of list
/// items: `-`.
Minus,
- /// The division operator, start of description list items, and fraction
- /// operator in a formula: `/`.
+ /// The division operator, start of term list items, and fraction operator
+ /// in a formula: `/`.
Slash,
/// The superscript operator in a formula: `^`.
Hat,
@@ -163,14 +162,14 @@ pub enum SyntaxKind {
Ref(EcoString),
/// A section heading: `= Introduction`.
Heading,
- /// An item in an unordered list: `- ...`.
+ /// An item in a bullet list: `- ...`.
ListItem,
- /// An item in an enumeration (ordered list): `+ ...` or `1. ...`.
+ /// An item in an enumeration (numbered list): `+ ...` or `1. ...`.
EnumItem,
/// An explicit enumeration numbering: `23.`.
EnumNumbering(NonZeroUsize),
- /// An item in a description list: `/ Term: Details`.
- DescItem,
+ /// An item in a term list: `/ Term: Details`.
+ TermItem,
/// A mathematical formula: `$x$`, `$ x^2 $`.
Math,
/// An atom in a formula: `x`, `+`, `12`.
@@ -405,7 +404,7 @@ impl SyntaxKind {
Self::ListItem => "list item",
Self::EnumItem => "enumeration item",
Self::EnumNumbering(_) => "enumeration item numbering",
- Self::DescItem => "description list item",
+ Self::TermItem => "term list item",
Self::Math => "math formula",
Self::Atom(s) => match s.as_str() {
"(" => "opening paren",
@@ -533,7 +532,7 @@ impl Hash for SyntaxKind {
Self::ListItem => {}
Self::EnumItem => {}
Self::EnumNumbering(num) => num.hash(state),
- Self::DescItem => {}
+ Self::TermItem => {}
Self::Math => {}
Self::Atom(c) => c.hash(state),
Self::Script => {}
diff --git a/src/syntax/parsing.rs b/src/syntax/parsing.rs
index d751b6aa..e0405407 100644
--- a/src/syntax/parsing.rs
+++ b/src/syntax/parsing.rs
@@ -247,7 +247,7 @@ fn markup_node(p: &mut Parser, at_start: &mut bool) {
SyntaxKind::Minus => list_item(p, *at_start),
SyntaxKind::Plus | SyntaxKind::EnumNumbering(_) => enum_item(p, *at_start),
SyntaxKind::Slash => {
- desc_item(p, *at_start).ok();
+ term_item(p, *at_start).ok();
}
SyntaxKind::Colon => {
let marker = p.marker();
@@ -341,7 +341,7 @@ fn enum_item(p: &mut Parser, at_start: bool) {
}
}
-fn desc_item(p: &mut Parser, at_start: bool) -> ParseResult {
+fn term_item(p: &mut Parser, at_start: bool) -> ParseResult {
let marker = p.marker();
let text: EcoString = p.peek_src().into();
p.eat();
@@ -351,7 +351,7 @@ fn desc_item(p: &mut Parser, at_start: bool) -> ParseResult {
markup_line(p, |node| matches!(node, SyntaxKind::Colon));
p.expect(SyntaxKind::Colon)?;
markup_indented(p, min_indent);
- marker.end(p, SyntaxKind::DescItem);
+ marker.end(p, SyntaxKind::TermItem);
} else {
marker.convert(p, SyntaxKind::Text(text));
}
diff --git a/tests/ref/basics/enum.png b/tests/ref/basics/enum.png
index 0c9c9487..5ccdb1ad 100644
--- a/tests/ref/basics/enum.png
+++ b/tests/ref/basics/enum.png
Binary files differ
diff --git a/tests/ref/basics/desc.png b/tests/ref/basics/terms.png
index e186ec8c..e186ec8c 100644
--- a/tests/ref/basics/desc.png
+++ b/tests/ref/basics/terms.png
Binary files differ
diff --git a/tests/typ/basics/enum.typ b/tests/typ/basics/enum.typ
index 2bec3e9e..e651ca31 100644
--- a/tests/typ/basics/enum.typ
+++ b/tests/typ/basics/enum.typ
@@ -32,9 +32,9 @@
---
// Mix of different lists
-- List
-+ Enum
-/ Desc: List
+- Bullet List
++ Numbered List
+/ Term: List
---
// Test numbering with closure.
diff --git a/tests/typ/basics/list.typ b/tests/typ/basics/list.typ
index 4a948131..fc3e5ca7 100644
--- a/tests/typ/basics/list.typ
+++ b/tests/typ/basics/list.typ
@@ -1,4 +1,4 @@
-// Test unordered lists.
+// Test bullet lists.
---
-
diff --git a/tests/typ/basics/desc.typ b/tests/typ/basics/terms.typ
index a638098b..ba23f909 100644
--- a/tests/typ/basics/desc.typ
+++ b/tests/typ/basics/terms.typ
@@ -1,4 +1,4 @@
-// Test description lists.
+// Test term list.
---
/
@@ -7,7 +7,7 @@ No: list \
---
// Test with constructor.
-#desc(
+#terms(
([One], [First]),
([Two], [Second]),
)
@@ -32,12 +32,12 @@ No: list \
#set text(8pt)
/ First list: #lorem(4)
-#set desc(hanging-indent: 30pt)
+#set terms(hanging-indent: 30pt)
/ Second list: #lorem(4)
---
// Test grid like show rule.
-#show desc: it => table(
+#show terms: it => table(
columns: 2,
inset: 3pt,
..it.items.map(item => (emph(item(0)), item(1))).flatten(),