1. Introduction
  2. Guidance
  3. 1. Get started
  4. 2. Bundles
    1. 2.1. All-in-One Library for Browsers
    2. 2.2. All-in-One Library for Node.js
  5. 3. Compilers
    1. 3.1. (Pre-)Compiler in CLI
    2. 3.2. Compiler in Rust
    3. 3.3. Compiler in Node.js
    4. 3.4. Compiler in Wasm (Web)
  6. 4. Renderers
    1. 4.1. Renderer in Rust
    2. 4.2. Renderer in Node.js
    3. 4.3. Renderer in Wasm (Web)
    4. 4.4. Renderer in React
    5. 4.5. Renderer in Solid
    6. 4.6. Renderer in Angular
    7. 4.7. Renderer in Vue3
    8. 4.8. Hexo Plugin
  7. 5. Samples
    1. 5.1. Static, Responsive rendering
    2. 5.2. Streaming, Incremental rendering
    3. 5.3. Serverless rendering
  8. 6. Trouble Shooting
  9. Project samples
  10. 8. shiroa
  11. 9. typst-preview
  12. 10. hexo-renderer-typst
  13. References
  14. 13. Routing to Renferences

reflexo-typst Documentation

#

Angular Library

Use @myriaddreamin/typst.angular.

Import the angular module containing the typst-document component.


        
/// component.module.ts

        
import { TypstDocumentModule } from '@myriaddreamin/typst.angular';

        
/// component.module.ts

        
import { TypstDocumentModule } from '@myriaddreamin/typst.angular';

And use directive typst-document in your template file.


        
<typst-document props></typst-document>

        
<typst-document props></typst-document>

#

The typst-document component

#

Typical usage


        
<typst-document

        
  fill="#343541"

        
  artifact="{{ artifact }}">

        
</typst-document>

        
<typst-document

        
  fill="#343541"

        
  artifact="{{ artifact }}">

        
</typst-document>

#

fill property

Fill document with color.


        
<typst-document fill="#343541">

        
</typst-document>

        
<typst-document fill="#343541">

        
</typst-document>

Note: Current typst.ts doesn't support a transparent background color in some browsers.

#

artifact property

Render the document with artifact from precompiler.


        
<typst-document artifact="{{ artifact }}">

        
</typst-document>

        
<typst-document artifact="{{ artifact }}">

        
</typst-document>

The artifact can be only in Vector Format to this time.

To get artifact data, please refer to Command Line Interface or All-in-one Node.js Library.

#

Set renderer initialization option for typst-document

Retrieve a typst.InitOptions for initializing the renderer for typst-document


        
typst-document.setWasmModuleInitOptions({

        
  getModule: () =>

        
    'http://localhost:20810/typst_ts_renderer_bg.wasm',

        
});

        
typst-document.setWasmModuleInitOptions({

        
  getModule: () =>

        
    'http://localhost:20810/typst_ts_renderer_bg.wasm',

        
});

The default value is:


        
{

        
  beforeBuild: [],

        
  getModule: () => '/assets/typst-ts-renderer/pkg/typst_ts_renderer_bg.wasm',

        
}

        
{

        
  beforeBuild: [],

        
  getModule: () => '/assets/typst-ts-renderer/pkg/typst_ts_renderer_bg.wasm',

        
}

#

Example: show document

See typst.angular demo for more details.