mirror of
https://github.com/typst/typst
synced 2025-08-11 21:57:55 +08:00
Compare commits
No commits in common. "c417b17442501d4146a897468fe296067696cefe" and "56d8188c61de95e4fb6b8e77a175e72e20dba99e" have entirely different histories.
c417b17442
...
56d8188c61
@ -398,17 +398,7 @@ fn field_access_completions(
|
|||||||
value: &Value,
|
value: &Value,
|
||||||
styles: &Option<Styles>,
|
styles: &Option<Styles>,
|
||||||
) {
|
) {
|
||||||
let scopes = {
|
for (name, binding) in value.ty().scope().iter() {
|
||||||
let ty = value.ty().scope();
|
|
||||||
let elem = match value {
|
|
||||||
Value::Content(content) => Some(content.elem().scope()),
|
|
||||||
_ => None,
|
|
||||||
};
|
|
||||||
elem.into_iter().chain(Some(ty))
|
|
||||||
};
|
|
||||||
|
|
||||||
// Autocomplete methods from the element's or type's scope.
|
|
||||||
for (name, binding) in scopes.flat_map(|scope| scope.iter()) {
|
|
||||||
ctx.call_completion(name.clone(), binding.read());
|
ctx.call_completion(name.clone(), binding.read());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1757,15 +1747,4 @@ mod tests {
|
|||||||
.must_include(["this", "that"])
|
.must_include(["this", "that"])
|
||||||
.must_exclude(["*", "figure"]);
|
.must_exclude(["*", "figure"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_autocomplete_type_methods() {
|
|
||||||
test("#\"hello\".", -1).must_include(["len", "contains"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_autocomplete_content_methods() {
|
|
||||||
test("#show outline.entry: it => it.\n#outline()\n= Hi", 30)
|
|
||||||
.must_include(["indented", "body", "page"]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1281,7 +1281,7 @@ impl ControlPoints {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Helper to draw arcs with Bézier curves.
|
/// Helper to draw arcs with bezier curves.
|
||||||
trait CurveExt {
|
trait CurveExt {
|
||||||
fn arc(&mut self, start: Point, center: Point, end: Point);
|
fn arc(&mut self, start: Point, center: Point, end: Point);
|
||||||
fn arc_move(&mut self, start: Point, center: Point, end: Point);
|
fn arc_move(&mut self, start: Point, center: Point, end: Point);
|
||||||
@ -1305,7 +1305,7 @@ impl CurveExt for Curve {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the control points for a Bézier curve that approximates a circular arc for
|
/// Get the control points for a bezier curve that approximates a circular arc for
|
||||||
/// a start point, an end point and a center of the circle whose arc connects
|
/// a start point, an end point and a center of the circle whose arc connects
|
||||||
/// the two.
|
/// the two.
|
||||||
fn bezier_arc_control(start: Point, center: Point, end: Point) -> [Point; 2] {
|
fn bezier_arc_control(start: Point, center: Point, end: Point) -> [Point; 2] {
|
||||||
|
@ -148,7 +148,9 @@ use crate::loading::{DataSource, Load};
|
|||||||
#[func(scope)]
|
#[func(scope)]
|
||||||
pub fn plugin(
|
pub fn plugin(
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A [path]($syntax/#paths) to a WebAssembly file or raw WebAssembly bytes.
|
/// A path to a WebAssembly file or raw WebAssembly bytes.
|
||||||
|
///
|
||||||
|
/// For more details about paths, see the [Paths section]($syntax/#paths).
|
||||||
source: Spanned<DataSource>,
|
source: Spanned<DataSource>,
|
||||||
) -> SourceResult<Module> {
|
) -> SourceResult<Module> {
|
||||||
let data = source.load(engine.world)?;
|
let data = source.load(engine.world)?;
|
||||||
|
@ -20,7 +20,9 @@ use crate::loading::{DataSource, Load};
|
|||||||
#[func(scope, title = "CBOR")]
|
#[func(scope, title = "CBOR")]
|
||||||
pub fn cbor(
|
pub fn cbor(
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A [path]($syntax/#paths) to a CBOR file or raw CBOR bytes.
|
/// A path to a CBOR file or raw CBOR bytes.
|
||||||
|
///
|
||||||
|
/// For more details about paths, see the [Paths section]($syntax/#paths).
|
||||||
source: Spanned<DataSource>,
|
source: Spanned<DataSource>,
|
||||||
) -> SourceResult<Value> {
|
) -> SourceResult<Value> {
|
||||||
let data = source.load(engine.world)?;
|
let data = source.load(engine.world)?;
|
||||||
|
@ -26,7 +26,9 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
#[func(scope, title = "CSV")]
|
#[func(scope, title = "CSV")]
|
||||||
pub fn csv(
|
pub fn csv(
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A [path]($syntax/#paths) to a CSV file or raw CSV bytes.
|
/// Path to a CSV file or raw CSV bytes.
|
||||||
|
///
|
||||||
|
/// For more details about paths, see the [Paths section]($syntax/#paths).
|
||||||
source: Spanned<DataSource>,
|
source: Spanned<DataSource>,
|
||||||
/// The delimiter that separates columns in the CSV file.
|
/// The delimiter that separates columns in the CSV file.
|
||||||
/// Must be a single ASCII character.
|
/// Must be a single ASCII character.
|
||||||
|
@ -51,7 +51,9 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
#[func(scope, title = "JSON")]
|
#[func(scope, title = "JSON")]
|
||||||
pub fn json(
|
pub fn json(
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A [path]($syntax/#paths) to a JSON file or raw JSON bytes.
|
/// Path to a JSON file or raw JSON bytes.
|
||||||
|
///
|
||||||
|
/// For more details about paths, see the [Paths section]($syntax/#paths).
|
||||||
source: Spanned<DataSource>,
|
source: Spanned<DataSource>,
|
||||||
) -> SourceResult<Value> {
|
) -> SourceResult<Value> {
|
||||||
let data = source.load(engine.world)?;
|
let data = source.load(engine.world)?;
|
||||||
|
@ -29,7 +29,9 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
#[func(scope, title = "TOML")]
|
#[func(scope, title = "TOML")]
|
||||||
pub fn toml(
|
pub fn toml(
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A [path]($syntax/#paths) to a TOML file or raw TOML bytes.
|
/// A path to a TOML file or raw TOML bytes.
|
||||||
|
///
|
||||||
|
/// For more details about paths, see the [Paths section]($syntax/#paths).
|
||||||
source: Spanned<DataSource>,
|
source: Spanned<DataSource>,
|
||||||
) -> SourceResult<Value> {
|
) -> SourceResult<Value> {
|
||||||
let data = source.load(engine.world)?;
|
let data = source.load(engine.world)?;
|
||||||
|
@ -58,7 +58,9 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
#[func(scope, title = "XML")]
|
#[func(scope, title = "XML")]
|
||||||
pub fn xml(
|
pub fn xml(
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A [path]($syntax/#paths) to an XML file or raw XML bytes.
|
/// A path to an XML file or raw XML bytes.
|
||||||
|
///
|
||||||
|
/// For more details about paths, see the [Paths section]($syntax/#paths).
|
||||||
source: Spanned<DataSource>,
|
source: Spanned<DataSource>,
|
||||||
) -> SourceResult<Value> {
|
) -> SourceResult<Value> {
|
||||||
let data = source.load(engine.world)?;
|
let data = source.load(engine.world)?;
|
||||||
|
@ -41,7 +41,9 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
#[func(scope, title = "YAML")]
|
#[func(scope, title = "YAML")]
|
||||||
pub fn yaml(
|
pub fn yaml(
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A [path]($syntax/#paths) to a YAML file or raw YAML bytes.
|
/// A path to a YAML file or raw YAML bytes.
|
||||||
|
///
|
||||||
|
/// For more details about paths, see the [Paths section]($syntax/#paths).
|
||||||
source: Spanned<DataSource>,
|
source: Spanned<DataSource>,
|
||||||
) -> SourceResult<Value> {
|
) -> SourceResult<Value> {
|
||||||
let data = source.load(engine.world)?;
|
let data = source.load(engine.world)?;
|
||||||
|
@ -623,7 +623,7 @@ impl OutlineEntry {
|
|||||||
|
|
||||||
/// The content which is displayed in place of the referred element at its
|
/// The content which is displayed in place of the referred element at its
|
||||||
/// entry in the outline. For a heading, this is its
|
/// entry in the outline. For a heading, this is its
|
||||||
/// [`body`]($heading.body); for a figure a caption and for equations, it is
|
/// [`body`]($heading.body), for a figure a caption, and for equations it is
|
||||||
/// empty.
|
/// empty.
|
||||||
#[func]
|
#[func]
|
||||||
pub fn body(&self) -> StrResult<Content> {
|
pub fn body(&self) -> StrResult<Content> {
|
||||||
|
@ -32,10 +32,12 @@ use crate::World;
|
|||||||
/// embedded file conforms to PDF/A-1 or PDF/A-2.
|
/// embedded file conforms to PDF/A-1 or PDF/A-2.
|
||||||
#[elem(Show, Locatable)]
|
#[elem(Show, Locatable)]
|
||||||
pub struct EmbedElem {
|
pub struct EmbedElem {
|
||||||
/// The [path]($syntax/#paths) of the file to be embedded.
|
/// Path of the file to be embedded.
|
||||||
///
|
///
|
||||||
/// Must always be specified, but is only read from if no data is provided
|
/// Must always be specified, but is only read from if no data is provided
|
||||||
/// in the following argument.
|
/// in the following argument.
|
||||||
|
///
|
||||||
|
/// For more details about paths, see the [Paths section]($syntax/#paths).
|
||||||
#[required]
|
#[required]
|
||||||
#[parse(
|
#[parse(
|
||||||
let Spanned { v: path, span } =
|
let Spanned { v: path, span } =
|
||||||
|
@ -10,12 +10,12 @@ use crate::foundations::{
|
|||||||
use crate::layout::{Abs, Axes, BlockElem, Length, Point, Rel, Size};
|
use crate::layout::{Abs, Axes, BlockElem, Length, Point, Rel, Size};
|
||||||
use crate::visualize::{FillRule, Paint, Stroke};
|
use crate::visualize::{FillRule, Paint, Stroke};
|
||||||
|
|
||||||
/// A curve consisting of movements, lines, and Bézier segments.
|
/// A curve consisting of movements, lines, and Beziér segments.
|
||||||
///
|
///
|
||||||
/// At any point in time, there is a conceptual pen or cursor.
|
/// At any point in time, there is a conceptual pen or cursor.
|
||||||
/// - Move elements move the cursor without drawing.
|
/// - Move elements move the cursor without drawing.
|
||||||
/// - Line/Quadratic/Cubic elements draw a segment from the cursor to a new
|
/// - Line/Quadratic/Cubic elements draw a segment from the cursor to a new
|
||||||
/// position, potentially with control point for a Bézier curve.
|
/// position, potentially with control point for a Beziér curve.
|
||||||
/// - Close elements draw a straight or smooth line back to the start of the
|
/// - Close elements draw a straight or smooth line back to the start of the
|
||||||
/// curve or the latest preceding move segment.
|
/// curve or the latest preceding move segment.
|
||||||
///
|
///
|
||||||
@ -26,7 +26,7 @@ use crate::visualize::{FillRule, Paint, Stroke};
|
|||||||
/// or relative to the current pen/cursor position, that is, the position where
|
/// or relative to the current pen/cursor position, that is, the position where
|
||||||
/// the previous segment ended.
|
/// the previous segment ended.
|
||||||
///
|
///
|
||||||
/// Bézier curve control points can be skipped by passing `{none}` or
|
/// Beziér curve control points can be skipped by passing `{none}` or
|
||||||
/// automatically mirrored from the preceding segment by passing `{auto}`.
|
/// automatically mirrored from the preceding segment by passing `{auto}`.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
@ -88,7 +88,7 @@ pub struct CurveElem {
|
|||||||
#[fold]
|
#[fold]
|
||||||
pub stroke: Smart<Option<Stroke>>,
|
pub stroke: Smart<Option<Stroke>>,
|
||||||
|
|
||||||
/// The components of the curve, in the form of moves, line and Bézier
|
/// The components of the curve, in the form of moves, line and Beziér
|
||||||
/// segment, and closes.
|
/// segment, and closes.
|
||||||
#[variadic]
|
#[variadic]
|
||||||
pub components: Vec<CurveComponent>,
|
pub components: Vec<CurveComponent>,
|
||||||
@ -225,7 +225,7 @@ pub struct CurveLine {
|
|||||||
pub relative: bool,
|
pub relative: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a quadratic Bézier curve segment from the last point to `end`, using
|
/// Adds a quadratic Beziér curve segment from the last point to `end`, using
|
||||||
/// `control` as the control point.
|
/// `control` as the control point.
|
||||||
///
|
///
|
||||||
/// ```example
|
/// ```example
|
||||||
@ -245,9 +245,9 @@ pub struct CurveLine {
|
|||||||
/// ```
|
/// ```
|
||||||
#[elem(name = "quad", title = "Curve Quadratic Segment")]
|
#[elem(name = "quad", title = "Curve Quadratic Segment")]
|
||||||
pub struct CurveQuad {
|
pub struct CurveQuad {
|
||||||
/// The control point of the quadratic Bézier curve.
|
/// The control point of the quadratic Beziér curve.
|
||||||
///
|
///
|
||||||
/// - If `{auto}` and this segment follows another quadratic Bézier curve,
|
/// - If `{auto}` and this segment follows another quadratic Beziér curve,
|
||||||
/// the previous control point will be mirrored.
|
/// the previous control point will be mirrored.
|
||||||
/// - If `{none}`, the control point defaults to `end`, and the curve will
|
/// - If `{none}`, the control point defaults to `end`, and the curve will
|
||||||
/// be a straight line.
|
/// be a straight line.
|
||||||
@ -272,7 +272,7 @@ pub struct CurveQuad {
|
|||||||
pub relative: bool,
|
pub relative: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a cubic Bézier curve segment from the last point to `end`, using
|
/// Adds a cubic Beziér curve segment from the last point to `end`, using
|
||||||
/// `control-start` and `control-end` as the control points.
|
/// `control-start` and `control-end` as the control points.
|
||||||
///
|
///
|
||||||
/// ```example
|
/// ```example
|
||||||
@ -388,7 +388,7 @@ pub enum CloseMode {
|
|||||||
Straight,
|
Straight,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A curve consisting of movements, lines, and Bézier segments.
|
/// A curve consisting of movements, lines, and Beziér segments.
|
||||||
#[derive(Debug, Default, Clone, Eq, PartialEq, Hash)]
|
#[derive(Debug, Default, Clone, Eq, PartialEq, Hash)]
|
||||||
pub struct Curve(pub Vec<CurveItem>);
|
pub struct Curve(pub Vec<CurveItem>);
|
||||||
|
|
||||||
|
@ -46,11 +46,10 @@ use crate::text::LocalName;
|
|||||||
/// ```
|
/// ```
|
||||||
#[elem(scope, Show, LocalName, Figurable)]
|
#[elem(scope, Show, LocalName, Figurable)]
|
||||||
pub struct ImageElem {
|
pub struct ImageElem {
|
||||||
/// A [path]($syntax/#paths) to an image file or raw bytes making up an
|
/// A path to an image file or raw bytes making up an image in one of the
|
||||||
/// image in one of the supported [formats]($image.format).
|
/// supported [formats]($image.format).
|
||||||
///
|
///
|
||||||
/// Bytes can be used to specify raw pixel data in a row-major,
|
/// For more details about paths, see the [Paths section]($syntax/#paths).
|
||||||
/// left-to-right, top-to-bottom format.
|
|
||||||
///
|
///
|
||||||
/// ```example
|
/// ```example
|
||||||
/// #let original = read("diagram.svg")
|
/// #let original = read("diagram.svg")
|
||||||
|
@ -8,7 +8,7 @@ use crate::foundations::{
|
|||||||
use crate::layout::{Axes, BlockElem, Length, Rel};
|
use crate::layout::{Axes, BlockElem, Length, Rel};
|
||||||
use crate::visualize::{FillRule, Paint, Stroke};
|
use crate::visualize::{FillRule, Paint, Stroke};
|
||||||
|
|
||||||
/// A path through a list of points, connected by Bézier curves.
|
/// A path through a list of points, connected by Bezier curves.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```example
|
/// ```example
|
||||||
@ -59,8 +59,8 @@ pub struct PathElem {
|
|||||||
#[fold]
|
#[fold]
|
||||||
pub stroke: Smart<Option<Stroke>>,
|
pub stroke: Smart<Option<Stroke>>,
|
||||||
|
|
||||||
/// Whether to close this path with one last Bézier curve. This curve will
|
/// Whether to close this path with one last bezier curve. This curve will
|
||||||
/// take into account the adjacent control points. If you want to close
|
/// takes into account the adjacent control points. If you want to close
|
||||||
/// with a straight line, simply add one last point that's the same as the
|
/// with a straight line, simply add one last point that's the same as the
|
||||||
/// start point.
|
/// start point.
|
||||||
#[default(false)]
|
#[default(false)]
|
||||||
|
@ -412,7 +412,7 @@ pub enum Geometry {
|
|||||||
Line(Point),
|
Line(Point),
|
||||||
/// A rectangle with its origin in the topleft corner.
|
/// A rectangle with its origin in the topleft corner.
|
||||||
Rect(Size),
|
Rect(Size),
|
||||||
/// A curve consisting of movements, lines, and Bézier segments.
|
/// A curve consisting of movements, lines, and Bezier segments.
|
||||||
Curve(Curve),
|
Curve(Curve),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ description: Changes slated to appear in Typst 0.13.0
|
|||||||
- The `image` function now supports raw [pixel raster formats]($image.format)
|
- The `image` function now supports raw [pixel raster formats]($image.format)
|
||||||
for generating images from within Typst
|
for generating images from within Typst
|
||||||
- Functions that accept [file paths]($syntax/#paths) now also accept raw
|
- Functions that accept [file paths]($syntax/#paths) now also accept raw
|
||||||
[bytes], for full flexibility
|
[bytes] instead, for full flexibility
|
||||||
- WebAssembly [plugins]($plugin) are more flexible and automatically run
|
- WebAssembly [plugins]($plugin) are more flexible and automatically run
|
||||||
multi-threaded
|
multi-threaded
|
||||||
- Fixed a long-standing bug where single-letter strings in math (`[$"a"$]`)
|
- Fixed a long-standing bug where single-letter strings in math (`[$"a"$]`)
|
||||||
@ -155,7 +155,7 @@ description: Changes slated to appear in Typst 0.13.0
|
|||||||
- Fixed multi-line annotations (e.g. overbrace) changing the math baseline
|
- Fixed multi-line annotations (e.g. overbrace) changing the math baseline
|
||||||
- Fixed merging of attachments when the base is a nested equation
|
- Fixed merging of attachments when the base is a nested equation
|
||||||
- Fixed resolving of contextual (em-based) text sizes within math
|
- Fixed resolving of contextual (em-based) text sizes within math
|
||||||
- Fixed spacing around up tacks (⊥)
|
- Fixed spacing around ⊥
|
||||||
|
|
||||||
## Bibliography
|
## Bibliography
|
||||||
- Prose and author-only citations now use editor names if the author names are
|
- Prose and author-only citations now use editor names if the author names are
|
||||||
@ -229,7 +229,7 @@ description: Changes slated to appear in Typst 0.13.0
|
|||||||
- A shebang `#!` at the very start of a file is now ignored
|
- A shebang `#!` at the very start of a file is now ignored
|
||||||
|
|
||||||
## PDF export
|
## PDF export
|
||||||
- Added [`pdf.embed`] function for embedding arbitrary files in the exported PDF
|
- Added `pdf.embed` function for embedding arbitrary files in the exported PDF
|
||||||
- Added support for PDF/A-3b export
|
- Added support for PDF/A-3b export
|
||||||
- The PDF timestamp will now contain the timezone by default
|
- The PDF timestamp will now contain the timezone by default
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ the PNG you exported, you will notice a loss of quality. Typst calculates the
|
|||||||
resolution of your PNGs based on each page's physical dimensions and the PPI. If
|
resolution of your PNGs based on each page's physical dimensions and the PPI. If
|
||||||
you need guidance for choosing a PPI value, consider the following:
|
you need guidance for choosing a PPI value, consider the following:
|
||||||
|
|
||||||
- A value of 300 or 600 is typical for desktop printing.
|
- A DPI value of 300 or 600 is typical for desktop printing.
|
||||||
- Professional prints of detailed graphics can go up to 1200 PPI.
|
- Professional prints of detailed graphics can go up to 1200 PPI.
|
||||||
- If your document is only viewed at a distance, e.g. a poster, you may choose a
|
- If your document is only viewed at a distance, e.g. a poster, you may choose a
|
||||||
smaller value than 300.
|
smaller value than 300.
|
||||||
|
@ -550,6 +550,8 @@ fn func_outline(model: &FuncModel, id_base: &str) -> Vec<OutlineItem> {
|
|||||||
.collect(),
|
.collect(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
outline.extend(scope_outline(&model.scope));
|
||||||
} else {
|
} else {
|
||||||
outline.extend(model.params.iter().map(|param| OutlineItem {
|
outline.extend(model.params.iter().map(|param| OutlineItem {
|
||||||
id: eco_format!("{id_base}-{}", urlify(param.name)),
|
id: eco_format!("{id_base}-{}", urlify(param.name)),
|
||||||
@ -558,30 +560,27 @@ fn func_outline(model: &FuncModel, id_base: &str) -> Vec<OutlineItem> {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
outline.extend(scope_outline(&model.scope, id_base));
|
|
||||||
|
|
||||||
outline
|
outline
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Produce an outline for a function scope.
|
/// Produce an outline for a function scope.
|
||||||
fn scope_outline(scope: &[FuncModel], id_base: &str) -> Option<OutlineItem> {
|
fn scope_outline(scope: &[FuncModel]) -> Option<OutlineItem> {
|
||||||
if scope.is_empty() {
|
if scope.is_empty() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let dash = if id_base.is_empty() { "" } else { "-" };
|
Some(OutlineItem {
|
||||||
let id = eco_format!("{id_base}{dash}definitions");
|
id: "definitions".into(),
|
||||||
|
name: "Definitions".into(),
|
||||||
let children = scope
|
children: scope
|
||||||
.iter()
|
.iter()
|
||||||
.map(|func| {
|
.map(|func| {
|
||||||
let id = urlify(&eco_format!("{id}-{}", func.name));
|
let id = urlify(&eco_format!("definitions-{}", func.name));
|
||||||
let children = func_outline(func, &id);
|
let children = func_outline(func, &id);
|
||||||
OutlineItem { id, name: func.title.into(), children }
|
OutlineItem { id, name: func.title.into(), children }
|
||||||
})
|
})
|
||||||
.collect();
|
.collect(),
|
||||||
|
})
|
||||||
Some(OutlineItem { id, name: "Definitions".into(), children })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a page for a group of functions.
|
/// Create a page for a group of functions.
|
||||||
@ -688,7 +687,7 @@ fn type_outline(model: &TypeModel) -> Vec<OutlineItem> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
outline.extend(scope_outline(&model.scope, ""));
|
outline.extend(scope_outline(&model.scope));
|
||||||
outline
|
outline
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user