mirror of
https://github.com/typst/typst
synced 2025-05-13 12:36:23 +08:00
Remove basics section
This commit is contained in:
parent
a0674990d3
commit
1d5bf56e58
@ -126,8 +126,7 @@ fn reference_page(resolver: &dyn Resolver) -> PageModel {
|
||||
markdown_page(resolver, "/docs/reference/", "reference/styling.md"),
|
||||
markdown_page(resolver, "/docs/reference/", "reference/scripting.md"),
|
||||
types_page(resolver, "/docs/reference/"),
|
||||
category_page(resolver, "basics").with_part("Content"),
|
||||
category_page(resolver, "text"),
|
||||
category_page(resolver, "text").with_part("Content"),
|
||||
category_page(resolver, "math"),
|
||||
category_page(resolver, "layout"),
|
||||
category_page(resolver, "visualize"),
|
||||
|
@ -12,11 +12,8 @@ types: |
|
||||
In some places of Typst more specialized data types are used. Instead of listing
|
||||
all of them here, they are explained where they are relevant.
|
||||
|
||||
basics: |
|
||||
Basic structural elements of documents.
|
||||
|
||||
text: |
|
||||
Style and transform your text.
|
||||
Text styling.
|
||||
|
||||
The [text function]($func/text) is of particular interest.
|
||||
|
||||
@ -87,21 +84,21 @@ math: |
|
||||
affected by these rules.
|
||||
|
||||
layout: |
|
||||
Arrange elements on the page.
|
||||
Arranging elements on the page in different ways.
|
||||
|
||||
Combine layout functions to create complex and automatic layouts.
|
||||
By combining layout functions, you can create complex and automatic layouts.
|
||||
|
||||
visualize: |
|
||||
Draw and visualize data.
|
||||
Drawing and data visualization.
|
||||
|
||||
_Note:_ Functions for plotting and diagrams are not yet available. They will
|
||||
be in the future.
|
||||
|
||||
meta: |
|
||||
Modify and use document metadata.
|
||||
Document structuring and metadata setup.
|
||||
|
||||
Here, you can also find functions to work with other elements in the document,
|
||||
such as labels and headings.
|
||||
Here, you can find functions to structure your document and configure its
|
||||
metadata.
|
||||
|
||||
symbols: |
|
||||
These two modules give names to symbols and emoji to make them easy to insert
|
||||
@ -111,34 +108,34 @@ symbols: |
|
||||
because they also affect spacing and font style.
|
||||
|
||||
sym: |
|
||||
Insert general symbols by name.
|
||||
Named general symbols.
|
||||
|
||||
For example, `#sym.arrow` produces the → symbol. Within
|
||||
[formulas]($category/math), these symbols can be used without the `#sym.`
|
||||
prefix.
|
||||
|
||||
emoji: |
|
||||
Insert emoji by name.
|
||||
Named emoji.
|
||||
|
||||
For example, `#emoji.face` produces the 😀 emoji. If you frequently use
|
||||
certain emojis, you can also import them from the `emoji` module (`[#import
|
||||
emoji: face]`) to use them without the `#emoji.` prefix.
|
||||
|
||||
foundations: |
|
||||
Foundational functions.
|
||||
Foundational functions for computation.
|
||||
|
||||
calculate: |
|
||||
Calculate with and process numeric values.
|
||||
Calculations and processing of numeric values.
|
||||
|
||||
These functions are part of the `calc` module and not imported by default. In
|
||||
addition to the functions listed below, the `calc` module also defines the
|
||||
constants `pi`, `e`, `inf`, and `nan`.
|
||||
|
||||
construct: |
|
||||
Construct and convert between values of different types.
|
||||
Construction of and conversions between values of different types.
|
||||
|
||||
data-loading: |
|
||||
Load data from external files.
|
||||
Data loading from external files.
|
||||
|
||||
These functions help you with embedding data from experiments and APIs in your
|
||||
documents.
|
||||
|
@ -1,14 +0,0 @@
|
||||
//! Common document elements.
|
||||
|
||||
#[path = "enum.rs"]
|
||||
mod enum_;
|
||||
mod heading;
|
||||
mod list;
|
||||
mod table;
|
||||
mod terms;
|
||||
|
||||
pub use self::enum_::*;
|
||||
pub use self::heading::*;
|
||||
pub use self::list::*;
|
||||
pub use self::table::*;
|
||||
pub use self::terms::*;
|
@ -80,7 +80,7 @@ use crate::prelude::*;
|
||||
/// ```
|
||||
///
|
||||
/// ## Category
|
||||
/// basics
|
||||
/// layout
|
||||
#[func]
|
||||
#[capable(Layout)]
|
||||
#[derive(Debug, Hash)]
|
@ -63,7 +63,7 @@ use crate::text::TextNode;
|
||||
/// ```
|
||||
///
|
||||
/// ## Category
|
||||
/// basics
|
||||
/// layout
|
||||
#[func]
|
||||
#[capable(Layout)]
|
||||
#[derive(Debug, Hash)]
|
@ -3,9 +3,12 @@
|
||||
mod align;
|
||||
mod columns;
|
||||
mod container;
|
||||
#[path = "enum.rs"]
|
||||
mod enum_;
|
||||
mod flow;
|
||||
mod grid;
|
||||
mod hide;
|
||||
mod list;
|
||||
mod pad;
|
||||
mod page;
|
||||
mod par;
|
||||
@ -13,14 +16,18 @@ mod place;
|
||||
mod repeat;
|
||||
mod spacing;
|
||||
mod stack;
|
||||
mod table;
|
||||
mod terms;
|
||||
mod transform;
|
||||
|
||||
pub use self::align::*;
|
||||
pub use self::columns::*;
|
||||
pub use self::container::*;
|
||||
pub use self::enum_::*;
|
||||
pub use self::flow::*;
|
||||
pub use self::grid::*;
|
||||
pub use self::hide::*;
|
||||
pub use self::list::*;
|
||||
pub use self::pad::*;
|
||||
pub use self::page::*;
|
||||
pub use self::par::*;
|
||||
@ -28,6 +35,8 @@ pub use self::place::*;
|
||||
pub use self::repeat::*;
|
||||
pub use self::spacing::*;
|
||||
pub use self::stack::*;
|
||||
pub use self::table::*;
|
||||
pub use self::terms::*;
|
||||
pub use self::transform::*;
|
||||
|
||||
use std::mem;
|
||||
@ -40,7 +49,6 @@ use typst::model::{
|
||||
StyleVecBuilder, StyledNode,
|
||||
};
|
||||
|
||||
use crate::basics::{EnumNode, ListNode, TermItem, TermsNode};
|
||||
use crate::math::{FormulaNode, LayoutMath};
|
||||
use crate::meta::DocumentNode;
|
||||
use crate::prelude::*;
|
||||
|
@ -57,7 +57,7 @@ use crate::prelude::*;
|
||||
/// See the [grid documentation]($func/grid) for more information on gutters.
|
||||
///
|
||||
/// ## Category
|
||||
/// basics
|
||||
/// layout
|
||||
#[func]
|
||||
#[capable(Layout)]
|
||||
#[derive(Debug, Hash)]
|
@ -53,7 +53,7 @@ use crate::text::{SpaceNode, TextNode};
|
||||
/// ```
|
||||
///
|
||||
/// ## Category
|
||||
/// basics
|
||||
/// layout
|
||||
#[func]
|
||||
#[capable(Layout)]
|
||||
#[derive(Debug, Hash)]
|
@ -1,6 +1,5 @@
|
||||
//! Typst's standard library.
|
||||
|
||||
pub mod basics;
|
||||
pub mod compute;
|
||||
pub mod layout;
|
||||
pub mod math;
|
||||
@ -28,13 +27,6 @@ pub fn build() -> Library {
|
||||
fn global(math: Module, calc: Module) -> Module {
|
||||
let mut global = Scope::deduplicating();
|
||||
|
||||
// Basics.
|
||||
global.def_func::<basics::HeadingNode>("heading");
|
||||
global.def_func::<basics::ListNode>("list");
|
||||
global.def_func::<basics::EnumNode>("enum");
|
||||
global.def_func::<basics::TermsNode>("terms");
|
||||
global.def_func::<basics::TableNode>("table");
|
||||
|
||||
// Text.
|
||||
global.def_func::<text::TextNode>("text");
|
||||
global.def_func::<text::LinebreakNode>("linebreak");
|
||||
@ -63,6 +55,10 @@ fn global(math: Module, calc: Module) -> Module {
|
||||
global.def_func::<layout::HNode>("h");
|
||||
global.def_func::<layout::BoxNode>("box");
|
||||
global.def_func::<layout::BlockNode>("block");
|
||||
global.def_func::<layout::ListNode>("list");
|
||||
global.def_func::<layout::EnumNode>("enum");
|
||||
global.def_func::<layout::TermsNode>("terms");
|
||||
global.def_func::<layout::TableNode>("table");
|
||||
global.def_func::<layout::StackNode>("stack");
|
||||
global.def_func::<layout::GridNode>("grid");
|
||||
global.def_func::<layout::ColumnsNode>("columns");
|
||||
@ -89,6 +85,7 @@ fn global(math: Module, calc: Module) -> Module {
|
||||
global.def_func::<meta::RefNode>("ref");
|
||||
global.def_func::<meta::LinkNode>("link");
|
||||
global.def_func::<meta::OutlineNode>("outline");
|
||||
global.def_func::<meta::HeadingNode>("heading");
|
||||
|
||||
// Symbols.
|
||||
global.define("sym", symbols::sym());
|
||||
@ -185,11 +182,11 @@ fn items() -> LangItems {
|
||||
},
|
||||
link: |url| meta::LinkNode::from_url(url).pack(),
|
||||
ref_: |target| meta::RefNode(target).pack(),
|
||||
heading: |level, body| basics::HeadingNode { level, title: body }.pack(),
|
||||
heading: |level, body| meta::HeadingNode { level, title: body }.pack(),
|
||||
list_item: |body| layout::ListItem::List(body).pack(),
|
||||
enum_item: |number, body| layout::ListItem::Enum(number, body).pack(),
|
||||
term_item: |term, description| {
|
||||
layout::ListItem::Term(basics::TermItem { term, description }).pack()
|
||||
layout::ListItem::Term(layout::TermItem { term, description }).pack()
|
||||
},
|
||||
formula: |body, block| math::FormulaNode { body, block }.pack(),
|
||||
math_align_point: || math::AlignPointNode.pack(),
|
||||
|
@ -47,7 +47,7 @@ use crate::text::{SpaceNode, TextNode, TextSize};
|
||||
/// The logical nesting depth of the heading, starting from one.
|
||||
///
|
||||
/// ## Category
|
||||
/// basics
|
||||
/// meta
|
||||
#[func]
|
||||
#[capable(Prepare, Show, Finalize)]
|
||||
#[derive(Debug, Hash)]
|
@ -1,11 +1,13 @@
|
||||
//! Interaction between document parts.
|
||||
|
||||
mod document;
|
||||
mod heading;
|
||||
mod link;
|
||||
mod reference;
|
||||
mod outline;
|
||||
mod reference;
|
||||
|
||||
pub use self::document::*;
|
||||
pub use self::outline::*;
|
||||
pub use self::heading::*;
|
||||
pub use self::link::*;
|
||||
pub use self::outline::*;
|
||||
pub use self::reference::*;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::basics::HeadingNode;
|
||||
use super::HeadingNode;
|
||||
use crate::layout::{BlockNode, HNode, HideNode, RepeatNode, Spacing};
|
||||
use crate::prelude::*;
|
||||
use crate::text::{LinebreakNode, SpaceNode, TextNode};
|
||||
|
Loading…
x
Reference in New Issue
Block a user